[trivial] Fix typo ("improssible" → "impossible")
[bitcoinplatinum.git] / contrib / gitian-descriptors / gitian-osx.yml
blob05cc65414fc537678b9b9c511781c326746427b9
1 ---
2 name: "bitcoin-osx-0.15"
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   ORIGPATH="$PATH"
118   # Extract the release tarball into a dir for each host and build
119   for i in ${HOSTS}; do
120     export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
121     mkdir -p distsrc-${i}
122     cd distsrc-${i}
123     INSTALLPATH=`pwd`/installed/${DISTNAME}
124     mkdir -p ${INSTALLPATH}
125     tar --strip-components=1 -xf ../$SOURCEDIST
127     CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
128     make ${MAKEOPTS}
129     make install-strip DESTDIR=${INSTALLPATH}
131     make osx_volname
132     make deploydir
133     OSX_VOLNAME="$(cat osx_volname)"
134     mkdir -p unsigned-app-${i}
135     cp osx_volname unsigned-app-${i}/
136     cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
137     cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
138     cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
139     cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
140     cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
141     mv dist unsigned-app-${i}
142     pushd unsigned-app-${i}
143     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
144     popd
146     make deploy
147     ${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
149     cd installed
150     find . -name "lib*.la" -delete
151     find . -name "lib*.a" -delete
152     rm -rf ${DISTNAME}/lib/pkgconfig
153     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
154     cd ../../
155   done
156   mkdir -p $OUTDIR/src
157   mv $SOURCEDIST $OUTDIR/src
158   mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz