Remove duplicate uriParts.size() > 0 check
[bitcoinplatinum.git] / contrib / gitian-descriptors / gitian-osx.yml
blobcbf286d2cde28ffaedb545bf7f1e82c339578b1c
1 ---
2 name: "bitcoin-osx-0.16"
3 enable_cache: true
4 suites:
5 - "trusty"
6 architectures:
7 - "amd64"
8 packages:
9 - "ca-certificates"
10 - "curl"
11 - "g++"
12 - "git-core"
13 - "pkg-config"
14 - "autoconf"
15 - "librsvg2-bin"
16 - "libtiff-tools"
17 - "libtool"
18 - "automake"
19 - "faketime"
20 - "bsdmainutils"
21 - "cmake"
22 - "imagemagick"
23 - "libcap-dev"
24 - "libz-dev"
25 - "libbz2-dev"
26 - "python"
27 - "python-dev"
28 - "python-setuptools"
29 - "fonts-tuffy"
30 remotes:
31 - "url": "https://github.com/bitcoin/bitcoin.git"
32   "dir": "bitcoin"
33 files:
34 - "MacOSX10.11.sdk.tar.gz"
35 script: |
36   WRAP_DIR=$HOME/wrapped
37   HOSTS="x86_64-apple-darwin11"
38   CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
39   FAKETIME_HOST_PROGS=""
40   FAKETIME_PROGS="ar ranlib date dmg genisoimage"
42   export QT_RCC_TEST=1
43   export GZIP="-9n"
44   export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
45   export TZ="UTC"
46   export BUILD_DIR=`pwd`
47   mkdir -p ${WRAP_DIR}
48   if test -n "$GBUILD_CACHE_ENABLED"; then
49     export SOURCES_PATH=${GBUILD_COMMON_CACHE}
50     export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
51     mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
52   fi
54   export ZERO_AR_DATE=1
56   function create_global_faketime_wrappers {
57   for prog in ${FAKETIME_PROGS}; do
58     echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
59     echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
60     echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
61     echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
62     echo "\$REAL \$@" >> $WRAP_DIR/${prog}
63     chmod +x ${WRAP_DIR}/${prog}
64   done
65   }
67   function create_per-host_faketime_wrappers {
68   for i in $HOSTS; do
69     for prog in ${FAKETIME_HOST_PROGS}; do
70         echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
71         echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
72         echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
73         echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
74         echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
75         chmod +x ${WRAP_DIR}/${i}-${prog}
76     done
77   done
78   }
80   # Faketime for depends so intermediate results are comparable
81   export PATH_orig=${PATH}
82   create_global_faketime_wrappers "2000-01-01 12:00:00"
83   create_per-host_faketime_wrappers "2000-01-01 12:00:00"
84   export PATH=${WRAP_DIR}:${PATH}
86   cd bitcoin
87   BASEPREFIX=`pwd`/depends
89   mkdir -p ${BASEPREFIX}/SDKs
90   tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
92   # Build dependencies for each host
93   for i in $HOSTS; do
94     make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
95   done
97   # Faketime for binaries
98   export PATH=${PATH_orig}
99   create_global_faketime_wrappers "${REFERENCE_DATETIME}"
100   create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
101   export PATH=${WRAP_DIR}:${PATH}
103   # Create the release tarball using (arbitrarily) the first host
104   ./autogen.sh
105   CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
106   make dist
107   SOURCEDIST=`echo bitcoin-*.tar.gz`
108   DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
110   # Correct tar file order
111   mkdir -p temp
112   pushd temp
113   tar xf ../$SOURCEDIST
114   find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
115   popd
117   # Workaround for tarball not building with the bare tag version (prep)
118   make -C src obj/build.h
120   ORIGPATH="$PATH"
121   # Extract the release tarball into a dir for each host and build
122   for i in ${HOSTS}; do
123     export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
124     mkdir -p distsrc-${i}
125     cd distsrc-${i}
126     INSTALLPATH=`pwd`/installed/${DISTNAME}
127     mkdir -p ${INSTALLPATH}
128     tar --strip-components=1 -xf ../$SOURCEDIST
130     # Workaround for tarball not building with the bare tag version
131     echo '#!/bin/true' >share/genbuild.sh
132     mkdir src/obj
133     cp ../src/obj/build.h src/obj/
135     CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
136     make ${MAKEOPTS}
137     make install-strip DESTDIR=${INSTALLPATH}
139     make osx_volname
140     make deploydir
141     OSX_VOLNAME="$(cat osx_volname)"
142     mkdir -p unsigned-app-${i}
143     cp osx_volname unsigned-app-${i}/
144     cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
145     cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
146     cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
147     cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
148     cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
149     mv dist unsigned-app-${i}
150     pushd unsigned-app-${i}
151     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
152     popd
154     make deploy
155     ${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
157     cd installed
158     find . -name "lib*.la" -delete
159     find . -name "lib*.a" -delete
160     rm -rf ${DISTNAME}/lib/pkgconfig
161     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
162     cd ../../
163   done
164   mkdir -p $OUTDIR/src
165   mv $SOURCEDIST $OUTDIR/src
166   mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz