]> git.donarmstrong.com Git - lilypond.git/commitdiff
strip lilypond/usr/ from LD_LIBRARY_PATH.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 10 Dec 2006 12:24:10 +0000 (13:24 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 10 Dec 2006 12:26:47 +0000 (13:26 +0100)
(cherry picked from 32b9ae2fc359aa8bbed41f05220346b6d9bdde3f commit)

scripts/lilypond-invoke-editor.scm

index 048ac3f53b3021fa005478e3ace188f1e3fd02f4..275aa901d88304e05d08f1cd1cbaffddbdf1c8f9 100755 (executable)
@@ -12,6 +12,7 @@
 (use-modules
  (ice-9 getopt-long)
  (ice-9 regex)
+ (srfi srfi-1)
  (srfi srfi-13)
  (srfi srfi-14))
 
@@ -23,7 +24,6 @@
 
 ;; argv0 relocation -- do in wrapper?
 
-
 (define LILYPONDPREFIX
   (let* ((prefix
          (or (getenv "LILYPONDPREFIX")
@@ -124,6 +124,19 @@ Options:
        (format "~a ~a" (getenv "BROWSER") uri)
        (format #f "firefox -remote 'OpenURL(~a,new-tab)'" uri))))
 
+
+(define (strip-framework-path var)
+  (define pat "lilypond/usr")
+  (let*
+      ((val (getenv var))
+       (paths (string-split val #\:))
+       (without (remove (lambda (s) (string-contains s pat))
+                       paths)))
+
+    (if (not (= (length without)
+               (length paths)))
+       (setenv var (string-join without ":")))))
+
 (define (main args)
   (let ((files (parse-options args)))
     (if (running-from-gui?)
@@ -138,8 +151,10 @@ Options:
          (show-help (current-error-port))
          (exit 2)))
     (set! %load-path (cons LILYPONDPREFIX %load-path))
+
     (primitive-eval '(use-modules (scm editor)))
 
+    (strip-framework-path "LD_LIBRARY_PATH")
     (let* ((uri (car files)))
       (if (is-textedit-uri? uri)
          (run-editor uri)