From patchwork Wed Sep 1 07:22:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Streit X-Patchwork-Id: 32483 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 998DF27BBE3; Wed, 1 Sep 2021 08:23:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0BC0527BBE1 for ; Wed, 1 Sep 2021 08:23:13 +0100 (BST) Received: from localhost ([::1]:50562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mLKaW-0000Fu-20 for patchwork@mira.cbaines.net; Wed, 01 Sep 2021 03:23:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mLKaN-0000FX-46 for guix-patches@gnu.org; Wed, 01 Sep 2021 03:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mLKaM-0000V8-S3 for guix-patches@gnu.org; Wed, 01 Sep 2021 03:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mLKaM-0002rl-Gy for guix-patches@gnu.org; Wed, 01 Sep 2021 03:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50309] [PATCH 0/5] New version of beets Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Sep 2021 07:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50309 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 50309@debbugs.gnu.org Received: via spool by 50309-submit@debbugs.gnu.org id=B50309.163048097410991 (code B ref 50309); Wed, 01 Sep 2021 07:23:02 +0000 Received: (at 50309) by debbugs.gnu.org; 1 Sep 2021 07:22:54 +0000 Received: from localhost ([127.0.0.1]:36051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKa9-0002r8-IM for submit@debbugs.gnu.org; Wed, 01 Sep 2021 03:22:54 -0400 Received: from smtprelay01.ispgateway.de ([80.67.18.13]:14809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mLKa3-0002qu-Kq for 50309@debbugs.gnu.org; Wed, 01 Sep 2021 03:22:48 -0400 Received: from [2.247.248.75] (helo=milk) by smtprelay01.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mLKaX-0004aj-W0; Wed, 01 Sep 2021 09:23:14 +0200 From: Simon Streit References: Gcc: nnfolder+archive:sent.2021-09 Date: Wed, 01 Sep 2021 09:22:40 +0200 In-Reply-To: (Maxime Devos's message of "Tue, 31 Aug 2021 23:48:25 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Df-Sender: bGlzdHNAbmV0cGFuaWMub3Jn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi Maxime! Maxime Devos writes: > Simon Streit schreef op di 31-08-2021 om 22:49 [+0200]: >> Along the way, I noticed -- even with v1.4.9 -- beets would >> not find the fpcalc. Fpcalc is part of chromaprint and while this >> package is an optional dependency, I put it into propagated-inputs and >> solved this issue somehow. > > beets is probably searching for 'fpcalc' in $PATH, instead of using a string > like /gnu/store/.../bin/fpcalc. This can usually be resolved with substitute*, > to turn something like 'system("fpcalc --stuff")' into > 'system("/gnu/store/.../bin/fpcalc --stuff")' (that's for C code, the python > equivalent might be a little different). Thanks for pointing this out. I modified it and placed a wrapper so that beets can find chromaprint. ### Begin Patch ### gnu: beets: Update to 1.5.0. Remove beets-next, and remove patch. * gnu/packages/music.scm (beets): Update to 1.5.0. * gnu/packages/music.scm (beets-next): Delete variable. * gnu/packages/patches/beets-werkzeug-compat.patch: Delete patch. --- gnu/packages/music.scm | 120 ++++++------------ .../patches/beets-werkzeug-compat.patch | 18 --- 2 files changed, 42 insertions(+), 96 deletions(-) delete mode 100644 gnu/packages/patches/beets-werkzeug-compat.patch diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index 63c6ac7d19..51e760e866 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -3788,34 +3788,45 @@ websites such as Libre.fm.") (define-public beets (package (name "beets") - (version "1.4.9") + (version "1.5.0") (source (origin (method url-fetch) (uri (pypi-uri "beets" version)) - (patches (search-patches "beets-werkzeug-compat.patch")) (sha256 (base32 - "0m40rjimvfgy1dv04p8f8d5dvi2855v4ix99a9xr900cmcn476yj")))) + "0arl4nc3y8iwa331hf6ggai19y8ns9pl03g5d6ac857wq2x7nzw8")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases - ;; Reported upstream: . - ;; Disable the faulty test as the fix is unclear. + ;; Test fails. Reported upstream: + ;; https://github.com/beetbox/beets/issues/4037. (add-after 'unpack 'disable-failing-tests (lambda _ - (substitute* "test/test_mediafile.py" - (("def test_read_audio_properties") "def _test_read_audio_properties")) + (substitute* "test/test_zero.py" + (("def test_album_art") "def _test_album_art")) #t)) (add-after 'unpack 'set-HOME (lambda _ (setenv "HOME" (string-append (getcwd) "/tmp")) #t)) (replace 'check - (lambda _ - (invoke "nosetests" "-v"))) - ;; Wrap the executable, so it can find python-gi (aka pygobject) and - ;; gstreamer plugins. + (lambda _ (invoke "nosetests" "-v"))) + ;; Wrap the executable, so it can find chromaprint (fpcalc). + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (chromaprint (assoc-ref inputs "chromaprint"))) + (wrap-program (string-append out "/bin/beet") + `("XDG_DATA_DIRS" ":" prefix (,out)) + `("PATH" ":" prefix + ,(map (lambda (dir) + (string-append dir "/bin:" + dir "/sbin")) + (list chromaprint)))) + #t))) + ;; Wrap the executable, so it can find python-gi (aka + ;; pygobject) and gstreamer plugins. (add-after 'wrap 'wrap-typelib (lambda* (#:key outputs #:allow-other-keys) (let ((prog (string-append (assoc-ref outputs "out") @@ -3827,8 +3838,11 @@ websites such as Libre.fm.") `("GI_TYPELIB_PATH" ":" prefix (,types))) #t)))))) (native-inputs - `(("python-beautifulsoup4" ,python-beautifulsoup4) + `(("gobject-introspection" ,gobject-introspection) + ("python-beautifulsoup4" ,python-beautifulsoup4) + ("python-confuse" ,python-confuse) ("python-flask" ,python-flask) + ("python-mediafile" ,python-mediafile) ("python-mock" ,python-mock) ("python-mpd2" ,python-mpd2) ("python-nose" ,python-nose) @@ -3839,83 +3853,33 @@ websites such as Libre.fm.") ("python-responses" ,python-responses))) ;; TODO: Install optional plugins and dependencies. (inputs - `(("python-discogs-client" ,python-discogs-client) + `(("bash-minimal" ,bash-minimal) + ("chromaprint" ,chromaprint) + ("gst-plugins-base" ,gst-plugins-base) + ("gst-plugins-good" ,gst-plugins-good) + ("gstreamer" ,gstreamer) + ("opusfile" ,opusfile) + ("python-discogs-client" ,python-discogs-client) ("python-jellyfish" ,python-jellyfish) ("python-munkres" ,python-munkres) ("python-musicbrainzngs" ,python-musicbrainzngs) ("python-mutagen" ,python-mutagen) ("python-pyacoustid" ,python-pyacoustid) - ("python-pyyaml" ,python-pyyaml) - ("python-unidecode" ,python-unidecode) ;; For plugin replaygain. ("python-pygobject" ,python-pygobject) - ("gobject-introspection" ,gobject-introspection) - ("gst-plugins-base" ,gst-plugins-base) - ("gst-plugins-good" ,gst-plugins-good) - ("gstreamer" ,gstreamer))) + ("python-pyyaml" ,python-pyyaml) + ("python-reflink" ,python-reflink) + ("python-requests-oauthlib" ,python-requests-oauthlib) + ("python-unidecode" ,python-unidecode))) (home-page "https://beets.io") (synopsis "Music organizer") - (description "The purpose of beets is to get your music collection right - once and for all. It catalogs your collection, automatically improving its - metadata as it goes using the MusicBrainz database. Then it provides a variety - of tools for manipulating and accessing your music.") + (description "The purpose of beets is to get your music collection +right once and for all. It catalogs your collection, automatically +improving its metadata as it goes using the MusicBrainz database. +Then it provides a variety of tools for manipulating and accessing +your music.") (license license:expat))) -(define-public beets-next - (let ((commit "04ea754d00e2873ae9aa2d9e07c5cefd790eaee2") - (revision "1")) - (package - (inherit beets) - (name "beets-next") - (version (git-version (package-version beets) revision commit)) - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/beetbox/beets") - (commit commit))) - (file-name (git-file-name "beets" version)) - (sha256 - (base32 - "092a9sss2shhcjmpgbwvscv8brpm5970i5hddkhi81xcff3bg1h4")))) - (arguments - `(#:phases - (modify-phases %standard-phases - ;; XXX: unclear why this fails - (add-after 'unpack 'disable-failing-tests - (lambda _ - (substitute* "test/test_zero.py" - (("def test_album_art") "def _test_album_art")) - #t)) - (add-after 'unpack 'set-HOME - (lambda _ - (setenv "HOME" (string-append (getcwd) "/tmp")) - #t)) - (replace 'check - (lambda _ - ;; Resources must be writable. - (for-each make-file-writable - (find-files "test/rsrc" ".")) - (invoke "nosetests" "-v"))) - ;; Wrap the executable, so it can find python-gi (aka pygobject) and - ;; gstreamer plugins. - (add-after 'wrap 'wrap-typelib - (lambda* (#:key outputs #:allow-other-keys) - (let ((prog (string-append (assoc-ref outputs "out") - "/bin/beet")) - (plugins (getenv "GST_PLUGIN_SYSTEM_PATH")) - (types (getenv "GI_TYPELIB_PATH"))) - (wrap-program prog - `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,plugins)) - `("GI_TYPELIB_PATH" ":" prefix (,types))) - #t)))))) - (inputs - `(("python-confuse" ,python-confuse) - ("python-mediafile" ,python-mediafile) - ("python-reflink" ,python-reflink) - ("python-requests-oauthlib" ,python-requests-oauthlib) - ("opusfile" ,opusfile) - ,@(package-inputs beets)))))) - (define-public beets-bandcamp (package (name "beets-bandcamp") diff --git a/gnu/packages/patches/beets-werkzeug-compat.patch b/gnu/packages/patches/beets-werkzeug-compat.patch deleted file mode 100644 index 1a91c3a3f9..0000000000 --- a/gnu/packages/patches/beets-werkzeug-compat.patch +++ /dev/null @@ -1,18 +0,0 @@ -Be compatible with python-werkzeug 1.0.0. - -Taken from upstream: -https://github.com/beetbox/beets/commit/d43d54e21cde97f57f19486925ab56b419254cc8 - -diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py -index f53fb3a954..21ff5d94ed 100644 ---- a/beetsplug/web/__init__.py -+++ b/beetsplug/web/__init__.py -@@ -169,7 +169,7 @@ def to_python(self, value): - return ids - - def to_url(self, value): -- return ','.join(value) -+ return ','.join(str(v) for v in value) - - - class QueryConverter(PathConverter):