forked from smooth80/defold
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpackage_cctools.sh
executable file
·84 lines (54 loc) · 1.73 KB
/
package_cctools.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#! /usr/bin/env bash
set -e
PWD=`pwd`
VERSION_TAPI=1.6
VERSION_TAPI_SHA1=a66284251b46d591ee4a0cb4cf561b92a0c138d8
VERSION_CCTOOLS_SHA1=6c438753d2252274678d3e0839270045698c159b
TARGET_PATH=${PWD}/local_sdks
TMP=${TARGET_PATH}/_tmpdir
TAPITMP=${TMP}/tapi${VERSION_TAPI}
DARWIN_VERSION=darwin19
TARGET_CCTOOLS=$TARGET_PATH/cctools-port-${DARWIN_VERSION}-${VERSION_CCTOOLS_SHA1}-linux.tar.gz
# check for cmake
if [ "$(which cmake)" == "" ]; then
echo "You must have cmake installed"
exit 1
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
pushd $TMP
if [ ! -e ${TARGET_CCTOOLS} ]; then
# # ******************************************************
echo Compiling apple-libtapi
mkdir -p $TAPITMP
git clone https://github.com/tpoechtrager/apple-libtapi.git
pushd apple-libtapi
git checkout ${VERSION_TAPI_SHA1}
INSTALLPREFIX=$TAPITMP ./build.sh
./install.sh
popd
# ******************************************************
echo Creating ${TARGET_CCTOOLS}
CCTOOLSTMP=${TMP}/cctools-port
mkdir -p $CCTOOLSTMP
git clone https://github.com/tpoechtrager/cctools-port.git
cp -v -r $TAPITMP ${CCTOOLSTMP}
TAPITMP=${CCTOOLSTMP}/tapi${VERSION_TAPI}
pushd cctools-port/cctools
git checkout ${VERSION_CCTOOLS_SHA1}
TMPDIR=$TMP ./configure --prefix=${CCTOOLSTMP} --target=arm-apple-${DARWIN_VERSION} --with-libtapi=$TAPITMP
make -j8
make install
make distclean
TMPDIR=$TMP ./configure --prefix=${CCTOOLSTMP} --target=x86_64-apple-${DARWIN_VERSION} --with-libtapi=$TAPITMP
make -j8
make install
make distclean
popd
tar -czvf ${TARGET_CCTOOLS} -C $TMP cctools-port
echo Wrote ${TARGET_CCTOOLS}
else
echo Found ${TARGET_CCTOOLS}
fi
#rm -rf ${TMP}