-
Notifications
You must be signed in to change notification settings - Fork 14
/
buildmac64.sh
executable file
·53 lines (43 loc) · 1.53 KB
/
buildmac64.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
version=$(grep 'ccdcielver' src/u_global.pas |head -1| cut -d\' -f2)
basedir=/Volumes/TmpInst/ccdciel # Be sure this is set to a non existent directory, it is removed after the run!
builddir=$basedir/ccdciel
if [[ -n $1 ]]; then
configopt="fpc=$1"
fi
if [[ -n $2 ]]; then
configopt=$configopt" lazarus=$2"
fi
wd=`pwd`
currentrev=$(git rev-list --count --first-parent HEAD)
# delete old files
rm ccdciel*.dmg
rm -rf $basedir
# make x86_64 Mac version
./configure $configopt prefix=$builddir target=x86_64-darwin
if [[ $? -ne 0 ]]; then exit 1;fi
make CPU_TARGET=x86_64 clean
make CPU_TARGET=x86_64
if [[ $? -ne 0 ]]; then exit 1;fi
make install
if [[ $? -ne 0 ]]; then exit 1;fi
# pkg
sed -i.bak "18s/1.0/$version/" $builddir/ccdciel.app/Contents/Info.plist
rm $builddir/ccdciel.app/Contents/Info.plist.bak
cp system_integration/MacOSX/ccdciel64.pkgproj $basedir
cp system_integration/MacOSX/readme.txt $basedir
cd $basedir
sed -i.bak "s/ccdciel_version/$version/g" ccdciel64.pkgproj
rm ccdciel64.pkgproj.bak
sed -i.bak "s/ccdciel_version/$version/" readme.txt
rm readme.txt.bak
mv ccdciel "CCDciel"
packagesbuild -v ccdciel64.pkgproj
if [[ $? -ne 0 ]]; then exit 1;fi
cp readme.txt build/
hdiutil create -anyowners -volname ccdciel-$version-$currentrev-x86_64-macosx -imagekey zlib-level=9 -format UDZO -srcfolder ./build ccdciel-$version-$currentrev-x86_64-macosx.dmg
if [[ $? -ne 0 ]]; then exit 1;fi
mv ccdciel*.dmg $wd
if [[ $? -ne 0 ]]; then exit 1;fi
cd $wd
rm -rf $basedir