Subject: Re: [bug#44958] [PATCH 1/2] gnu: Add python-pytaglib.

From: Leo Famulari <[email-masked]>
Date: Mon, 30 Nov 2020 12:11:23 -0500

On Mon, Nov 30, 2020 at 04:50:46AM -0600, Martin Becze wrote:
> * gnu/packages/mp3.scm (python-pytaglib): New variable.

Thanks! 

I applied your patch along with these changes, explained below:

------
diff --git a/gnu/packages/mp3.scm b/gnu/packages/mp3.scm
index 487117cc7d..e622f703d3 100644
--- a/gnu/packages/mp3.scm
+++ b/gnu/packages/mp3.scm
@@ -602,17 +602,31 @@ fingerprinting library and the Acoustid API.")
        (uri (pypi-uri "pytaglib" version))
        (sha256
         (base32
-         "0li970qslfymz4vk1wrij2nfqw3l15cpc3fjjci48mpvg17gbnhn"))))
+         "0li970qslfymz4vk1wrij2nfqw3l15cpc3fjjci48mpvg17gbnhn"))
+       ;; Delete file generated by Cython.
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (delete-file "src/taglib.cpp")))))
     (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; Ensure that the Cython file is regenerated.
+         (add-after 'unpack 'setup-environment
+           (lambda _
+             (setenv "PYTAGLIB_CYTHONIZE" "1"))))))
     (native-inputs
-     `(("taglib" ,taglib)
+     `(("python-cython" ,python-cython)
        ("python-pytest" ,python-pytest)))
+    (inputs
+     `(("taglib" ,taglib)))
     (home-page
      "https://github.com/supermihi/pytaglib")
     (synopsis
-     "Python binding for taglib")
+     "Python bindings for taglib")
     (description
      "This package is a Python audio tagging library.  It is
 cross-platform, works with all Python versions, and is very
-simple to use yet fully feature.")
+simple to use yet fully featured.")
     (license license:gpl3+)))
------

In general, we try not to use "pre-built" C and C++ files that are
created by Cython. They are not really considered "source code" because
they are not in the format preferred for editing.

I moved the taglib dependency from native-inputs to inputs, because it
is still referred to by the built pytaglib:

------
$ guix gc --references $(./pre-inst-env guix build --no-grafts python-pytaglib) | grep taglib-1.12
/gnu/store/b12szz8wy7wxvfv2jfj5ygqkgqar03ih-taglib-1.12-beta-1 
------

And I made some minor grammatical changes in the synopsis and
description. Thanks again!