[bug#54571] gnu: music21: Patch executables and add missing dependencies.
Commit Message
* gnu/packages/music.scm (music21)[arguments]: Patch executables.
[propagated-inputs]: Add python-matplotlib, python-jsonpickle, and
python-numpy.
[inputs]: Add lilypond, musescore, and xdg-utils.
---
gnu/packages/music.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
Comments
jgart via Guix-patches via schreef op vr 25-03-2022 om 21:12 [-0400]:
> + (("/usr/bin/lilypond") (which "lilypond"))
> + (("/usr/bin/mscore3") (which "mscore"))
> + (("/usr/bin/xdg-open") (which "xdg-open"))
> + (("LILYEXEC = 'lilypond'")
> + (string-append "LILYEXEC = '" (which "lilypond") "'")))))
> [...]
> + (inputs
> + (list lilypond
> + musescore
> + xdg-utils))
'which' looks in native-inputs, not the 'inputs', so this is probably
incorrect when cross-compiling. I suggest using (search-input-file
inputs "/bin/lilypond") instead.
Greetings,
Maxime.
jgart via Guix-patches via schreef op vr 25-03-2022 om 21:12 [-0400]:
> (propagated-inputs
> - (list python-chardet python-joblib python-more-itertools
> - python-webcolors))
> + (list python-chardet
> + python-joblib
> + python-matplotlib
> + python-jsonpickle
> + python-more-itertools
> + python-webcolors
> + python-numpy))
It is a tool, and not (only?) a library, so do these need to be
propagated, or would some wrapping suffice?
Greetings,
Maxime.
@@ -1531,6 +1531,15 @@ (define-public music21
(arguments
`(#:phases
(modify-phases %standard-phases
+ (add-before 'build 'patch-executables
+ (lambda _
+ (substitute* '("music21/environment.py"
+ "music21/lily/translate.py")
+ (("/usr/bin/lilypond") (which "lilypond"))
+ (("/usr/bin/mscore3") (which "mscore"))
+ (("/usr/bin/xdg-open") (which "xdg-open"))
+ (("LILYEXEC = 'lilypond'")
+ (string-append "LILYEXEC = '" (which "lilypond") "'")))))
(replace 'check
(lambda* (#:key tests? inputs outputs #:allow-other-keys)
(when tests?
@@ -1538,8 +1547,17 @@ (define-public music21
;; See: https://github.com/cuthbertLab/music21/issues/1164
(invoke "python" "-m" "music21.stream.tests")))))))
(propagated-inputs
- (list python-chardet python-joblib python-more-itertools
- python-webcolors))
+ (list python-chardet
+ python-joblib
+ python-matplotlib
+ python-jsonpickle
+ python-more-itertools
+ python-webcolors
+ python-numpy))
+ (inputs
+ (list lilypond
+ musescore
+ xdg-utils))
(home-page "https://web.mit.edu/music21/")
(synopsis "Toolkit for Computational Musicology")
(description