3 basename=`basename $PWD`
4 if [ $basename != "package" ]; then
5 echo "This script must be ran from within the Packager directory."
9 version
=`date "+%Y-%m-%d"`
10 include_optionals
=false
11 if [ `uname` = 'Darwin' ]; then
17 while getopts ":v:os" Option
22 o
) include_optionals
=true
24 s
) package_type
="source"
28 shift $
(($OPTIND - 1))
30 revision
=`git rev-list HEAD -1 | sed -E 's/([[:alnum:]]{1,10}).*/\1/'`
31 if [ "`git status -s -uno`" != "" ]; then
32 echo "WARNING: The working copy has uncommitted changes which will NOT be included in the package."
35 if [ $package_type == "source" ]; then
36 if [ -d SuperCollider-Source
]; then
37 echo "Please remove the ./SuperCollider-Source directory before running this script."
42 bash package
/git-archive-all.sh
--prefix SuperCollider-Source
/ "$returndir/SuperCollider-Source.tmp.tar"
44 # NB we only need one instance of boost, so we exclude one of its two appearances as a submodule in the following
45 tar -x --exclude ".gitignore" --exclude ".gitmodules" \
46 --exclude "SuperCollider-Source/external_libraries/nova-tt/boost_lockfree" \
47 -f SuperCollider-Source.tmp.
tar
49 if $include_optionals; then
50 cp -Rp optional SuperCollider-Source
/optional_installs
51 cp OPTIONALS_README_SOURCE.txt SuperCollider-Source
/optional_installs
/README.txt
52 filename
="SuperCollider-$version-Source-With-Extras.tar.bz2"
53 filenamelinux
="SuperCollider-$version-Source-With-Extras-linux.tar.bz2"
55 filename
="SuperCollider-$version-Source.tar.bz2"
56 filenamelinux
="SuperCollider-$version-Source-linux.tar.bz2"
59 # Here we build a list of (many) files that are useless on linux, so as to build a slimline source.tar.bz2
60 find SuperCollider-Source
-iname windows
-or -iname osx
-or -name "*.xcodeproj" -or -name scide_scapp
-or -iname "iPhone*" \
61 |
grep -v "external_libraries/boost/boost/asio/windows" > LinuxExclusions.txt
62 echo 'SuperCollider-Source/SuperColliderAU
63 SuperCollider-Source/editors/Psycollider
64 SuperCollider-Source/platform/README OS X
65 SuperCollider-Source/platform/README WINDOWS
66 SuperCollider-Source/platform/README IPHONE
67 SuperCollider-Source/external_libraries/libsndfile
68 SuperCollider-Source/external_libraries/curl
69 SuperCollider-Source/external_libraries/icu
70 SuperCollider-Source/platform/mac
71 SuperCollider-Source/platform/iphone
72 SuperCollider-Source/lang/LangPrimSource/HID_Utilities
73 SuperCollider-Source/lang/LangPrimSource/HID_Utilities_10_4
74 SuperCollider-Source/lang/LangPrimSource/WiiMote_OSX
75 SuperCollider-Source/editors/scapp' >> LinuxExclusions.txt
77 tar cfj
"$filename" SuperCollider-Source
78 tar cfjX
"$filenamelinux" LinuxExclusions.txt SuperCollider-Source
79 rm -rf SuperCollider-Source SuperCollider-Source.tmp.
tar
82 if [ -d SuperCollider
]; then
83 echo "Please remove the ./SuperCollider directory before running this script."
86 if $include_optionals; then
87 opt_options
='--copy dmg_with_optionals.ds_store:/.DS_Store --copy optional/:/Optional\ Installs --copy OPTIONALS_README_OSX.rtf:/Optional\ Installs/README.rtf'
88 filename
="SuperCollider-$version-With-Extras.dmg"
90 opt_options
='--copy dmg_without_optionals.ds_store:/.DS_Store'
91 filename
="SuperCollider-$version.dmg"
94 about_version
="$version (Revision $revision)"
95 echo "About box version string:" $about_version
97 mkdir
-p SuperCollider
/plugins
99 cd ..
/platform
/mac
/build
100 git archive
$revision |
tar -x -C "$returndir/SuperCollider"
101 cp -R SuperCollider.app scsynth sclang
"$returndir/SuperCollider/"
102 cp plugins
/* "$returndir/SuperCollider/plugins/"
105 cp -R ChangeLog COPYING examples Help SCClassLibrary README sounds
"$returndir/SuperCollider/"
107 find SuperCollider
/Help
/ \
( -name "*.htm" -or -name "*.html" \
) -exec /Developer
/Tools
/SetFile
-c SCjm
{} \
;
108 defaults
write $PWD/SuperCollider
/SuperCollider.app
/Contents
/Info CFBundleVersion
-string "$about_version"
109 defaults
write $PWD/SuperCollider
/SuperCollider.app
/Contents
/Info CFBundleGetInfoString
-string "$version"
110 plutil
-convert xml1
$PWD/SuperCollider
/SuperCollider.app
/Contents
/Info.plist
112 # use eval to force any escapes or quotes in $opt_options to be evaluated
113 eval './pkg-dmg --verbosity 0 --source ./SuperCollider --target "$filename" --sourcefile --volname SuperCollider --mkdir /.background --copy background.png:/.background/background.png --symlink /Applications:/Applications '$opt_options
115 rm -rf .
/SuperCollider