]> gitweb.factorcode.org Git - factor.git/commitdiff
Don't copy freetype over if UI is not deployed
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 2 Oct 2008 15:53:30 +0000 (10:53 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 2 Oct 2008 15:53:30 +0000 (10:53 -0500)
basis/tools/deploy/backend/backend.factor
basis/tools/deploy/macosx/macosx.factor
basis/tools/deploy/windows/windows.factor

index cb899f4b872fd2256b95d5cafab2b6ff5037c715..a0565c6babca02ef2a4e52f434e8bdab8b8356b2 100644 (file)
@@ -10,13 +10,15 @@ io.encodings.utf8 destructors accessors ;
 IN: tools.deploy.backend
 
 : copy-vm ( executable bundle-name extension -- vm )
-  [ prepend-path ] dip append vm over copy-file ;
+    [ prepend-path ] dip append vm over copy-file ;
 
 : copy-fonts ( name dir -- )
-  append-path "resource:fonts/" swap copy-tree-into ;
+    deploy-ui? get [
+        append-path "resource:fonts/" swap copy-tree-into
+    ] [ 2drop ] if ;
 
 : image-name ( vocab bundle-name -- str )
-  prepend-path ".image" append ;
+    prepend-path ".image" append ;
 
 : copy-lines ( -- )
     readln [ print flush copy-lines ] when* ;
index ee60ce3982a61fbbb799423aaf7f69685d670f79..d3464993e162309dbb3626bca47461ae20c49758 100644 (file)
@@ -4,7 +4,7 @@ USING: io io.files kernel namespaces make sequences
 system tools.deploy.backend tools.deploy.config assocs
 hashtables prettyprint io.unix.backend cocoa io.encodings.utf8
 io.backend cocoa.application cocoa.classes cocoa.plists
-qualified ;
+qualified combinators ;
 IN: tools.deploy.macosx
 
 : bundle-dir ( -- dir )
@@ -30,12 +30,26 @@ IN: tools.deploy.macosx
     "Contents/Info.plist" append-path
     write-plist ;
 
+: copy-dll ( bundle-name -- )
+    "Frameworks/libfactor.dylib" copy-bundle-dir ;
+
+: copy-freetype ( bundle-name -- )
+    deploy-ui? get [ "Frameworks" copy-bundle-dir ] [ drop ] if ;
+
+: copy-nib ( bundle-name -- )
+    deploy-ui? get [
+        "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir
+    ] [ drop ] if ;
+
 : create-app-dir ( vocab bundle-name -- vm )
     [
-        nip
-        [ "Frameworks" copy-bundle-dir ]
-        [ "Resources/English.lproj/MiniFactor.nib" copy-bundle-dir ]
-        [ "Contents/Resources/" copy-fonts ] tri
+        nip {
+            [ copy-dll ]
+            [ copy-freetype ]
+            [ copy-nib ]
+            [ "Contents/Resources/" copy-fonts ]
+            [ "Contents/Resources" append-path make-directories ]
+        } cleave
     ]
     [ create-app-plist ]
     [ "Contents/MacOS/" append-path "" copy-vm ] 2tri ;
index e0ce2c268a674ccc40acbede87533ac1f9693ce0..ce4fee19d77491994651a8218f91ff93f35a09e6 100644 (file)
@@ -5,16 +5,23 @@ tools.deploy.backend tools.deploy.config assocs hashtables
 prettyprint combinators windows.shell32 windows.user32 ;
 IN: tools.deploy.windows
 
-: copy-dlls ( bundle-name -- )
-    {
-        "resource:freetype6.dll"
-        "resource:zlib1.dll"
-        "resource:factor.dll"
-    } swap copy-files-into ;
+: copy-dll ( bundle-name -- )
+    "resource:factor.dll" swap copy-file-into ;
+
+: copy-freetype ( bundle-name -- )
+    deploy-ui? get [
+        {
+            "resource:freetype6.dll"
+            "resource:zlib1.dll"
+        } swap copy-files-into
+    ] when ;
 
 : create-exe-dir ( vocab bundle-name -- vm )
-    dup copy-dlls
-    dup "" copy-fonts
+    deploy-ui? get [
+        dup copy-dll
+        dup copy-freetype
+        dup "" copy-fonts
+    ] when
     ".exe" copy-vm ;
 
 M: winnt deploy*