Changeset View
Changeset View
Standalone View
Standalone View
contrib/gitian-descriptors/gitian-win.yml
Show All 17 Lines | |||||
- "git" | - "git" | ||||
- "libtool" | - "libtool" | ||||
- "ninja-build" | - "ninja-build" | ||||
- "mingw-w64" | - "mingw-w64" | ||||
- "nsis" | - "nsis" | ||||
- "pkg-config" | - "pkg-config" | ||||
- "python3" | - "python3" | ||||
- "zip" | - "zip" | ||||
# FIXME: these dependencies are only required to make CMake happy when building | |||||
# native tools. They can be removed when the `NativeExecutable.cmake` gets | |||||
# improved to avoid requiring all the bitcoin-abc dependencies. | |||||
- "libboost-all-dev" | |||||
- "libevent-dev" | |||||
- "libssl-dev" | |||||
repositories: | repositories: | ||||
- "distribution": "buster-backports" | - "distribution": "buster-backports" | ||||
"source": "deb http://deb.debian.org/debian/ buster-backports main" | "source": "deb http://deb.debian.org/debian/ buster-backports main" | ||||
packages: | packages: | ||||
- "cmake" | - "cmake" | ||||
remotes: | remotes: | ||||
- "url": "https://github.com/Bitcoin-ABC/bitcoin-abc.git" | - "url": "https://github.com/Bitcoin-ABC/bitcoin-abc.git" | ||||
"dir": "bitcoin" | "dir": "bitcoin" | ||||
files: [] | files: [] | ||||
script: | | script: | | ||||
WRAP_DIR=$HOME/wrapped | WRAP_DIR=$HOME/wrapped | ||||
HOSTS="x86_64-w64-mingw32" | HOSTS=( | ||||
x86_64-w64-mingw32 | |||||
) | |||||
# CMake toolchain file name differ from host name | # CMake toolchain file name differ from host name | ||||
declare -A CMAKE_TOOLCHAIN_FILE | declare -A CMAKE_TOOLCHAIN_FILE | ||||
CMAKE_TOOLCHAIN_FILE[x86_64-w64-mingw32]=Win64.cmake | CMAKE_TOOLCHAIN_FILE[x86_64-w64-mingw32]=Win64.cmake | ||||
FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy" | FAKETIME_HOST_PROGS="ar ranlib nm windres strip objcopy" | ||||
FAKETIME_PROGS="date makensis zip" | FAKETIME_PROGS="date makensis zip" | ||||
HOST_CFLAGS="-O2 -g" | HOST_CFLAGS="-O2 -g" | ||||
Show All 17 Lines | for prog in ${FAKETIME_PROGS}; do | ||||
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} | echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} | ||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} | echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog} | ||||
echo "\$REAL \$@" >> $WRAP_DIR/${prog} | echo "\$REAL \$@" >> $WRAP_DIR/${prog} | ||||
chmod +x ${WRAP_DIR}/${prog} | chmod +x ${WRAP_DIR}/${prog} | ||||
done | done | ||||
} | } | ||||
function create_per-host_faketime_wrappers { | function create_per-host_faketime_wrappers { | ||||
for i in $HOSTS; do | for i in ${HOSTS[@]}; do | ||||
for prog in ${FAKETIME_HOST_PROGS}; do | for prog in ${FAKETIME_HOST_PROGS}; do | ||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} | echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog} | ||||
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${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} | echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog} | ||||
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} | echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog} | ||||
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} | echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog} | ||||
chmod +x ${WRAP_DIR}/${i}-${prog} | chmod +x ${WRAP_DIR}/${i}-${prog} | ||||
done | done | ||||
done | done | ||||
} | } | ||||
function create_per-host_linker_wrapper { | function create_per-host_linker_wrapper { | ||||
# This is only needed for trusty, as the mingw linker leaks a few bytes of | # 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 | # heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900 | ||||
for i in $HOSTS; do | for i in ${HOSTS[@]}; do | ||||
mkdir -p ${WRAP_DIR}/${i} | mkdir -p ${WRAP_DIR}/${i} | ||||
for prog in collect2; do | for prog in collect2; do | ||||
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog} | echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}/${prog} | ||||
REAL=$(${i}-gcc -print-prog-name=${prog}) | REAL=$(${i}-gcc -print-prog-name=${prog}) | ||||
echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog} | echo "export MALLOC_PERTURB_=255" >> ${WRAP_DIR}/${i}/${prog} | ||||
echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog} | echo "${REAL} \$@" >> $WRAP_DIR/${i}/${prog} | ||||
chmod +x ${WRAP_DIR}/${i}/${prog} | chmod +x ${WRAP_DIR}/${i}/${prog} | ||||
done | done | ||||
Show All 15 Lines | script: | | ||||
create_per-host_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" | create_per-host_linker_wrapper "2000-01-01 12:00:00" | ||||
export PATH=${WRAP_DIR}:${PATH} | export PATH=${WRAP_DIR}:${PATH} | ||||
cd bitcoin | cd bitcoin | ||||
SOURCEDIR=`pwd` | SOURCEDIR=`pwd` | ||||
BASEPREFIX=`pwd`/depends | BASEPREFIX=`pwd`/depends | ||||
# Build dependencies for each host | # Build dependencies for each host | ||||
for i in $HOSTS; do | for i in ${HOSTS[@]}; do | ||||
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" | make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" | ||||
done | done | ||||
# Faketime for binaries | # Faketime for binaries | ||||
export PATH=${PATH_orig} | export PATH=${PATH_orig} | ||||
create_global_faketime_wrappers "${REFERENCE_DATETIME}" | create_global_faketime_wrappers "${REFERENCE_DATETIME}" | ||||
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" | create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" | ||||
create_per-host_linker_wrapper "${REFERENCE_DATETIME}" | create_per-host_linker_wrapper "${REFERENCE_DATETIME}" | ||||
export PATH=${WRAP_DIR}:${PATH} | export PATH=${WRAP_DIR}:${PATH} | ||||
mkdir -p source_package | mkdir -p source_package | ||||
pushd source_package | pushd source_package | ||||
# Any toolchain file will work for building the source package, just pick the | |||||
# first one | |||||
cmake -GNinja .. \ | cmake -GNinja .. \ | ||||
-DBUILD_BITCOIN_WALLET=OFF \ | -DCMAKE_TOOLCHAIN_FILE=${SOURCEDIR}/cmake/platforms/${CMAKE_TOOLCHAIN_FILE[${HOSTS[0]}]} | ||||
-DBUILD_BITCOIN_ZMQ=OFF \ | |||||
-DBUILD_BITCOIN_SEEDER=OFF \ | |||||
-DBUILD_BITCOIN_CLI=OFF \ | |||||
-DBUILD_BITCOIN_TX=OFF \ | |||||
-DBUILD_BITCOIN_QT=OFF \ | |||||
-DBUILD_LIBBITCOINCONSENSUS=OFF \ | |||||
-DENABLE_CLANG_TIDY=OFF \ | |||||
-DENABLE_QRCODE=OFF \ | |||||
-DENABLE_UPNP=OFF \ | |||||
-DUSE_JEMALLOC=OFF | |||||
ninja package_source | ninja package_source | ||||
SOURCEDIST=`echo bitcoin-abc-*.tar.gz` | SOURCEDIST=`echo bitcoin-abc-*.tar.gz` | ||||
mv ${SOURCEDIST} .. | mv ${SOURCEDIST} .. | ||||
popd | popd | ||||
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` | DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'` | ||||
# Correct tar file order | # Correct tar file order | ||||
mkdir -p temp | mkdir -p temp | ||||
pushd temp | pushd temp | ||||
tar -xf ../$SOURCEDIST | tar -xf ../$SOURCEDIST | ||||
find bitcoin-abc-* | sort | tar --mtime="${REFERENCE_DATETIME}" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST | find bitcoin-abc-* | sort | tar --mtime="${REFERENCE_DATETIME}" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST | ||||
mkdir -p $OUTDIR/src | mkdir -p $OUTDIR/src | ||||
cp ../$SOURCEDIST $OUTDIR/src | cp ../$SOURCEDIST $OUTDIR/src | ||||
popd | popd | ||||
# Allow extra cmake option to be specified for each host | # Allow extra cmake option to be specified for each host | ||||
declare -A CMAKE_EXTRA_OPTIONS | declare -A CMAKE_EXTRA_OPTIONS | ||||
CMAKE_EXTRA_OPTIONS[x86_64-w64-mingw32]="-DCPACK_PACKAGE_FILE_NAME=${DISTNAME}-win64-setup-unsigned" | CMAKE_EXTRA_OPTIONS[x86_64-w64-mingw32]="-DCPACK_PACKAGE_FILE_NAME=${DISTNAME}-win64-setup-unsigned" | ||||
ORIGPATH="$PATH" | ORIGPATH="$PATH" | ||||
# Extract the release tarball into a dir for each host and build | # Extract the release tarball into a dir for each host and build | ||||
for i in ${HOSTS}; do | for i in ${HOSTS[@]}; do | ||||
export PATH=${BASEPREFIX}/${i}/native/bin:${WRAP_DIR}:${ORIGPATH} | export PATH=${BASEPREFIX}/${i}/native/bin:${WRAP_DIR}:${ORIGPATH} | ||||
mkdir -p distsrc-${i} | mkdir -p distsrc-${i} | ||||
cd distsrc-${i} | cd distsrc-${i} | ||||
INSTALLPATH=`pwd`/installed/${DISTNAME} | INSTALLPATH=`pwd`/installed/${DISTNAME} | ||||
mkdir -p ${INSTALLPATH} | mkdir -p ${INSTALLPATH} | ||||
tar --strip-components=1 -xf ../$SOURCEDIST | tar --strip-components=1 -xf ../$SOURCEDIST | ||||
cmake -GNinja .. \ | cmake -GNinja .. \ | ||||
Show All 30 Lines |