fix linking error in recent commit
[supercollider.git] / mac / Packager / package
blob21afc9e8a2a33e2ed2b0cb854ba35b82b58ee9d2
1 #!/bin/bash
3 basename=`basename $PWD`
4 if [ $basename != "Packager" ]; then
5 echo "This script must be ran from within the Packager directory."
6 exit 1
7 fi
9 if [ -d SuperCollider ]; then
10 echo "Please remove the ./SuperCollider directory before running this script."
11 exit 1
14 version=`date "+%Y-%m-%d"`
15 include_optionals=false
16 if [ `uname` = 'Darwin' ]; then
17 package_type="osx"
18 else
19 package_type="source"
22 while getopts ":v:os" Option
24 case $Option in
25 v ) version=$OPTARG
27 o ) include_optionals=true
29 s ) package_type="source"
31 esac
32 done
33 shift $(($OPTIND - 1))
35 revision=`svnversion -n ../../`
36 if ( echo $revision | grep "M" > /dev/null 2>&1 ); then
37 echo "WARNING: The working copy has uncommitted changes which will be included in the package."
40 if ( echo $revision | grep ":" > /dev/null 2>&1 ); then
41 echo "WARNING: The working copy has mixed revision numbers (some folders had 'svn update' ran more recently than others)."
43 revision=`echo $revision | sed -e 's/^[^:]*://;s/[A-Za-z]//'`
45 if [ $package_type == "source" ]; then
46 mkdir SuperCollider-Source
47 svn export -q --force ../../ SuperCollider-Source
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.gz"
53 filenamelinux="SuperCollider-$version-Source-With-Extras-linux.tar.gz"
54 else
55 filename="SuperCollider-$version-Source.tar.gz"
56 filenamelinux="SuperCollider-$version-Source-linux.tar.gz"
59 # Here we build a list of (many) files that are useless on linux, so as to build a slimline source.tar.gz
60 find SuperCollider-Source -iname windows -or -iname osx -or -name "*.xcodeproj" -or -name scide_scapp -or -name "iPhone*" > LinuxExclusions.txt
61 echo 'SuperCollider-Source/SuperColliderAU
62 SuperCollider-Source/Psycollider
63 SuperCollider-Source/README OS X
64 SuperCollider-Source/README WINDOWS
65 SuperCollider-Source/README IPHONE
66 SuperCollider-Source/common/include/libsndfile
67 SuperCollider-Source/common/include/curl
68 SuperCollider-Source/common/include/icu
69 SuperCollider-Source/mac
70 SuperCollider-Source/Headers/app
71 SuperCollider-Source/Source/app' >> LinuxExclusions.txt
73 tar cfz "$filename" SuperCollider-Source
74 tar cfzX "$filenamelinux" LinuxExclusions.txt SuperCollider-Source
75 rm -rf SuperCollider-Source
76 exit
77 else
78 if $include_optionals; then
79 opt_options='--copy dmg_with_optionals.ds_store:/.DS_Store --copy optional/:/Optional\ Installs --copy OPTIONALS_README_OSX.rtf:/Optional\ Installs/README.rtf'
80 filename="SuperCollider-$version-With-Extras.dmg"
81 else
82 opt_options='--copy dmg_without_optionals.ds_store:/.DS_Store'
83 filename="SuperCollider-$version.dmg"
86 about_version="$version (Revision $revision)"
87 echo "About box version string:" $about_version
89 svn export -q --force ../../common/build SuperCollider
90 cp -R ../../common/build/SuperCollider.app ../../common/build/scsynth ../../common/build/sclang SuperCollider
91 cp ../../common/build/plugins/* SuperCollider/plugins/
92 cp ../../COPYING SuperCollider/COPYING
93 find SuperCollider/help/ \( -name "*.htm" -or -name "*.html" \) -exec /Developer/Tools/SetFile -c SCjm {} \;
94 defaults write $PWD/SuperCollider/SuperCollider.app/Contents/Info CFBundleVersion -string "$about_version"
95 defaults write $PWD/SuperCollider/SuperCollider.app/Contents/Info CFBundleGetInfoString -string "$version"
96 plutil -convert xml1 $PWD/SuperCollider/SuperCollider.app/Contents/Info.plist
98 # use eval to force any escapes or quotes in $opt_options to be evaluated
99 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
101 rm -rf ./SuperCollider