Bug 243967 - [NEW PORT] net-p2p/bazarr: Automatic subtitle downloader for Sonarr and Radarr
Summary: [NEW PORT] net-p2p/bazarr: Automatic subtitle downloader for Sonarr and Radarr
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias C. Berner
URL:
Keywords: feature, needs-qa
Depends on:
Blocks:
 
Reported: 2020-02-07 22:27 UTC by Michiel van Baak Jansen
Modified: 2021-07-14 13:55 UTC (History)
7 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
bazarr-0.8.4.1.diff (183.43 KB, patch)
2020-02-07 22:27 UTC, Michiel van Baak Jansen
no flags Details | Diff
bazarr-0.8.4.2.diff (396.58 KB, patch)
2020-03-01 15:16 UTC, Michiel van Baak Jansen
no flags Details | Diff
bazarr-0.8.4.2.diff (394.21 KB, patch)
2020-03-03 13:39 UTC, Michiel van Baak Jansen
no flags Details | Diff
bazanrr-0.8.4.4.diff (404.04 KB, patch)
2020-06-08 11:22 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details | Diff
bazarr-0.9.0.2.diff (523.07 KB, patch)
2020-08-26 10:37 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details | Diff
bazarr-0.9.0.5.diff (529.43 KB, patch)
2020-10-25 11:21 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details | Diff
bazarr-0.9.0.6.diff (529.66 KB, patch)
2020-11-12 11:17 UTC, Michiel van Baak Jansen
no flags Details | Diff
bazarr 0.9.5 and bazarr-devel 0.9.6-beta.17 (70 bytes, text/plain)
2021-06-03 12:19 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details
xz compressed archive of the patch to add bazarr 0.9.5 and bazarr-devel 0.9.6.beta-17 (43.12 KB, application/x-xz)
2021-06-03 16:14 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details
0001-Add-ports-for-bazarr-and-bazarr-devel.patch (10.01 KB, patch)
2021-06-08 15:46 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details | Diff
0001-Add-ports-for-bazarr-and-bazarr-devel.patch (10.01 KB, patch)
2021-06-08 16:04 UTC, Michiel van Baak Jansen
michiel: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michiel van Baak Jansen 2020-02-07 22:27:02 UTC
Created attachment 211458 [details]
bazarr-0.8.4.1.diff

Bazarr is a companion application to Sonarr and Radarr.
It manages and downloads subtitles based on your requirements.
You define your preferences by TV show or movie
and Bazarr takes care of everything for you.

* portlint ok

Tested and running correctly on FreeBSD 12.1-RELEASE amd64
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2020-02-08 13:02:14 UTC
Review items:

- Upstream supports [1][2] Python 3.6+ (testing up to 3.8). USES=python:<version-spec> should be 3.6+ or 3.6-3.8

- lxml RUN_DEPENDS version specifier should match the version specified in upstream requirements.txt (>=4.3.0)

- All importable .py files need to be optimized/processed (pyc/pyo files). Ports using distutils (setuptools) and autoplist handle this automatically. This packages doesnt use setuptools (ask them to package and ship this via PyPI please).

Not doing so means that the pyc/pyo files will be created at run time, thereby leaving pyc/pyo orphaned files leftover after pkg removal (since they're not referenced in the pkg-plist)

Use a post-install: Python "compileall" script (provided examples/references via IRC) to process all .py files and include them in the pkg-plist.

Note: the net-p2p/couchpotato port, which this port was based on, is also affected by this (only packaging .py files)

[1] "bazarr require Python 3.6 or greater and can be run from source."
[2] "Install Python 3.6 or greater (latest is good)"
Comment 2 Michiel van Baak Jansen 2020-02-08 14:10:59 UTC
Comment on attachment 211458 [details]
bazarr-0.8.4.1.diff

Upstream needs some work first.
Comment 3 Michiel van Baak Jansen 2020-03-01 15:16:29 UTC
Created attachment 212077 [details]
bazarr-0.8.4.2.diff

Added new port bazarr.

portlint: OK
Tested and works on 12.1-RELEASE amd64

Setting up poudriere now to run testport on it.
Comment 4 Michiel van Baak Jansen 2020-03-03 13:39:21 UTC
Created attachment 212117 [details]
bazarr-0.8.4.2.diff

Removed unusable binaries and header files from source, cleaning up the installed files list a bit.

testport: 12.1-RELEASE amd64: OK
portlint: OK

Running 'in production' on my home setup (12.1-RELEASE-p2)
Comment 5 Andrej Ebert 2020-03-07 13:10:19 UTC
(In reply to Michiel van Baak from comment #4)
Works on my home server too, without any problems. Was looking into making a port myself, when I found this PR. Thanks!
Comment 6 Michiel van Baak Jansen 2020-06-08 11:22:01 UTC
Created attachment 215356 [details]
bazanrr-0.8.4.4.diff
Comment 7 Michiel van Baak Jansen 2020-08-26 10:37:47 UTC
Created attachment 217536 [details]
bazarr-0.9.0.2.diff
Comment 8 Michiel van Baak Jansen 2020-10-25 11:21:25 UTC
Created attachment 219056 [details]
bazarr-0.9.0.5.diff
Comment 9 Daniel Engberg freebsd_committer freebsd_triage 2020-10-25 13:44:01 UTC
Is it possible to unbundle libraries?
https://www.freebsd.org/doc/en/books/porters-handbook/book.html#bundled-libs
Comment 10 Michiel van Baak Jansen 2020-10-26 11:47:01 UTC
(In reply to daniel.engberg.lists from comment #9)

Yeah, that's probably better. I'll give it a shot later.
Comment 11 Michiel van Baak Jansen 2020-11-12 11:17:54 UTC
Created attachment 219594 [details]
bazarr-0.9.0.6.diff

Updated to latest bazarr release that fixes an issue with IMDB now prepending a 0 on id's
Comment 12 Michiel van Baak Jansen 2020-11-12 13:47:05 UTC
Couple of things on the unbundling:

I talked this over with the owner of the project. They are not going to unbundle anytime soon.
The main reason being (copied from chat on their public discord):

morpheus65535: TBH, I totally agree that this would be the best to do it in a perfect world :wink:
morpheus65535: Unfortunately, this is not the way we've done thing and I won't jeopardize the stability of Bazarr to make it that way
morpheus65535: There's not enough man power to maintain and support Bazarr to take that risk
morpheus65535: It's up to you bu keep in mind that it will stay an unsupported pkg.

So yeah, I can give it a shot, but the patches will be less than simple.
Some bundled libraries have local patches, which makes it a bit harder to unbundle.

I'll try to get some basic setup.py and unbundling work done in a fork of the project, but I dont know when I'll have enough time to focus on that.

Going from here, I dont know if this is ok and the current port can be added even with bundled libs, or if this really is a showstopper.
Up to the committers to decide.
Comment 13 Michiel van Baak Jansen 2021-06-03 12:19:41 UTC
Created attachment 225523 [details]
bazarr 0.9.5 and bazarr-devel 0.9.6-beta.17

Added bazarr and bazarr-devel
Updated the plist files to not be python version specific

The bundled dependencies are not unbundled. It will be a LOT of work, and there are local changes to some of them to make the software work.

I know the porters handbook states it should be unbundled, but that is not really an option here.

Both versions run-tested and build for amd64 FreeBSD 11.4, 12.2 and 13.0
Comment 14 Guangyuan Yang freebsd_committer freebsd_triage 2021-06-03 12:29:21 UTC
Could you please upload the patch file here directly?
Comment 15 Michiel van Baak Jansen 2021-06-03 13:04:21 UTC
(In reply to Guangyuan Yang from comment #14)

No, it's 1.2MB (the plist files are big, a lot of python libraries and all .py files have their compiled .pyc file listed as well) and bugzilla doesn't let me.
I got an error message from bugzilla, stating I had to upload the patch to some place and link it here.
Comment 16 Michiel van Baak Jansen 2021-06-03 16:14:48 UTC
Created attachment 225530 [details]
xz compressed archive of the patch to add bazarr 0.9.5 and bazarr-devel 0.9.6.beta-17

The 'patch' contains a link to my nginx server where I put the 'git format-patch' output since it's 1.2MB uncompressed, and I cannot upload it.

fuz and skered on libera.chat #freebsd-bugs IRC channel suggested I upload the patch after compressing it with xz. This file is that.
Comment 17 Michiel van Baak Jansen 2021-06-08 15:46:36 UTC
Created attachment 225641 [details]
0001-Add-ports-for-bazarr-and-bazarr-devel.patch

bazarr 0.9.5
bazarr-devel 0.9.6-beta.18

Bazarr is a companion application to Sonarr and Radarr that manages and
downloads subtitles based on your requirements.

- net-p2p/bazarr uses latest stable release
- net-p2p/bazarr-devel uses beta builds (created automatically from
  development branch once a day, if there were changes to that branch)
- Ports dont have bundled dependencies unbundled (yet).
  Talked this over with upstream, they are not going to unbundle
  for support-workload avoidance  and ease-of-install they get from the
  fact they bundle all dependencies on specific versions.
- Reserve UID and GID for bazarr daemon process
- Add to net-p2p/Makefile


I did not unbundle the python dependencies (like discussed before on PR 243967) as there are many, and upstream is not going to do this as they bundled specific versions to make their support load manageble.

Moved from a static pkg-plist to a TMPPLIST like it was done for the tautulli port to make maintaining that a bit easier for me.
Comment 18 Michiel van Baak Jansen 2021-06-08 16:04:38 UTC
Created attachment 225642 [details]
0001-Add-ports-for-bazarr-and-bazarr-devel.patch

Fixed COMMENT lines. Thanks to @FUZxxl on libera.chat for spotting it
Comment 19 commit-hook freebsd_committer freebsd_triage 2021-07-14 13:54:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=22d8cccfd08f6f06b9c9b7f6732611d572f622a0

commit 22d8cccfd08f6f06b9c9b7f6732611d572f622a0
Author:     Michiel van Baak Jansen <michiel@vanbaak.eu>
AuthorDate: 2021-04-28 13:20:58 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2021-07-14 13:52:51 +0000

    net-p2p/bazarr*: new ports for bazarr and bazarr-devel

    Bazarr is a companion application to Sonarr and Radarr that manages and
    downloads subtitles based on your requirements.

    - net-p2p/bazarr uses latest stable release
    - net-p2p/bazarr-devel uses beta builds (created automatically from
      development branch once a day, if there were changes to that branch)
    - Ports dont have bundled dependencies unbundled (yet).
      Talked this over with upstream, they are not going to unbundle
      for support-workload avoidance  and ease-of-install they get from the
      fact they bundle all dependencies on specific versions.
    - Reserve UID and GID for bazarr daemon process
    - Add to net-p2p/Makefile
    - The plists are auto-generated as in multimedia/tautulli.

    Website: https://www.bazarr.media
    Changelog: https://github.com/morpheus65535/bazarr/releases
    Bugtracker: https://github.com/morpheus65535/bazarr/issues

    PR:             243967

 GIDs                                       |  2 +-
 UIDs                                       |  2 +-
 net-p2p/Makefile                           |  2 ++
 net-p2p/bazarr-devel/Makefile (new)        | 47 ++++++++++++++++++++++++++++++
 net-p2p/bazarr-devel/distinfo (new)        |  3 ++
 net-p2p/bazarr-devel/files/bazarr.in (new) | 42 ++++++++++++++++++++++++++
 net-p2p/bazarr-devel/pkg-descr (new)       |  4 +++
 net-p2p/bazarr/Makefile (new)              | 46 +++++++++++++++++++++++++++++
 net-p2p/bazarr/distinfo (new)              |  3 ++
 net-p2p/bazarr/files/bazarr.in (new)       | 42 ++++++++++++++++++++++++++
 net-p2p/bazarr/pkg-descr (new)             |  4 +++
 11 files changed, 195 insertions(+), 2 deletions(-)
Comment 20 Tobias C. Berner freebsd_committer freebsd_triage 2021-07-14 13:55:01 UTC
Committed. Thanks :)