2 name: "bitcoin-linux-0.12"
18 - "libstdc++6-4.6-pic"
19 reference_datetime: "2015-06-01 00:00:00"
21 - "url": "https://github.com/bitcoin/bitcoin.git"
25 WRAP_DIR=$HOME/wrapped
26 HOSTS="i686-pc-linux-gnu x86_64-unknown-linux-gnu"
27 CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++"
28 FAKETIME_HOST_PROGS=""
29 FAKETIME_PROGS="date ar ranlib nm strip"
33 export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
35 export BUILD_DIR=`pwd`
37 if test -n "$GBUILD_CACHE_ENABLED"; then
38 export SOURCES_PATH=${GBUILD_COMMON_CACHE}
39 export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
40 mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
43 # Create global faketime wrappers
44 for prog in ${FAKETIME_PROGS}; do
45 echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
46 echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
47 echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
48 echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
49 echo "\$REAL \$@" >> $WRAP_DIR/${prog}
50 chmod +x ${WRAP_DIR}/${prog}
53 # Create per-host faketime wrappers
55 for prog in ${FAKETIME_HOST_PROGS}; do
56 echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
57 echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
58 echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
59 echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog}
60 echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
61 chmod +x ${WRAP_DIR}/${i}-${prog}
64 export PATH=${WRAP_DIR}:${PATH}
67 BASEPREFIX=`pwd`/depends
68 # Build dependencies for each host
70 make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
73 # Ubuntu precise hack: Not an issue in later versions.
74 # Precise's libstdc++.a is non-pic. There's an optional libstdc++6-4.6-pic
75 # package which provides libstdc++_pic.a, but the linker can't find it.
76 # Symlink it to a path that will be included in our link-line so that the
77 # linker picks it up before the default libstdc++.a.
78 # This is only necessary for 64bit.
79 ln -s /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++_pic.a ${BASEPREFIX}/x86_64-unknown-linux-gnu/lib/libstdc++.a
81 # Create the release tarball using (arbitrarily) the first host
83 ./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
85 SOURCEDIST=`echo bitcoin-*.tar.gz`
86 DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
87 # Correct tar file order
91 find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
95 # Extract the release tarball into a dir for each host and build
97 export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
100 INSTALLPATH=`pwd`/installed/${DISTNAME}
101 mkdir -p ${INSTALLPATH}
102 tar --strip-components=1 -xf ../$SOURCEDIST
104 ./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
108 find . -name "lib*.la" -delete
109 find . -name "lib*.a" -delete
110 rm -rf ${DISTNAME}/lib/pkgconfig
111 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
115 mv $SOURCEDIST $OUTDIR/src
116 mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-linux64.tar.gz
117 mv ${OUTDIR}/${DISTNAME}-i686-*.tar.gz ${OUTDIR}/${DISTNAME}-linux32.tar.gz