unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Rodriguez <yewscion@gmail.com>
To: 52684@debbugs.gnu.org
Subject: bug#52684: [BUG] Multiple Packages Failing to Build
Date: Mon, 27 Dec 2021 13:18:44 -0500	[thread overview]
Message-ID: <ebf1721f-d941-9b3e-bb39-fa1cef82d5e9@gmail.com> (raw)
In-Reply-To: <7ee7ed76-4676-6c86-87f0-8d7ab886fc50@gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 799 bytes --]

Alright, I've gotten it working.

After discussing on IRC with a few different people, I decided that 
making a new beets-specific variable was probably the best way forward. 
I've created $GUIX_BEETSPLUGINS for this purpose, which points to 
`/gnu/store/xxx-profile/lib/python3.9/site-packages`, and appended it to 
the $GUIX_PYTHONPATH which wraps 'beets'.

I've also wrapped the whole definition in a `let` to programmatically 
set the python version, so it is easier to update should it change. 
Ideally, this would be set from the input python's version, but I don't 
know how to do that (yet).

I've also taken the liberty of moving all of the 
unnecessarily-propagated inputs to 'beets-bandcamp' and made them normal 
inputs.

Patch is attached, let me know what You think.

[-- Attachment #1.1.2: 0001-Added-GUIX_BEETSPLUGINS-variable.patch --]
[-- Type: text/x-patch, Size: 8511 bytes --]

From 5ebae013a269c0d82a6d3af9124514bbb0d7536f Mon Sep 17 00:00:00 2001
From: Christopher Rodriguez <yewscion@gmail.com>
Date: Tue, 21 Dec 2021 14:25:51 -0500
Subject: [PATCH] Added $GUIX_BEETSPLUGINS variable

---
 gnu/packages/music.scm | 177 ++++++++++++++++++++++++-----------------
 1 file changed, 102 insertions(+), 75 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index ba0658470c..f0fa69964a 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -3780,82 +3780,98 @@ (define-public instantmusic
     (license license:expat))))
 
 (define-public beets
-  (package
-    (name "beets")
-    (version "1.5.0")
-    (source (origin
-              (method url-fetch)
-              (uri (pypi-uri "beets" version))
-              (sha256
-               (base32
-                "0arl4nc3y8iwa331hf6ggai19y8ns9pl03g5d6ac857wq2x7nzw8"))))
-    (build-system python-build-system)
-    (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'set-HOME
-           (lambda _
-             (setenv "HOME" (string-append (getcwd) "/tmp"))
-             #t))
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "pytest" "-v" "test"))))
-         ;; 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))))))
-    (native-inputs
-     (list gobject-introspection
-           python-flask
-           python-mock
-           python-py7zr
-           python-pytest-6
-           python-responses))
-    (inputs
-     (list bash-minimal
-           gst-plugins-base
-           gst-plugins-good
-           gstreamer
-           python-confuse
-           python-jellyfish
-           python-mediafile
-           python-munkres
-           python-musicbrainzngs
-           python-pyyaml
-           python-six
-           python-unidecode
-           ;; Optional dependencies for plugins. Some of these are also required by tests.
-           python-beautifulsoup4 ; For lyrics.
-           python-discogs-client ; For discogs.
-           python-mpd2 ; For mpdstats.
-           python-mutagen ; For scrub.
-           python-langdetect ; For lyrics.
-           python-pillow ; For fetchart, embedart, thumbnails.
-           python-pyacoustid ; For chroma.
-           python-pygobject ; For bpd, replaygain.
-           python-pylast ; For lastgenre, lastimport.
-           python-pyxdg ; For thumbnails.
-           python-rarfile ; For import.
-           python-reflink ; For reflink.
-           python-requests
-           python-requests-oauthlib)) ; For beatport.
-    (home-page "https://beets.io")
-    (synopsis "Music organizer")
-    (description "The purpose of beets is to get your music collection
+  (let ((beets-python-version "3.9"))
+    (package
+      (name "beets")
+      (version "1.5.0")
+      (source (origin
+                (method url-fetch)
+                (uri (pypi-uri "beets" version))
+                (sha256
+                 (base32
+                  "0arl4nc3y8iwa331hf6ggai19y8ns9pl03g5d6ac857wq2x7nzw8"))))
+      (build-system python-build-system)
+      ;; Beets plugins are found by beets via PYTHONPATH; the following
+      ;; search path ensures that they are found even when Python is not
+      ;; present in the profile.
+      (native-search-paths
+       ;; XXX: Attempting to use (package-native-search-paths python) here would
+       ;; cause an error about python being an unbound variable in the
+       ;; tests. Instead, we set and use an explicit python version.
+       (list
+        (search-path-specification
+         (variable "GUIX_BEETSPLUGINPATH")
+         (separator #f)
+         (files (list (string-append "lib/python" beets-python-version "/site-packages"))))))
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'set-HOME
+             (lambda _
+               (setenv "HOME" (string-append (getcwd) "/tmp"))
+               #t))
+           (replace 'check
+             (lambda* (#:key tests? #:allow-other-keys)
+               (when tests?
+                 (invoke "pytest" "-v" "test"))))
+           ;; 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"))
+                      (gst-plugins (getenv "GST_PLUGIN_SYSTEM_PATH"))
+                      (beets-plugins ":${GUIX_BEETSPLUGINPATH}")
+                      (types (getenv "GI_TYPELIB_PATH")))
+                 (wrap-program prog
+                   `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugins))
+                   `("GI_TYPELIB_PATH" ":" prefix (,types))
+                   `("GUIX_PYTHONPATH" ":" prefix (,beets-plugins))))
+               #t)))))
+      (native-inputs
+       (list gobject-introspection
+             python-flask
+             python-mock
+             python-py7zr
+             python-pytest-6
+             python-responses))
+      (inputs
+       (list bash-minimal
+             gst-plugins-base
+             gst-plugins-good
+             gstreamer
+             python
+             python-confuse
+             python-jellyfish
+             python-mediafile
+             python-munkres
+             python-musicbrainzngs
+             python-pyyaml
+             python-six
+             python-unidecode
+             ;; Optional dependencies for plugins. Some of these are also required by tests.
+             python-beautifulsoup4 ; For lyrics.
+             python-discogs-client ; For discogs.
+             python-mpd2 ; For mpdstats.
+             python-mutagen ; For scrub.
+             python-langdetect ; For lyrics.
+             python-pillow ; For fetchart, embedart, thumbnails.
+             python-pyacoustid ; For chroma.
+             python-pygobject ; For bpd, replaygain.
+             python-pylast ; For lastgenre, lastimport.
+             python-pyxdg ; For thumbnails.
+             python-rarfile ; For import.
+             python-reflink ; For reflink.
+             python-requests
+             python-requests-oauthlib)) ; For beatport.
+      (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.")
-    (license license:expat)))
+      (license license:expat))))
 
 (define-public beets-next
   (deprecated-package "beets-next" beets))
@@ -3871,10 +3887,21 @@ (define-public beets-bandcamp
                (base32
                 "0dwbdkrb9c0ppzm5s78h47ndpr88cw1k0z8fgfhkl706wazx2ddg"))))
     (build-system python-build-system)
-    (arguments '(#:tests? #f))          ; there are no tests
+    (arguments
+     `(#:tests? #f))
     (propagated-inputs
-     (list beets python-isodate python-beautifulsoup4 python-requests
-           python-six))
+     (list python-isodate))
+    (inputs
+     (list beets
+           python-beautifulsoup4
+           python-confuse
+           python-jellyfish
+           python-mediafile
+           python-munkres
+           python-musicbrainzngs
+           python-pyyaml
+           python-six
+           python-unidecode))
     (home-page "https://github.com/unrblt/beets-bandcamp")
     (synopsis "Bandcamp plugin for beets")
     (description
-- 
2.34.0


[-- Attachment #1.1.3: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 4045 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  parent reply	other threads:[~2021-12-27 18:19 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 19:17 bug#52684: [BUG] Multiple Packages Failing to Build Christopher Rodriguez
2021-12-21  0:36 ` zimoun
2021-12-21 17:52 ` Christopher Rodriguez
2021-12-21 18:02   ` Maxime Devos
2021-12-21 18:08     ` Christopher Rodriguez
2021-12-21 19:47 ` Christopher Rodriguez
2021-12-21 20:44   ` Maxime Devos
2021-12-21 21:38 ` Christopher Rodriguez
2021-12-21 22:38   ` Maxime Devos
2021-12-22 17:07 ` Christopher Rodriguez
2021-12-22 17:36   ` Maxime Devos
2021-12-22 19:59 ` Christopher Rodriguez
2021-12-22 20:50   ` Maxime Devos
2021-12-22 20:54     ` Maxime Devos
2021-12-22 21:57     ` Christopher Rodriguez
2021-12-23  9:27       ` Maxime Devos
2021-12-22 20:53   ` Maxime Devos
2021-12-27 18:18 ` Christopher Rodriguez [this message]
2021-12-27 20:06   ` Maxime Devos
2021-12-30 10:20   ` Maxime Devos
2021-12-30 10:29   ` Maxime Devos
2021-12-27 20:36 ` Christopher Rodriguez
2022-01-02 13:53 ` Christopher Rodriguez
2022-06-23  0:58 ` bug#52684: [PATCH v1] Updated and fixed frotz package Christopher Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebf1721f-d941-9b3e-bb39-fa1cef82d5e9@gmail.com \
    --to=yewscion@gmail.com \
    --cc=52684@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).