guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Hardcode “gs” path in Lilypond.


From: Ricardo Wurmus
Subject: [PATCH] Hardcode “gs” path in Lilypond.
Date: Mon, 12 Oct 2015 08:54:19 +0200
User-agent: mu4e 0.9.13; emacs 24.5.1

Hi Guix,

the attached patch changes the result of ‘(search-gs)’ in the Lilypond
backend, such that it returns the “gs” executable from the very same
version of ghostscript that Lilypond was built with.

Retaining a reference to ghostscript causes a closure increase from
309.9 to 351.2.  “gs” is required at runtime in order to compile
Lilypond files to PDF (the default output format).  Without “gs” only
the postscript file is generated and the compilation fails unless the
output format is explicitly set to something other than PDF.

~~ Ricardo

>From c98b44ba82e45ebcb802bc1852128624f647b580 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Sun, 11 Oct 2015 11:24:20 +0200
Subject: [PATCH] gnu: lilypond: Hardcode path to "gs" executable.

* gnu/packages/music.scm (lilypond)[arguments]: Add build phase
  "hardcode-path-to-gs".
---
 gnu/packages/music.scm | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 8263b60..cb8d58d 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -310,14 +310,22 @@ you to define complex tempo maps for entire songs or 
performances.")
                             (assoc-ref %build-inputs "font-tex-gyre")
                             "/share/fonts/opentype/"))
        #:phases
-       (alist-cons-before
-        'configure 'prepare-configuration
-        (lambda _
-          (substitute* "configure"
-            (("SHELL=/bin/sh") "SHELL=sh"))
-          (setenv "out" "")
-          #t)
-        %standard-phases)))
+       (modify-phases %standard-phases
+         (add-after 'unpack 'hardcode-path-to-gs
+          (lambda* (#:key inputs #:allow-other-keys)
+            (substitute* "scm/backend-library.scm"
+              (("\\(search-executable '\\(\"gs\"\\)\\)")
+               (string-append "\""
+                              (assoc-ref inputs "ghostscript")
+                              "/bin/gs"
+                              "\"" )))
+            #t))
+         (add-before 'configure 'prepare-configuration
+          (lambda _
+            (substitute* "configure"
+              (("SHELL=/bin/sh") "SHELL=sh"))
+            (setenv "out" "")
+            #t)))))
     (inputs
      `(("guile" ,guile-1.8)
        ("font-dejavu" ,font-dejavu)
-- 
2.5.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]