Debian Codegraph @

contrib/gitian/gitian-linux.yml

raw symbols SCIP
1 ---
2 name: "monero-linux-0.18"
3 enable_cache: true
4 suites:
5 - "bionic"
6 architectures:
7 - "amd64"
8 packages:
9 - "curl"
10 - "gperf"
11 - "gcc-7"
12 - "g++-7"
13 - "gcc"
14 - "g++"
15 - "gcc-7-aarch64-linux-gnu"
16 - "g++-7-aarch64-linux-gnu"
17 - "gcc-aarch64-linux-gnu"
18 - "g++-aarch64-linux-gnu"
19 - "binutils-aarch64-linux-gnu"
20 - "gcc-7-arm-linux-gnueabihf"
21 - "g++-7-arm-linux-gnueabihf"
22 - "gcc-arm-linux-gnueabihf"
23 - "g++-arm-linux-gnueabihf"
24 - "g++-riscv64-linux-gnu"
25 - "g++-7-multilib"
26 - "gcc-7-multilib"
27 - "binutils-arm-linux-gnueabihf"
28 - "binutils-gold"
29 - "git"
30 - "pkg-config"
31 - "build-essential"
32 - "autoconf"
33 - "libtool"
34 - "automake"
35 - "faketime"
36 - "bsdmainutils"
37 - "ca-certificates"
38 - "python"
39 - "cmake"
40 remotes:
41 - "url": "https://github.com/monero-project/monero.git"
42 "dir": "monero"
43 files: []
44 script: |
45
46 WRAP_DIR=$HOME/wrapped
47 HOSTS="x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu i686-linux-gnu riscv64-linux-gnu"
48 FAKETIME_HOST_PROGS=""
49 FAKETIME_PROGS="date"
50 HOST_CFLAGS="-O2 -g"
51 HOST_CXXFLAGS="-O2 -g"
52 HOST_LDFLAGS=-static-libstdc++
53
54 export GZIP="-9n"
55 export TZ="UTC"
56 export BUILD_DIR=`pwd`
57 mkdir -p ${WRAP_DIR}
58 if test -n "$GBUILD_CACHE_ENABLED"; then
59 export SOURCES_PATH=${GBUILD_COMMON_CACHE}
60 export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
61 export GITIAN=1
62 mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
63 fi
64
65 function create_global_faketime_wrappers {
66 for prog in ${FAKETIME_PROGS}; do
67 echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
68 echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
69 echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
70 echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
71 echo "\$REAL \$@" >> $WRAP_DIR/${prog}
72 chmod +x ${WRAP_DIR}/${prog}
73 done
74 }
75
76 function create_per-host_faketime_wrappers {
77 for i in $HOSTS; do
78 for prog in ${FAKETIME_HOST_PROGS}; do
79 if which ${i}-${prog}-7
80 then
81 echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
82 echo "REAL=\`which -a ${i}-${prog}-7 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
83 echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
84 echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
85 echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
86 chmod +x ${WRAP_DIR}/${i}-${prog}
87 fi
88 done
89 done
90 }
91
92 # Faketime for depends so intermediate results are comparable
93 export PATH_orig=${PATH}
94 create_global_faketime_wrappers "2000-01-01 12:00:00"
95 create_per-host_faketime_wrappers "2000-01-01 12:00:00"
96 export PATH=${WRAP_DIR}:${PATH}
97
98 EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes
99 mkdir -p $EXTRA_INCLUDES_BASE
100
101 # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
102 # but we can't write there. Instead, create a link here and force it to be included in the
103 # search paths.
104 # This problem goes away if linux-libc-dev:i386 pkg exists, but it's not in bionic.
105
106 mkdir -p $EXTRA_INCLUDES_BASE/i686-linux-gnu
107 rm -f $WRAP_DIR/extra_includes/i686-linux-gnu/asm
108 ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-linux-gnu/asm
109
110 # glibc 2.23 breaks compatibility with <=2.19 use of lgamma function.
111 # Hack the math header to restore the old behavior.
112 mkdir $EXTRA_INCLUDES_BASE/bits
113 sed -e '/__REDIRFROM .lgamma,/,+3s/_USE_/_DONTUSE_/g' /usr/include/x86_64-linux-gnu/bits/math-finite.h > $EXTRA_INCLUDES_BASE/bits/math-finite.h
114
115 # gcc 7+ honors SOURCE_DATE_EPOCH, no faketime needed
116 export SOURCE_DATE_EPOCH=`date -d 2000-01-01T12:00:00 +%s`
117
118 git config --global core.abbrev 9
119 cd monero
120 # Set the version string that gets added to the tar archive name
121 version="`git describe`"
122 if [[ $version == *"-"*"-"* ]]; then
123 version="`git rev-parse --short=9 HEAD`"
124 version="`echo $version | head -c 9`"
125 fi
126
127 BASEPREFIX=`pwd`/contrib/depends
128 # Build dependencies for each host
129 export TAR_OPTIONS=--mtime=2000-01-01T12:00:00
130 for i in $HOSTS; do
131 ARCH_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
132 if [ -d "$ARCH_INCLUDES" ]; then
133 EXTRA_INCLUDES="${EXTRA_INCLUDES_BASE}:${ARCH_INCLUDES}"
134 else
135 EXTRA_INCLUDES="${EXTRA_INCLUDES_BASE}"
136 fi
137 export C_INCLUDE_PATH="$EXTRA_INCLUDES"
138 export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES"
139 make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}" V=1
140 done
141
142 # Faketime for binaries
143 export PATH=${PATH_orig}
144 create_global_faketime_wrappers "${REFERENCE_DATETIME}"
145 create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
146 export PATH=${WRAP_DIR}:${PATH}
147
148 ORIGPATH="$PATH"
149 # Build in a new dir for each host
150 export SOURCE_DATE_EPOCH=`date -d ${REFERENCE_DATE}T${REFERENCE_TIME} +%s`
151 export TAR_OPTIONS=--mtime=${REFERENCE_DATE}T${REFERENCE_TIME}
152 for i in ${HOSTS}; do
153 export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
154 mkdir build && cd build
155 ARCH_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
156 if [ -d "$ARCH_INCLUDES" ]; then
157 EXTRA_INCLUDES="${EXTRA_INCLUDES_BASE}:${ARCH_INCLUDES}"
158 else
159 EXTRA_INCLUDES="${EXTRA_INCLUDES_BASE}"
160 fi
161 export C_INCLUDE_PATH="$EXTRA_INCLUDES"
162 export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES"
163 # glibc only added riscv support in 2.27, disable backwards compatibility
164 if [ "$i" == "riscv64-linux-gnu" ]; then
165 BACKCOMPAT_OPTION=OFF
166 else
167 BACKCOMPAT_OPTION=ON
168 fi
169 cmake .. -DCMAKE_TOOLCHAIN_FILE=${BASEPREFIX}/${i}/share/toolchain.cmake -DBACKCOMPAT=${BACKCOMPAT_OPTION} -DCMAKE_SKIP_RPATH=ON
170 make ${MAKEOPTS}
171 chmod 755 bin/*
172 cp ../LICENSE ../README.md ../docs/ANONYMITY_NETWORKS.md bin
173 chmod 644 bin/LICENSE bin/*.md
174 DISTNAME=monero-${i}-${version}
175 mv bin ${DISTNAME}
176 find ${DISTNAME}/ | sort | tar --no-recursion --owner=0 --group=0 -c -T - | bzip2 -9 > ${OUTDIR}/${DISTNAME}.tar.bz2
177 cd ..
178 rm -rf build
179 done
180