2014-01-20 13:38:50 +01:00
|
|
|
---
|
2015-12-03 11:59:37 +01:00
|
|
|
name: "bitcoin-win-0.13"
|
2014-08-13 01:13:04 +02:00
|
|
|
enable_cache: true
|
2014-01-20 13:38:50 +01:00
|
|
|
suites:
|
2015-10-29 07:29:48 +01:00
|
|
|
- "trusty"
|
2014-01-20 13:38:50 +01:00
|
|
|
architectures:
|
|
|
|
- "amd64"
|
2015-12-25 13:14:26 +01:00
|
|
|
packages:
|
2016-02-27 07:09:18 +01:00
|
|
|
- "curl"
|
2014-08-13 01:13:04 +02:00
|
|
|
- "g++"
|
2014-01-20 13:38:50 +01:00
|
|
|
- "git-core"
|
2014-08-13 01:13:04 +02:00
|
|
|
- "pkg-config"
|
2015-10-29 07:29:48 +01:00
|
|
|
- "autoconf"
|
2014-01-20 13:38:50 +01:00
|
|
|
- "libtool"
|
|
|
|
- "automake"
|
2014-08-13 01:13:04 +02:00
|
|
|
- "faketime"
|
2014-01-20 13:38:50 +01:00
|
|
|
- "bsdmainutils"
|
2014-08-13 01:13:04 +02:00
|
|
|
- "mingw-w64"
|
|
|
|
- "g++-mingw-w64"
|
|
|
|
- "nsis"
|
2014-11-26 00:36:55 +01:00
|
|
|
- "zip"
|
2015-11-19 13:25:08 +01:00
|
|
|
- "ca-certificates"
|
|
|
|
- "python"
|
2014-01-20 13:38:50 +01:00
|
|
|
remotes:
|
|
|
|
- "url": "https://github.com/bitcoin/bitcoin.git"
|
|
|
|
"dir": "bitcoin"
|
2014-08-13 01:13:04 +02:00
|
|
|
files: []
|
2014-01-20 13:38:50 +01:00
|
|
|
script: |
|
2014-08-13 01:13:04 +02:00
|
|
|
WRAP_DIR=$HOME/wrapped
|
|
|
|
HOSTS="x86_64-w64-mingw32 i686-w64-mingw32"
|
2015-10-09 19:56:44 +02:00
|
|
|
CONFIGFLAGS="--enable-reduce-exports"
|
2014-08-13 01:13:04 +02:00
|
|
|
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip"
|
2014-11-26 00:36:55 +01:00
|
|
|
FAKETIME_PROGS="date makensis zip"
|
2014-08-13 01:13:04 +02:00
|
|
|
|
2014-01-31 21:37:43 +01:00
|
|
|
export QT_RCC_TEST=1
|
2014-08-13 01:13:04 +02:00
|
|
|
export GZIP="-9n"
|
|
|
|
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
|
|
|
|
export TZ="UTC"
|
|
|
|
export BUILD_DIR=`pwd`
|
|
|
|
mkdir -p ${WRAP_DIR}
|
|
|
|
if test -n "$GBUILD_CACHE_ENABLED"; then
|
|
|
|
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
|
|
|
|
export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
|
|
|
|
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
|
|
|
|
fi
|
|
|
|
|
2016-04-05 13:29:04 +02:00
|
|
|
function create_global_faketime_wrappers {
|
2014-08-13 01:13:04 +02:00
|
|
|
for prog in ${FAKETIME_PROGS}; do
|
|
|
|
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
|
|
|
|
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
|
2015-10-29 07:29:48 +01:00
|
|
|
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
|
2016-04-05 13:29:04 +02:00
|
|
|
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
|
2014-08-13 01:13:04 +02:00
|
|
|
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
|
|
|
|
chmod +x ${WRAP_DIR}/${prog}
|
|
|
|
done
|
2016-04-05 13:29:04 +02:00
|
|
|
}
|
2014-08-13 01:13:04 +02:00
|
|
|
|
2016-04-05 13:29:04 +02:00
|
|
|
function create_per-host_faketime_wrappers {
|
2014-08-13 01:13:04 +02:00
|
|
|
for i in $HOSTS; do
|
|
|
|
for prog in ${FAKETIME_HOST_PROGS}; do
|
|
|
|
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
|
|
|
|
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
2015-10-29 07:29:48 +01:00
|
|
|
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
|
2016-04-05 13:29:04 +02:00
|
|
|
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
2014-08-13 01:13:04 +02:00
|
|
|
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
|
|
|
chmod +x ${WRAP_DIR}/${i}-${prog}
|
|
|
|
done
|
|
|
|
done
|
2016-04-05 13:29:04 +02:00
|
|
|
}
|
2015-10-30 18:19:09 +01:00
|
|
|
|
2016-04-05 13:29:04 +02:00
|
|
|
function create_per-host_linker_wrapper {
|
2015-10-30 18:19:09 +01:00
|
|
|
# This is only needed for trusty, as the mingw linker leaks a few bytes of
|
|
|
|
# heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900
|
|
|
|
for i in $HOSTS; do
|
|
|
|
mkdir -p ${WRAP_DIR}/${i}
|
|
|
|
for prog in collect2; do
|
|
|
|
echo '#!/bin/bash' > ${WRAP_DIR}/${i}/${prog}
|
|
|
|
REAL=$(${i}-gcc -print-prog-name=${prog})
|
|
|
|
echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog}
|
|
|
|
echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog}
|
|
|
|
chmod +x ${WRAP_DIR}/${i}/${prog}
|
|
|
|
done
|
|
|
|
for prog in gcc g++; do
|
|
|
|
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
|
|
|
|
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
|
|
|
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
|
2016-04-05 13:29:04 +02:00
|
|
|
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
2015-10-30 18:19:09 +01:00
|
|
|
echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog}
|
|
|
|
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
|
|
|
chmod +x ${WRAP_DIR}/${i}-${prog}
|
|
|
|
done
|
|
|
|
done
|
2016-04-05 13:29:04 +02:00
|
|
|
}
|
2015-10-30 18:19:09 +01:00
|
|
|
|
2014-08-13 01:13:04 +02:00
|
|
|
export PATH=${WRAP_DIR}:${PATH}
|
|
|
|
|
2016-04-05 13:29:04 +02:00
|
|
|
# Faketime for depends so intermediate results are comparable
|
|
|
|
create_global_faketime_wrappers "2000-01-01 12:00:00"
|
|
|
|
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
|
|
|
|
create_per-host_linker_wrapper "2000-01-01 12:00:00"
|
|
|
|
|
2014-08-13 01:13:04 +02:00
|
|
|
cd bitcoin
|
|
|
|
BASEPREFIX=`pwd`/depends
|
|
|
|
# Build dependencies for each host
|
|
|
|
for i in $HOSTS; do
|
|
|
|
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
|
|
|
|
done
|
|
|
|
|
2016-04-05 13:29:04 +02:00
|
|
|
# Faketime for binaries
|
|
|
|
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
|
|
|
|
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
|
|
|
create_per-host_linker_wrapper "${REFERENCE_DATETIME}"
|
|
|
|
|
2014-08-13 01:13:04 +02:00
|
|
|
# Create the release tarball using (arbitrarily) the first host
|
|
|
|
./autogen.sh
|
|
|
|
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
|
|
|
|
make dist
|
2014-11-26 00:36:55 +01:00
|
|
|
SOURCEDIST=`echo bitcoin-*.tar.gz`
|
|
|
|
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
|
2014-08-13 01:13:04 +02:00
|
|
|
|
2014-11-20 03:46:40 +01:00
|
|
|
# Correct tar file order
|
|
|
|
mkdir -p temp
|
|
|
|
pushd temp
|
2014-11-26 00:36:55 +01:00
|
|
|
tar xf ../$SOURCEDIST
|
2014-12-24 01:42:40 +01:00
|
|
|
find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
|
2015-06-29 21:02:37 +02:00
|
|
|
mkdir -p $OUTDIR/src
|
|
|
|
cp ../$SOURCEDIST $OUTDIR/src
|
2014-11-20 03:46:40 +01:00
|
|
|
popd
|
|
|
|
|
2014-08-13 01:13:04 +02:00
|
|
|
ORIGPATH="$PATH"
|
|
|
|
# Extract the release tarball into a dir for each host and build
|
|
|
|
for i in ${HOSTS}; do
|
|
|
|
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
|
|
|
mkdir -p distsrc-${i}
|
|
|
|
cd distsrc-${i}
|
2014-11-26 00:36:55 +01:00
|
|
|
INSTALLPATH=`pwd`/installed/${DISTNAME}
|
|
|
|
mkdir -p ${INSTALLPATH}
|
|
|
|
tar --strip-components=1 -xf ../$SOURCEDIST
|
2014-08-13 01:13:04 +02:00
|
|
|
|
2014-11-26 00:36:55 +01:00
|
|
|
./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
|
2014-08-13 01:13:04 +02:00
|
|
|
make ${MAKEOPTS}
|
2016-01-26 21:00:30 +01:00
|
|
|
make ${MAKEOPTS} -C src check-security
|
2014-01-20 13:38:50 +01:00
|
|
|
make deploy
|
|
|
|
make install-strip
|
2014-08-13 01:13:04 +02:00
|
|
|
cp -f bitcoin-*setup*.exe $OUTDIR/
|
2014-11-26 00:36:55 +01:00
|
|
|
cd installed
|
|
|
|
mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/
|
|
|
|
find . -name "lib*.la" -delete
|
|
|
|
find . -name "lib*.a" -delete
|
|
|
|
rm -rf ${DISTNAME}/lib/pkgconfig
|
2015-02-12 23:07:13 +01:00
|
|
|
find ${DISTNAME} -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip
|
2014-11-26 00:36:55 +01:00
|
|
|
cd ../..
|
2014-08-13 01:13:04 +02:00
|
|
|
done
|
2015-06-29 21:02:37 +02:00
|
|
|
cd $OUTDIR
|
|
|
|
rename 's/-setup\.exe$/-setup-unsigned.exe/' *-setup.exe
|
|
|
|
find . -name "*-setup-unsigned.exe" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz
|
2014-11-26 00:36:55 +01:00
|
|
|
mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip
|
|
|
|
mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip
|