Changeset View
Changeset View
Standalone View
Standalone View
contrib/gitian-descriptors/gitian-linux.yml
Show All 21 Lines | |||||
- "gcc-aarch64-linux-gnu" | - "gcc-aarch64-linux-gnu" | ||||
- "gcc-arm-linux-gnueabihf" | - "gcc-arm-linux-gnueabihf" | ||||
- "git" | - "git" | ||||
- "gperf" | - "gperf" | ||||
- "libtool" | - "libtool" | ||||
- "ninja-build" | - "ninja-build" | ||||
- "pkg-config" | - "pkg-config" | ||||
- "python3" | - "python3" | ||||
# 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-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu" | HOSTS=( | ||||
x86_64-linux-gnu | |||||
arm-linux-gnueabihf | |||||
aarch64-linux-gnu | |||||
) | |||||
# 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-linux-gnu]=Linux64.cmake | CMAKE_TOOLCHAIN_FILE[x86_64-linux-gnu]=Linux64.cmake | ||||
CMAKE_TOOLCHAIN_FILE[arm-linux-gnueabihf]=LinuxARM.cmake | CMAKE_TOOLCHAIN_FILE[arm-linux-gnueabihf]=LinuxARM.cmake | ||||
CMAKE_TOOLCHAIN_FILE[aarch64-linux-gnu]=LinuxAArch64.cmake | CMAKE_TOOLCHAIN_FILE[aarch64-linux-gnu]=LinuxAArch64.cmake | ||||
# Allow extra cmake option to be specified for each host | # Allow extra cmake option to be specified for each host | ||||
Show All 25 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 | ||||
} | } | ||||
# Faketime for depends so intermediate results are comparable | # Faketime for depends so intermediate results are comparable | ||||
export PATH_orig=${PATH} | export PATH_orig=${PATH} | ||||
create_global_faketime_wrappers "2000-01-01 12:00:00" | create_global_faketime_wrappers "2000-01-01 12:00:00" | ||||
create_per-host_faketime_wrappers "2000-01-01 12:00:00" | create_per-host_faketime_wrappers "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}" | ||||
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 | ||||
popd | popd | ||||
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:${ORIGPATH} | export PATH=${BASEPREFIX}/${i}/native/bin:${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 25 Lines |