]> gitweb.factorcode.org Git - factor.git/blob - basis/tools/deploy/unix/unix.factor
Merge branch 'gtk' into gtk-image-loader
[factor.git] / basis / tools / deploy / unix / unix.factor
1 ! Copyright (C) 2008 James Cash
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: io io.backend io.directories io.files io.files.info.unix
4 io.pathnames kernel namespaces sequences system
5 tools.deploy.backend tools.deploy.config
6 tools.deploy.config.editor vocabs.loader vocabs.metadata ;
7 IN: tools.deploy.unix
8
9 : used-icon ( vocab -- ico )
10     dup vocab-dir "icon.png" append-path vocab-append-path
11     [ exists? ] keep "vocab:ui/backend/gtk/icon.png" ? ;
12
13 : copy-icon ( vocab bundle-name -- )
14     [ used-icon ]
15     [ "ui/backend/gtk/icon.png" append-path ] bi*
16     copy-file ;
17
18 : create-app-dir ( vocab bundle-name -- vm )
19     [ copy-vm ] [ copy-icon ] 2bi
20     dup OCT: 755 set-file-permissions ;
21
22 : bundle-name ( -- str )
23     deploy-name get ;
24
25 M: unix deploy* ( vocab -- )
26     "resource:" [
27         dup deploy-config [
28             [ bundle-name create-app-dir ] keep
29             [ bundle-name image-name ] keep
30             namespace make-deploy-image
31             bundle-name "" [ copy-resources ] [ copy-libraries ] 3bi
32             bundle-name normalize-path "Binary deployed to " "." surround print
33         ] bind
34     ] with-directory ;