dash/contrib/gitian-descriptors/windows/gitian-win-darkcoin.yml

116 lines
4.3 KiB
YAML
Raw Normal View History

---
name: "darkcoin"
suites:
- "precise"
architectures:
- "amd64"
packages:
- "mingw-w64"
- "g++-mingw-w64"
- "git-core"
- "unzip"
- "nsis"
- "faketime"
reference_datetime: "2014-01-10 00:00:00"
remotes:
- "url": "https://github.com/darkcoin/darkcoin.git"
"dir": "darkcoin"
files:
- "qt-win32-4.8.5-gitian-r5.zip"
- "qt-win64-4.8.5-gitian-r5.zip"
- "boost-win32-1.55.0-gitian-r6.zip"
- "boost-win64-1.55.0-gitian-r6.zip"
- "bitcoin-deps-win32-gitian-r13.zip"
- "bitcoin-deps-win64-gitian-r13.zip"
- "protobuf-win32-2.5.0-gitian-r4.zip"
- "protobuf-win64-2.5.0-gitian-r4.zip"
script: |
# Defines
export TZ=UTC
INDIR=$HOME/build
OPTFLAGS='-O2'
TEMPDIR="$HOME/tempdir"
NEEDDIST=1
# Qt: workaround for determinism in resource ordering
# Qt5's rcc uses a QHash to store the files for the resource.
# A security fix in QHash makes the ordering of keys to be different on every run
# (https://qt.gitorious.org/qt/qtbase/commit/c01eaa438200edc9a3bbcd8ae1e8ded058bea268).
# This is good in general but qrc shouldn't be doing a traversal over a randomized container.
# The thorough solution would be to use QMap instead of QHash, but this requires patching Qt.
# For now luckily there is a test mode that forces a fixed seed.
export QT_RCC_TEST=1
for BITS in 32; do # for architectures
#
STAGING=$HOME/staging${BITS}
BUILDDIR=$HOME/build${BITS}
BINDIR=$OUTDIR/$BITS
if [ "$BITS" == "32" ]; then
HOST=i686-w64-mingw32
else
HOST=x86_64-w64-mingw32
fi
mkdir -p $STAGING $BUILDDIR $BINDIR
export PATH=$STAGING/host/bin:$PATH
#
cd $STAGING
unzip $INDIR/qt-win${BITS}-4.8.5-gitian-r5.zip
unzip $INDIR/boost-win${BITS}-1.55.0-gitian-r6.zip
unzip $INDIR/bitcoin-deps-win${BITS}-gitian-r13.zip
unzip $INDIR/protobuf-win${BITS}-2.5.0-gitian-r4.zip
if [ "$NEEDDIST" == "1" ]; then
# Make source code archive which is architecture independent so it only needs to be done once
cd $HOME/build/darkcoin
VERSION_TAG=`git describe --tags --exact-match --always | cut -c 2-`
git archive HEAD --format=tar.gz --prefix=darkcoin-$VERSION_TAG/ > darkcoin-$VERSION_TAG.tar.gz
DISTNAME=`echo darkcoin-*.tar.gz`
NEEDDIST=0
fi
# Build platform-dependent executables from source archive
cd $BUILDDIR
mkdir -p distsrc
cd distsrc
tar --strip-components=1 -xf $HOME/build/darkcoin/$DISTNAME
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
ln -s $STAGING $HOME/qt
$STAGING/host/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$STAGING MINIUPNPC_INCLUDE_PATH=$STAGING BDB_LIB_PATH=$STAGING BDB_INCLUDE_PATH=$STAGING BOOST_LIB_PATH=$STAGING BOOST_INCLUDE_PATH=$STAGING BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$STAGING OPENSSL_INCLUDE_PATH=$STAGING QRENCODE_LIB_PATH=$STAGING QRENCODE_INCLUDE_PATH=$STAGING USE_QRCODE=1 INCLUDEPATH=$STAGING DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=darkcoin USE_BUILD_INFO=1 USE_SSE2=1 USE_UPNP=1
make V=1 $MAKEOPTS
$HOST-strip release/darkcoin-qt.exe
cp -f release/darkcoin-qt.exe $BINDIR/
#
cd src
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
export TZ=UTC
make -f makefile.linux-mingw $MAKEOPTS DEPSDIR=$STAGING darkcoind.exe USE_UPNP=1 DEBUGFLAGS="-frandom-seed=darkcoin" USE_SSE2=1
$HOST-strip darkcoind.exe
mkdir $BINDIR/daemon
cp darkcoind.exe $BINDIR/daemon
cd ..
mkdir nsis
tar --strip-components=1 -xf $HOME/build/darkcoin/$DISTNAME -C nsis
cd nsis/src
mkdir ../release
cp -v ../../release/* ../release/
cp -v ../../src/*.exe .
sed "s/0.9.0.0/${VERSION_TAG}/" -i ../share/setup.nsi
makensis ../share/setup.nsi
cp -v ../share/darkcoin-*-win${BITS}-setup.exe $BINDIR/
unset LD_PRELOAD
unset FAKETIME
rm $HOME/qt
done # for BITS in
# sort distribution tar file and normalize user/group/mtime information for deterministic output
mkdir -p $OUTDIR/src
rm -rf $TEMPDIR
mkdir -p $TEMPDIR
cd $TEMPDIR
2014-08-21 21:06:49 +02:00
tar -xvf $HOME/build/darkcoin/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME