net: Disable upnp by default
[bitcoinplatinum.git] / contrib / gitian-descriptors / gitian-osx.yml
blobeeeb408ded0f9799a10c2f3ffc2f844d9d99c28d
1 ---
2 name: "bitcoin-osx-0.12"
3 enable_cache: true
4 suites:
5 - "precise"
6 architectures:
7 - "amd64"
8 packages: 
9 - "g++"
10 - "git-core"
11 - "pkg-config"
12 - "autoconf2.13"
13 - "libtool"
14 - "automake"
15 - "faketime"
16 - "bsdmainutils"
17 - "cmake"
18 - "libcap-dev"
19 - "libz-dev"
20 - "libbz2-dev"
21 reference_datetime: "2015-06-01 00:00:00"
22 remotes:
23 - "url": "https://github.com/bitcoin/bitcoin.git"
24   "dir": "bitcoin"
25 files:
26 - "MacOSX10.9.sdk.tar.gz"
27 script: |
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"
34   export QT_RCC_TEST=1
35   export GZIP="-9n"
36   export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
37   export TZ="UTC"
38   export BUILD_DIR=`pwd`
39   mkdir -p ${WRAP_DIR}
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}
44   fi
46   export ZERO_AR_DATE=1
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}
56   done
58   # Create per-host faketime wrappers
59   for i in $HOSTS; do
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}
67     done
68   done
69   export PATH=${WRAP_DIR}:${PATH}
71   cd bitcoin
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
78   for i in $HOSTS; do
79     make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
80   done
82   # Create the release tarball using (arbitrarily) the first host
83   ./autogen.sh
84   ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
85   make dist
86   SOURCEDIST=`echo bitcoin-*.tar.gz`
87   DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
89   # Correct tar file order
90   mkdir -p temp
91   pushd temp
92   tar xf ../$SOURCEDIST
93   find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
94   popd
96   ORIGPATH="$PATH"
97   # Extract the release tarball into a dir for each host and build
98   for i in ${HOSTS}; do
99     export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
100     mkdir -p distsrc-${i}
101     cd 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}
107     make ${MAKEOPTS}
108     make install-strip
110     make deploydir
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
120     popd
122     make deploy
123     ${WRAP_DIR}/dmg dmg Bitcoin-Core.dmg ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
125     cd installed
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
130     cd ../../
131   done
132   mkdir -p $OUTDIR/src
133   mv $SOURCEDIST $OUTDIR/src
134   mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz