Debian Codegraph @

scripts/build_apple_frameworks

raw symbols SCIP
1 #! /bin/shscip-shell filesystem . . `/bin/sh`.
2
3 # cd to aubio directory for consistency
4 cd `dirnamescip-shell system . . dirname. $0`/..
5
6 AUBIO_TMPDIR=`mktempscip-shell system . . mktemp. -d /var/tmp/aubio-build-XXXXscip-shell filesystem . . `/var/tmp/aubio-build-XXXX`.`
7 PACKAGE=aubio
8 source VERSIONscip-shell source . . VERSION.
9 VERSION=$AUBIO_MAJOR_VERSION.$AUBIO_MINOR_VERSION.$AUBIO_PATCH_VERSION$AUBIO_VERSION_STATUS
10 LIBVERSION=$LIBAUBIO_LT_CUR.$LIBAUBIO_LT_REV.$LIBAUBIO_LT_AGE
11 OUTPUTDIR=$PWD/dist
12 mkdirscip-shell system . . mkdir. -p "$OUTPUTDIR"
13 # add git abbreviated commit hash
14 #VERSION+=+$(git log --pretty=format:"%h" -1)
15
16 CFLAGS="-Werror -Os"
17 WAFCONF="--disable-sndfile --disable-avcodec --disable-samplerate --enable-fat" # --disable-memcpy --disable-accelerate"
18
19 export VERSION
20
21 function cleanupscip-shell shell shell-project 0.0.0 cleanup(). () {
22 rmscip-shell system . . rm. -rf $AUBIO_TMPDIR
23 }
24
25 trap cleanup SIGINT SIGTERM
26
27 function create_tarballsscip-shell shell shell-project 0.0.0 create_tarballs().() {
28 # name version platform
29 # create tarball
30 tarfile=$OUTPUTDIR/$1-$2.$3_binary.tar.bz2
31 tarscip-shell system . . tar. -C $AUBIO_TMPDIR/dist-$3/ -jcf "$tarfile" .
32 #rm -rf $AUBIO_TMPDIR/dist-$3
33 }
34
35 function create_frameworkscip-shell shell shell-project 0.0.0 create_framework().() {
36 rmscip-shell system . . rm. -rf $AUBIO_TMPDIR/framework-$3
37 mkdirscip-shell system . . mkdir. -p $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework/$1.framework
38 cpscip-shell system . . cp. -pr COPYING README.md $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework
39 pushd $AUBIO_TMPDIR/framework-$3
40 cpscip-shell system . . cp. -pr "$OLDPWD/build/src/lib$1.a" $1-$2.$3_framework/$1.framework/$1 || \
41 cp -pr $AUBIO_TMPDIR/dist-$3/usr/local/lib/lib$1.$LIBVERSION.dylib \
42 $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework/$1.framework/$1
43 cpscip-shell system . . cp. -pr $AUBIO_TMPDIR/dist-$3/usr/local/include/$1 $1-$2.$3_framework/$1.framework/Headers
44 cpscip-shell system . . cp. -pr "$OLDPWD/scripts/apple/Modules" $1-$2.$3_framework/$1.framework/
45 popd
46 }
47
48 function create_framework_fatscip-shell shell shell-project 0.0.0 create_framework_fat().() {
49 rmscip-shell system . . rm. -rf $AUBIO_TMPDIR/framework-$3
50 mkdirscip-shell system . . mkdir. -p $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework/$1.framework
51 cpscip-shell system . . cp. -pr COPYING README.md $AUBIO_TMPDIR/framework-$3/$1-$2.$3_framework
52 pushd $AUBIO_TMPDIR/framework-$3
53 cpscip-shell system . . cp. -pr $AUBIO_TMPDIR/framework-ios/$1-$2.ios_framework/$1.framework/Headers $1-$2.$3_framework/$1.framework
54 cpscip-shell system . . cp. -pr $AUBIO_TMPDIR/framework-ios/$1-$2.ios_framework/$1.framework/Modules $1-$2.$3_framework/$1.framework
55 lipo $AUBIO_TMPDIR/framework-ios/$1-$2.ios_framework/$1.framework/$1 \
56 $AUBIO_TMPDIR/framework-iosimulator/$1-$2.iosimulator_framework/$1.framework/$1 \
57 -output $1-$2.$3_framework/$1.framework/$1 -create
58 popd
59 }
60
61 function create_framework_zipscip-shell shell shell-project 0.0.0 create_framework_zip().() {
62 # create zip
63 pushd $AUBIO_TMPDIR/framework-$3
64 zipfile=$1-$2.$3_framework.zip
65 zip -qr $zipfile $1-$2.$3_framework
66 popd
67 mvscip-shell system . . mv. $AUBIO_TMPDIR/framework-$3/$zipfile "$OUTPUTDIR"
68 }
69
70 set -x
71 set -e
72
73 #./waf dist --verbose
74
75 for PLATFORM in darwin ios iosimulator
76 do
77 rmscip-shell system . . rm. -rf $AUBIO_TMPDIR/dist-$PLATFORM
78 WAF_OPTIONS="--verbose --destdir $AUBIO_TMPDIR/dist-$PLATFORM --with-target-platform $PLATFORM $WAFCONF"
79 for target in distclean configure build install
80 do
81 CFLAGS="$CFLAGS" ./waf $target $WAF_OPTIONS
82 done
83
84 create_frameworkscip-shell shell shell-project 0.0.0 create_framework(). $PACKAGE $VERSION $PLATFORM
85 if [scip-shell system . . `[`. $PLATFORM == 'darwin' ]
86 then
87 # on darwin, build a .tar.bz2 of /usr and a .zip of aubio.framework
88 create_tarballsscip-shell shell shell-project 0.0.0 create_tarballs(). $PACKAGE $VERSION $PLATFORM
89 create_framework_zipscip-shell shell shell-project 0.0.0 create_framework_zip(). $PACKAGE $VERSION $PLATFORM
90 fi
91 ./waf uninstall $WAF_OPTIONS
92
93 done
94
95 # after both ios and iosimulator have been built
96 PLATFORM=iosuniversal
97 create_framework_fatscip-shell shell shell-project 0.0.0 create_framework_fat(). $PACKAGE $VERSION $PLATFORM
98 create_framework_zipscip-shell shell shell-project 0.0.0 create_framework_zip(). $PACKAGE $VERSION $PLATFORM
99
100 ./waf clean
101 ./waf distclean
102
103 cleanupscip-shell shell shell-project 0.0.0 cleanup().