2011-02-01 18:27:14 +01:00
|
|
|
---
|
2020-06-11 10:34:42 +02:00
|
|
|
name: "dash-linux-0.17"
|
2014-08-13 01:13:04 +02:00
|
|
|
enable_cache: true
|
2019-03-16 13:24:26 +01:00
|
|
|
distro: "ubuntu"
|
2011-02-01 18:27:14 +01:00
|
|
|
suites:
|
2018-08-13 22:21:42 +02:00
|
|
|
- "bionic"
|
2011-02-01 18:27:14 +01:00
|
|
|
architectures:
|
2020-01-22 15:50:19 +01:00
|
|
|
- "amd64"
|
2015-05-06 22:49:49 +02:00
|
|
|
packages:
|
2016-02-27 07:09:18 +01:00
|
|
|
- "curl"
|
2016-06-13 07:57:21 +02:00
|
|
|
- "g++-aarch64-linux-gnu"
|
2018-08-16 20:33:09 +02:00
|
|
|
- "g++-8-aarch64-linux-gnu"
|
|
|
|
- "gcc-8-aarch64-linux-gnu"
|
2016-06-13 07:57:21 +02:00
|
|
|
- "binutils-aarch64-linux-gnu"
|
|
|
|
- "g++-arm-linux-gnueabihf"
|
2018-08-16 20:33:09 +02:00
|
|
|
- "g++-8-arm-linux-gnueabihf"
|
|
|
|
- "gcc-8-arm-linux-gnueabihf"
|
2016-06-13 07:57:21 +02:00
|
|
|
- "binutils-arm-linux-gnueabihf"
|
2018-08-16 20:33:09 +02:00
|
|
|
- "g++-riscv64-linux-gnu"
|
|
|
|
- "g++-8-riscv64-linux-gnu"
|
|
|
|
- "gcc-8-riscv64-linux-gnu"
|
|
|
|
- "binutils-riscv64-linux-gnu"
|
|
|
|
- "g++-8-multilib"
|
|
|
|
- "gcc-8-multilib"
|
2016-06-13 07:57:21 +02:00
|
|
|
- "binutils-gold"
|
2018-08-13 22:21:42 +02:00
|
|
|
- "git"
|
2012-02-15 20:42:51 +01:00
|
|
|
- "pkg-config"
|
2015-10-29 07:29:48 +01:00
|
|
|
- "autoconf"
|
2013-05-28 01:55:01 +02:00
|
|
|
- "libtool"
|
|
|
|
- "automake"
|
|
|
|
- "faketime"
|
2013-09-10 21:15:10 +02:00
|
|
|
- "bsdmainutils"
|
2015-11-19 13:11:50 +01:00
|
|
|
- "ca-certificates"
|
2018-07-16 14:49:23 +02:00
|
|
|
- "python3"
|
2018-11-16 13:11:23 +01:00
|
|
|
- "libxkbcommon0"
|
2019-12-12 11:47:04 +01:00
|
|
|
- "ccache"
|
2011-02-01 18:27:14 +01:00
|
|
|
remotes:
|
2015-04-03 00:51:08 +02:00
|
|
|
- "url": "https://github.com/dashpay/dash.git"
|
2015-03-19 15:15:08 +01:00
|
|
|
"dir": "dash"
|
2014-08-13 01:13:04 +02:00
|
|
|
files: []
|
2011-02-01 18:27:14 +01:00
|
|
|
script: |
|
2019-03-09 06:45:09 +01:00
|
|
|
set -e -o pipefail
|
2016-06-13 07:57:21 +02:00
|
|
|
|
2014-08-13 01:13:04 +02:00
|
|
|
WRAP_DIR=$HOME/wrapped
|
2020-02-11 09:10:34 +01:00
|
|
|
HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu"
|
2019-07-02 06:16:11 +02:00
|
|
|
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests --enable-crash-hooks"
|
2018-08-16 20:33:09 +02:00
|
|
|
FAKETIME_HOST_PROGS="gcc g++"
|
2016-06-13 07:57:21 +02:00
|
|
|
FAKETIME_PROGS="date ar ranlib nm"
|
2016-06-08 04:09:28 +02:00
|
|
|
HOST_CFLAGS="-O2 -g"
|
|
|
|
HOST_CXXFLAGS="-O2 -g"
|
2019-11-25 01:07:21 +01:00
|
|
|
HOST_LDFLAGS_BASE="-static-libstdc++"
|
2014-08-13 01:13:04 +02:00
|
|
|
|
|
|
|
export QT_RCC_TEST=1
|
2018-07-21 08:21:50 +02:00
|
|
|
export QT_RCC_SOURCE_DATE_OVERRIDE=1
|
2014-08-13 01:13:04 +02:00
|
|
|
export TZ="UTC"
|
2021-08-25 17:01:44 +02:00
|
|
|
export BUILD_DIR="$PWD"
|
2014-08-13 01:13:04 +02:00
|
|
|
mkdir -p ${WRAP_DIR}
|
|
|
|
if test -n "$GBUILD_CACHE_ENABLED"; then
|
|
|
|
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
|
2018-07-20 15:33:02 +02:00
|
|
|
export BASE_CACHE=${GBUILD_PACKAGE_CACHE}/depends
|
2014-08-13 01:13:04 +02:00
|
|
|
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
|
2018-07-20 15:33:02 +02:00
|
|
|
|
|
|
|
# Setup ccache to use correct cache directories and fix the compiler check of ccache
|
|
|
|
CONFIGFLAGS="${CONFIGFLAGS} --enable-ccache"
|
|
|
|
export CCACHE_DIR=${GBUILD_PACKAGE_CACHE}/ccache
|
|
|
|
# As we later wrap the gcc binaries, this is fast
|
|
|
|
export CCACHE_COMPILERCHECK="content"
|
2018-11-19 07:31:13 +01:00
|
|
|
if [ -f ${GBUILD_PACKAGE_CACHE}/ccache.tar ]; then
|
2018-07-20 15:33:02 +02:00
|
|
|
pushd ${GBUILD_PACKAGE_CACHE}
|
2018-11-19 07:31:13 +01:00
|
|
|
tar xf ccache.tar
|
|
|
|
rm ccache.tar
|
2018-07-20 15:33:02 +02:00
|
|
|
popd
|
|
|
|
fi
|
2018-11-19 07:31:13 +01:00
|
|
|
# instead of compressing ccache.tar, we let ccache handle it by itself
|
|
|
|
# Otherwise we end up uncompressing/compressing a lot of cache files which we actually never use
|
|
|
|
export CCACHE_COMPRESS=1
|
2018-07-20 15:33:02 +02:00
|
|
|
else
|
|
|
|
CONFIGFLAGS="${CONFIGFLAGS} --disable-ccache"
|
2014-08-13 01:13:04 +02:00
|
|
|
fi
|
|
|
|
|
2018-07-20 15:33:02 +02:00
|
|
|
# We include the GCC version in all wrappers so that ccache can detect compiler upgrades when hashing the wrappers
|
2021-10-23 23:52:41 +02:00
|
|
|
GCCVERSION=$(gcc --version | head -1)
|
2018-07-20 15:33:02 +02:00
|
|
|
|
2019-11-13 10:20:25 +01:00
|
|
|
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
|
2016-06-09 11:14:12 +02:00
|
|
|
function create_global_faketime_wrappers {
|
2014-08-13 01:13:04 +02:00
|
|
|
for prog in ${FAKETIME_PROGS}; do
|
2020-12-18 19:15:41 +01:00
|
|
|
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
|
2018-07-20 15:33:02 +02:00
|
|
|
echo "# GCCVERSION=${GCCVERSION}" >> ${WRAP_DIR}/${prog}
|
2014-08-13 01:13:04 +02:00
|
|
|
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
|
2019-11-13 10:20:25 +01:00
|
|
|
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
|
2016-06-09 11:14:12 +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}
|
2018-07-20 15:33:02 +02:00
|
|
|
touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${prog}
|
2014-08-13 01:13:04 +02:00
|
|
|
done
|
2016-06-09 11:14:12 +02:00
|
|
|
}
|
2014-08-13 01:13:04 +02:00
|
|
|
|
2016-06-09 11:14:12 +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
|
2018-08-16 20:33:09 +02:00
|
|
|
if which ${i}-${prog}-8
|
|
|
|
then
|
|
|
|
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
|
|
|
|
echo "# GCCVERSION=${GCCVERSION}" >> ${WRAP_DIR}/${i}-${prog}
|
|
|
|
echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
|
2019-11-13 10:20:25 +01:00
|
|
|
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
|
2018-08-16 20:33:09 +02:00
|
|
|
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
|
2021-11-10 17:19:22 +01:00
|
|
|
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
|
2018-08-16 20:33:09 +02:00
|
|
|
chmod +x ${WRAP_DIR}/${i}-${prog}
|
|
|
|
touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${i}-${prog}
|
|
|
|
fi
|
2014-08-13 01:13:04 +02:00
|
|
|
done
|
|
|
|
done
|
2016-06-09 11:14:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Faketime for depends so intermediate results are comparable
|
2016-06-14 09:13:07 +02:00
|
|
|
export PATH_orig=${PATH}
|
2016-06-09 11:14:12 +02:00
|
|
|
create_global_faketime_wrappers "2000-01-01 12:00:00"
|
|
|
|
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
|
2016-06-14 09:13:07 +02:00
|
|
|
export PATH=${WRAP_DIR}:${PATH}
|
2016-06-09 11:14:12 +02:00
|
|
|
|
2016-07-08 12:02:34 +02:00
|
|
|
EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes
|
|
|
|
mkdir -p $EXTRA_INCLUDES_BASE
|
|
|
|
|
|
|
|
# x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
|
|
|
|
# but we can't write there. Instead, create a link here and force it to be included in the
|
|
|
|
# search paths by wrapping gcc/g++.
|
|
|
|
|
|
|
|
mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu
|
|
|
|
rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm
|
|
|
|
ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm
|
|
|
|
|
|
|
|
for prog in gcc g++; do
|
|
|
|
rm -f ${WRAP_DIR}/${prog}
|
|
|
|
cat << EOF > ${WRAP_DIR}/${prog}
|
2020-12-18 19:15:41 +01:00
|
|
|
#!/usr/bin/env bash
|
2018-07-20 15:33:02 +02:00
|
|
|
# GCCVERSION=${GCCVERSION}
|
2018-08-16 20:33:09 +02:00
|
|
|
REAL="$(which -a ${prog}-8 | grep -v ${WRAP_DIR}/${prog} | head -1)"
|
2016-07-08 12:02:34 +02:00
|
|
|
for var in "\$@"
|
|
|
|
do
|
|
|
|
if [ "\$var" = "-m32" ]; then
|
|
|
|
export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
|
|
|
|
export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
\$REAL \$@
|
|
|
|
EOF
|
|
|
|
chmod +x ${WRAP_DIR}/${prog}
|
2018-07-20 15:33:02 +02:00
|
|
|
touch -d "${REFERENCE_DATETIME}" ${WRAP_DIR}/${prog}
|
2016-07-08 12:02:34 +02:00
|
|
|
done
|
|
|
|
|
2015-03-19 15:15:08 +01:00
|
|
|
cd dash
|
2021-08-25 17:01:44 +02:00
|
|
|
BASEPREFIX="${PWD}/depends"
|
2014-08-13 01:13:04 +02:00
|
|
|
# Build dependencies for each host
|
|
|
|
for i in $HOSTS; do
|
2016-07-08 12:02:34 +02:00
|
|
|
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
|
|
|
|
if [ -d "$EXTRA_INCLUDES" ]; then
|
|
|
|
export HOST_ID_SALT="$EXTRA_INCLUDES"
|
|
|
|
fi
|
2014-08-13 01:13:04 +02:00
|
|
|
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
|
2016-07-08 12:02:34 +02:00
|
|
|
unset HOST_ID_SALT
|
2014-08-13 01:13:04 +02:00
|
|
|
done
|
|
|
|
|
2016-06-09 11:14:12 +02:00
|
|
|
# Faketime for binaries
|
2016-06-14 09:13:07 +02:00
|
|
|
export PATH=${PATH_orig}
|
2016-06-09 11:14:12 +02:00
|
|
|
create_global_faketime_wrappers "${REFERENCE_DATETIME}"
|
|
|
|
create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
|
2016-06-14 09:13:07 +02:00
|
|
|
export PATH=${WRAP_DIR}:${PATH}
|
2016-06-09 11:14:12 +02:00
|
|
|
|
2020-04-28 10:28:34 +02:00
|
|
|
# Create the git archive, and define DISTNAME and GIT_ARCHIVE variables.
|
|
|
|
# shellcheck source=contrib/gitian-descriptors/make_git_archive
|
|
|
|
source contrib/gitian-descriptors/make_git_archive
|
2017-08-21 08:58:58 +02:00
|
|
|
|
2014-08-13 01:13:04 +02:00
|
|
|
ORIGPATH="$PATH"
|
2020-04-28 10:28:34 +02:00
|
|
|
# Extract the git archive into a dir for each host and build
|
2014-08-13 01:13:04 +02:00
|
|
|
for i in ${HOSTS}; do
|
|
|
|
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
|
2019-11-25 01:07:21 +01:00
|
|
|
if [ "${i}" = "riscv64-linux-gnu" ]; then
|
|
|
|
# Workaround for https://bugs.launchpad.net/ubuntu/+source/gcc-8-cross-ports/+bug/1853740
|
|
|
|
# TODO: remove this when no longer needed
|
|
|
|
HOST_LDFLAGS="${HOST_LDFLAGS_BASE} -Wl,-z,noexecstack"
|
|
|
|
else
|
|
|
|
HOST_LDFLAGS="${HOST_LDFLAGS_BASE}"
|
|
|
|
fi
|
2014-08-13 01:13:04 +02:00
|
|
|
mkdir -p distsrc-${i}
|
|
|
|
cd distsrc-${i}
|
2021-08-25 17:01:44 +02:00
|
|
|
INSTALLPATH="${PWD}/installed/${DISTNAME}"
|
2014-11-26 00:36:55 +01:00
|
|
|
mkdir -p ${INSTALLPATH}
|
2020-04-28 10:28:34 +02:00
|
|
|
tar -xf $GIT_ARCHIVE
|
2017-08-21 08:58:58 +02:00
|
|
|
|
2020-04-28 10:28:34 +02:00
|
|
|
./autogen.sh
|
2018-07-20 15:33:02 +02:00
|
|
|
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}"
|
2014-08-13 01:13:04 +02:00
|
|
|
make ${MAKEOPTS}
|
2016-01-26 20:50:50 +01:00
|
|
|
make ${MAKEOPTS} -C src check-security
|
2018-08-31 12:57:47 +02:00
|
|
|
make ${MAKEOPTS} -C src check-symbols
|
2016-06-08 04:09:28 +02:00
|
|
|
make install DESTDIR=${INSTALLPATH}
|
2014-11-26 00:36:55 +01:00
|
|
|
cd installed
|
|
|
|
find . -name "lib*.la" -delete
|
|
|
|
find . -name "lib*.a" -delete
|
|
|
|
rm -rf ${DISTNAME}/lib/pkgconfig
|
2019-03-09 06:45:09 +01:00
|
|
|
find ${DISTNAME}/bin -type f -executable -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
|
|
|
|
find ${DISTNAME}/lib -type f -print0 | xargs -0 -n1 -I{} ../contrib/devtools/split-debug.sh {} {} {}.dbg
|
2020-04-28 10:28:34 +02:00
|
|
|
cp ../README.md ${DISTNAME}/
|
2019-06-11 18:09:55 +02:00
|
|
|
find ${DISTNAME} -not -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
|
|
|
|
find ${DISTNAME} -name "*.dbg" | sort | tar --mtime="$REFERENCE_DATETIME" --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz
|
2014-11-26 00:36:55 +01:00
|
|
|
cd ../../
|
2016-06-08 04:09:28 +02:00
|
|
|
rm -rf distsrc-${i}
|
2014-08-13 01:13:04 +02:00
|
|
|
done
|
2018-07-20 15:33:02 +02:00
|
|
|
|
|
|
|
# Compress ccache (otherwise the assert file will get too huge)
|
|
|
|
if [ "$CCACHE_DIR" != "" ]; then
|
|
|
|
pushd ${GBUILD_PACKAGE_CACHE}
|
2018-11-19 07:31:13 +01:00
|
|
|
tar cf ccache.tar ccache
|
2018-07-20 15:33:02 +02:00
|
|
|
rm -rf ccache
|
|
|
|
popd
|
|
|
|
fi
|
2020-03-25 14:47:10 +01:00
|
|
|
|