Patchwork gnu: Add denemo.

login
register
mail settings
Submitter Kei Yamashita
Date Dec. 11, 2016, 10:49 p.m.
Message ID <8737hu5bfg.fsf@openmailbox.org>
Download mbox | patch
Permalink /patch/18379/
State New
Headers show

Comments

Kei Yamashita - Dec. 11, 2016, 10:49 p.m.
Ricardo Wurmus <rekado@elephly.net> writes:

> Kei Kebreau <kei@openmailbox.org> writes:
>
>> Indeed it is not. I've removed these inputs from the new patch. As a
>> side note, lilypond was required as a runtime dependency so I moved it
>> to propagated-inputs.
>
> Do you think it would be possible to patch the sources to refer to the
> Lilypond executable instead of propagating the input?

Good idea! Does this patch look good to you?
From a52e6b330b6bd9f136d9c3c750b5c6dff0306ee0 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <kei@openmailbox.org>
Date: Sun, 11 Dec 2016 17:23:32 -0500
Subject: [PATCH] gnu: denemo: Change default preferences to use the
 already-present lilypond.

* gnu/packages/music.scm (denemo)[progpagated-inputs]: Move lilypond to ...
[inputs]: ... here.
[phases]: New phase set-lilypond.
---
 gnu/packages/music.scm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
Ricardo Wurmus - Dec. 12, 2016, 6:32 a.m.
Kei Kebreau <kei@openmailbox.org> writes:

> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Kei Kebreau <kei@openmailbox.org> writes:
>>
>>> Indeed it is not. I've removed these inputs from the new patch. As a
>>> side note, lilypond was required as a runtime dependency so I moved it
>>> to propagated-inputs.
>>
>> Do you think it would be possible to patch the sources to refer to the
>> Lilypond executable instead of propagating the input?
>
> Good idea! Does this patch look good to you?

Yes, thank you!

Patch

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 116e8d482..4297f846f 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -251,6 +251,18 @@  many input formats and provides a customisable Vi-style user interface.")
            ;; testsuite.
            (lambda _
              (zero? (system* "make" "-C" "tests" "check"))))
+         (add-before 'build 'set-lilypond
+           ;; This phase sets the default path for lilypond to its current
+           ;; location in the store.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((lilypond (string-append (assoc-ref inputs "lilypond")
+                                             "/bin/lilypond")))
+               (substitute* "src/core/prefops.c"
+                 (("g_string_new \\(\"lilypond\"\\);")
+                  (string-append "g_string_new (\""
+                                 lilypond
+                                 "\");"))))
+             #t))
          (add-after 'install 'correct-filename
            ;; "graft-derivation/shallow" from the (guix grafts) module runs in
            ;; the C locale, expecting file names to be ASCII encoded. This
@@ -283,11 +295,10 @@  many input formats and provides a customisable Vi-style user interface.")
        ("libsndfile" ,libsndfile)
        ("libtool" ,libtool)
        ("libxml2" ,libxml2)
+       ("lilypond", lilypond)
        ("portaudio" ,portaudio)
        ("portmidi" ,portmidi)
        ("rubberband" ,rubberband)))
-    (propagated-inputs
-     `(("lilypond", lilypond)))
     (synopsis "Graphical music notation, front-end to GNU Lilypond")
     (description
      "GNU Denemo is a music notation editor that provides a convenient