gnu: python-discid: Switch to pyproject.

* gnu/packages/music.scm (python-discid):
[build-system]: Switch to pyproject-build-system.
[arguments]: Improve style.
<#:test-flags>: Ignore failing tests.
[native-inputs]: Add python-pytest, python-setuptools.

Change-Id: I7662ed899159a5cab6b610bbb4ebb1bfe845e194
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-12-27 11:23:06 +01:00 committed by Sharlatan Hellseher
parent 66fb4f7327
commit 5d65dde9e9
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -6193,23 +6193,26 @@ ISRCs and the MCN (=UPC/EAN) from disc.")
(method url-fetch)
(uri (pypi-uri "discid" version))
(sha256
(base32
"1fgp67nhqlbvhhwrcxq5avil7alpzw4s4579hlyvxzbphdnbz8vq"))))
(build-system python-build-system)
(inputs
(list libdiscid))
(base32 "1fgp67nhqlbvhhwrcxq5avil7alpzw4s4579hlyvxzbphdnbz8vq"))))
(build-system pyproject-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-before 'build 'set-libdiscid
;; Set path of libdiscid
(lambda* (#:key inputs #:allow-other-keys)
(let ((discid (assoc-ref inputs "libdiscid")))
(substitute* "discid/libdiscid.py"
(("lib_name = (.*)$" all name)
(string-append "lib_name = \"" discid
"/lib/libdiscid.so.0\"\n")))
#t))))))
(list
#:test-flags
#~(list "-k" (string-join
(list "not test_read_features"
"test_read_put"
"test_read_simple")
" and not "))
#:phases
#~(modify-phases %standard-phases
(add-before 'build 'set-libdiscid
(lambda* (#:key inputs #:allow-other-keys)
(let ((discid (search-input-file inputs "/lib/libdiscid.so.0")))
(substitute* "discid/libdiscid.py"
(("lib_name = (.*)$" all name)
(string-append "lib_name = \"" discid "\"\n")))))))))
(native-inputs (list python-pytest python-setuptools))
(inputs (list libdiscid))
(home-page "https://python-discid.readthedocs.io/")
(synopsis "Python bindings for Libdiscid")
(description