]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/backend-library.scm (postscript->pdf):
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 10 Jun 2005 08:19:19 +0000 (08:19 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 10 Jun 2005 08:19:19 +0000 (08:19 +0000)
* scm/ps-to-png.scm (make-ps-images): Do not use gs -q switch in
verbose mode.  Search for several names of gs executable.

ChangeLog
VERSION
scm/backend-library.scm
scm/ps-to-png.scm

index f6654afcb659d2d7449a64da56c45842d5561f81..144c2109c75f7f6a35fed3c6142aed9325f41a93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-06-10  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scm/backend-library.scm (postscript->pdf):
+       * scm/ps-to-png.scm (make-ps-images): Do not use gs -q switch in
+       verbose mode.  Search for several names of gs executable.
+
 2005-06-10  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
        * lily/ly-module.cc (ly_make_anonymous_module): call make-module
diff --git a/VERSION b/VERSION
index ea4a6e3d0e3818b33c414c5c763f3c97e138bf4c..b53029edd03a362c1a53bc68d34f88c79cb451f3 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=5
-PATCH_LEVEL=30
+PATCH_LEVEL=29
 MY_PATCH_LEVEL=
 
index d7a2cef49e29b0393c751bf637c447e84587b585..8a9de3b665b951b3afa749b51a6344a40fb892cf 100644 (file)
    (regexp-substitute/global #f "[^- 0-9,.a-zA-Z'\"\\]" str 'pre 'post)
    "\""))
 
+(define-public (search-executable names)
+  (define (helper path lst)
+    (if (null? (cdr lst))
+       (car lst)
+       (if (search-path path (car lst)) (car lst)
+           (helper path (cdr lst)))))
+
+  (let ((path (parse-path (getenv "PATH"))))
+    (helper path names)))
+
+(define-public (search-gs)
+  (search-executable '("gs-nox" "gs-8.15" "gs")))
+
 (define-public (postscript->pdf papersizename name)
   (let* ((pdf-name (string-append (basename name ".ps") ".pdf"))
         (cmd (format #f
-                     "gs\
+                     "~a\
+ ~a\
  ~a\
  -dCompatibilityLevel=1.4 \
  -sPAPERSIZE=~a\
- -q\
  -dNOPAUSE\
  -dBATCH\
  -r1200 \
@@ -48,6 +61,8 @@
  -c .setpdfwrite\
  -f ~S\
 "
+                     (search-gs)
+                     (if (ly:get-option 'verbose) "" "-q")
                      (if (ly:get-option 'gs-font-load)
                          " -dNOSAFER "
                          " -dSAFER ")
index 0908ffe9c8f7f6e690d444d09de8d368b4ca899c..1f752eb3039e80f80562ead6bfec6f31e4f3dc2d 100644 (file)
 (define (re-sub re sub string)
   (regexp-substitute/global #f re string 'pre sub 'post))
 
+(define (search-executable names)
+  (define (helper path lst)
+    (if (null? (cdr lst))
+       (car lst)
+       (if (search-path path (car lst)) (car lst)
+           (helper path (cdr lst)))))
+
+  (let ((path (parse-path (getenv "PATH"))))
+    (helper path names)))
+
+(define (search-gs)
+  (search-executable '("gs-nox" "gs-8.15" "gs")))
+
 (define (gulp-port port max-length)
   (let ((str (make-string max-length)))
     (read-string!/partial str port)
 
          ;;png16m is because Lily produces color nowadays.
          (cmd (if multi-page?
-                  (format #f "gs\
+                  (format #f "~a\
+ ~a\
  -dGraphicsAlphaBits=4\
  -dNOPAUSE\
  -dTextAlphaBits=4\
  -sDEVICE=png16m\
  -sOutputFile='~a'\
  -sPAPERSIZE=~a\
- -q\
  -r~S\
  '~a'\
  -c showpage\
  -c quit" output-file paper-size resolution ps-name)
-                  (format #f "gs\
+                  (format #f "~a\
+ ~a\
  -s\
  -dGraphicsAlphaBits=4\
  -dEPSCrop\
  -dTextAlphaBits=4\
  -sDEVICE=png16m\
  -sOutputFile='~a'\
- -q\
  -r~S\
  '~a'\
- -c quit" output-file resolution ps-name)))
+ -c quit"
+                          (search-gs)
+                          (if verbose? "" "-q")
+                          output-file resolution ps-name)))
          (foo (for-each delete-file (append (dir-re "." png1)
                                             (dir-re "." pngn-re))))
          (bar (if verbose?