]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix backend-svg.ly for ubuntu 6.06
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 19 Mar 2007 02:32:27 +0000 (23:32 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 19 Mar 2007 02:32:27 +0000 (23:32 -0300)
-Invoke external program with ly:start-environment
-Make mf/out/fonts.conf, and use it during invocation

GNUmakefile.in
input/regression/backend-svg.ly
mf/GNUmakefile
scm/backend-library.scm

index 13e0f75b71b1d242eed3cb6fad83b7da06ee462d..40e50d542b5dc787b2b670dd2bdd837706501d44 100644 (file)
@@ -178,10 +178,13 @@ $(tree-share-prefix)/lilypond-force link-tree: GNUmakefile $(outdir)/VERSION
 $(tree-share-prefix)/mf-link-tree link-mf-tree: $(tree-share-prefix)/lilypond-force
        -rm -f $(tree-share-prefix)/fonts/otf/* &&  \
        rm -f $(tree-share-prefix)/fonts/svg/* &&  \
+       rm -f $(tree-share-prefix)/fonts/fonts.conf &&  \
        rm -f $(tree-share-prefix)/fonts/tfm/* &&  \
        rm -f $(tree-share-prefix)/fonts/type1/* &&  \
                cd $(tree-share-prefix)/fonts/otf && \
                ln -s ../../../../../../mf/$(outconfbase)/*.otf .
+       -cd $(tree-share-prefix)/fonts/ && \
+               ln -s ../../../../../mf/$(outconfbase)/fonts.conf .
        -cd $(tree-share-prefix)/fonts/svg && \
                ln -s ../../../../../../mf/$(outconfbase)/*.svg .
        -cd $(tree-share-prefix)/fonts/tfm && \
index f9d9ffe3a5afcb1380deff647cc13bd31ad4874d..83f40500c575429494e1735a532ae56c0cd4e35b 100644 (file)
 #(display "Invoking inkscape...\n")
 
 %% LD_LIBRARY_PATH is necesssary, otherwise, it doesn't build in GUB.  
-#(system (format #f "LD_LIBRARY_PATH= inkscape -T -E ~a-1.eps ~a-1.svg" outname outname))
+#(ly:system (format #f "inkscape -T -E ~a-inkscape.eps ~a-1.svg" outname outname)
+  (cons
+   (format #f "FONTCONFIG_FILE=~a/fonts/fonts.conf" (ly:effective-prefix))
+   (ly:start-environment)))
+
 #(set! output-count 0)
 #(set-default-paper-size "a5")
 
@@ -28,9 +32,9 @@
   \score {
     \lyrics {
       \markup {
-       \epsfile #X #30.0 #(format #f "~a-1.eps" outname)
+       \epsfile #X #30.0 #(format #f "~a-inkscape.eps" outname)
       }
-      x x x
+      bla bla bla
     }
   }
 }
index 1492d1790b11ed6b2cf09be839b0d050c5db2e50..170bbb13eb14a081b751333dbe88ba28af75acdd 100644 (file)
@@ -121,7 +121,7 @@ export MFINPUTS:=.:$(MFINPUTS)
 
 
 
-default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen
+default: $(ALL_GEN_FILES) $(outdir)/emmentaler-20.otf tree-regen $(outdir)/fonts.conf
 
 .PHONY: tree-regen
 
@@ -138,11 +138,17 @@ local-clean:
        rm -f mfplain.mem mfplain.log
        rm -f *.tfm *.log
 
+
+## fixme: why is this necessary?
 $(outdir)/%.enc.in: %.enc
        cp $< $@
 
 
+$(outdir)/fonts.conf:
+       echo '<fontconfig><dir>'$(shell cd $(outdir); pwd)'</dir></fontconfig>' > $@
+
 $(NCSB_OTFS): $(NCSB_SOURCE_FILES)  $(buildscript-dir)/pfx2ttf.fontforge
        $(foreach i, $(basename $(NCSB_SOURCE_FILES)), \
                $(FONTFORGE) -script $(buildscript-dir)/pfx2ttf.fontforge \
                        $(i).pfb $(i).afm $(outdir)/ && ) true
+
index eaefaf786752821a525cdfa406a353cbac0e18c9..c09e7572d5d3d0a77f687ca37c71e2c6e6c0bd3a 100644 (file)
@@ -8,7 +8,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
 ;; backend helpers.
 
-(define-public (ly:system command)
+(define-public (ly:system command . rest)
   (let* ((status 0)
         (dev-null "/dev/null")
         (silenced (if (or (ly:get-option 'verbose)
                       (format #f "~a > ~a 2>&1 " command dev-null))))
     (if (ly:get-option 'verbose)
        (ly:message (_ "Invoking `~a'...") command))
-    
-    (set! status (system silenced))
+
+    (set! status
+         (if (pair? rest)
+             (system-with-env silenced (car rest))
+             (system silenced)))
+       
     (if (> status 0)
        (begin
          (ly:message (_ "`~a' failed (~a)") command status)
          ;; hmmm.  what's the best failure option? 
          (throw 'ly-file-failed)))))
 
+(define-public (system-with-env cmd env)
+
+  "Execute CMD in fork, with ENV (a list of strings) as the environment"
+  (let*
+      ;; laziness: should use execle?
+      
+      ((pid (primitive-fork)))
+    (if (= 0 pid)
+       ;; child
+       (begin
+         (environ env)
+         (system cmd))
+       
+       ;; parent
+       (cdr (waitpid pid)))))
+
 (define-public (sanitize-command-option str)
   "Kill dubious shell quoting"