unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: "guix-devel@gnu.org" <guix-devel@gnu.org>
Subject: [PATCH] Hardcode “gs” path in Lilypond.
Date: Mon, 12 Oct 2015 08:54:19 +0200	[thread overview]
Message-ID: <87y4f8ziec.fsf@elephly.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-lilypond-Hardcode-path-to-gs-executable.patch --]
[-- Type: text/x-patch, Size: 1800 bytes --]

From c98b44ba82e45ebcb802bc1852128624f647b580 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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	other threads:[~2015-10-12  6:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12  6:54 Ricardo Wurmus [this message]
2015-10-12 18:43 ` [PATCH] Hardcode “gs” path in Lilypond Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y4f8ziec.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).