2 name: "bitcoin-osx-0.12"
21 reference_datetime: "2015-06-01 00:00:00"
23 - "url": "https://github.com/bitcoin/bitcoin.git"
26 - "MacOSX10.9.sdk.tar.gz"
28 WRAP_DIR=$HOME/wrapped
29 HOSTS="x86_64-apple-darwin11"
30 CONFIGFLAGS="--enable-reduce-exports GENISOIMAGE=$WRAP_DIR/genisoimage"
31 FAKETIME_HOST_PROGS=""
32 FAKETIME_PROGS="ar ranlib date dmg genisoimage"
36 export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
38 export BUILD_DIR=`pwd`
40 if test -n "$GBUILD_CACHE_ENABLED"; then
41 export SOURCES_PATH=${GBUILD_COMMON_CACHE}
42 export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
43 mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
48 # Create global faketime wrappers
49 for prog in ${FAKETIME_PROGS}; do
50 echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
51 echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
52 echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
53 echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
54 echo "\$REAL \$@" >> $WRAP_DIR/${prog}
55 chmod +x ${WRAP_DIR}/${prog}
58 # Create per-host faketime wrappers
60 for prog in ${FAKETIME_HOST_PROGS}; do
61 echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
62 echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
63 echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
64 echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog}
65 echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
66 chmod +x ${WRAP_DIR}/${i}-${prog}
69 export PATH=${WRAP_DIR}:${PATH}
72 BASEPREFIX=`pwd`/depends
74 mkdir -p ${BASEPREFIX}/SDKs
75 tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.9.sdk.tar.gz
77 # Build dependencies for each host
79 make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
82 # Create the release tarball using (arbitrarily) the first host
84 ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
86 SOURCEDIST=`echo bitcoin-*.tar.gz`
87 DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
89 # Correct tar file order
93 find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
97 # Extract the release tarball into a dir for each host and build
99 export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
100 mkdir -p distsrc-${i}
102 INSTALLPATH=`pwd`/installed/${DISTNAME}
103 mkdir -p ${INSTALLPATH}
104 tar --strip-components=1 -xf ../$SOURCEDIST
106 ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
111 mkdir -p unsigned-app-${i}
112 cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
113 cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
114 cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
115 cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
116 cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
117 mv dist unsigned-app-${i}
118 pushd unsigned-app-${i}
119 find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz
123 ${WRAP_DIR}/dmg dmg Bitcoin-Core.dmg ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
126 find . -name "lib*.la" -delete
127 find . -name "lib*.a" -delete
128 rm -rf ${DISTNAME}/lib/pkgconfig
129 find ${DISTNAME} | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
133 mv $SOURCEDIST $OUTDIR/src
134 mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz