Merge #11597: [trivial] Fix error messages in CFeeBumper
[bitcoinplatinum.git] / contrib / gitian-descriptors / gitian-linux.yml
blobc80e19edbb2212d1e9ed821e75f1baf9261de951
1 ---
2 name: "bitcoin-linux-0.16"
3 enable_cache: true
4 suites:
5 - "trusty"
6 architectures:
7 - "amd64"
8 packages:
9 - "curl"
10 - "g++-aarch64-linux-gnu"
11 - "g++-4.8-aarch64-linux-gnu"
12 - "gcc-4.8-aarch64-linux-gnu"
13 - "binutils-aarch64-linux-gnu"
14 - "g++-arm-linux-gnueabihf"
15 - "g++-4.8-arm-linux-gnueabihf"
16 - "gcc-4.8-arm-linux-gnueabihf"
17 - "binutils-arm-linux-gnueabihf"
18 - "g++-4.8-multilib"
19 - "gcc-4.8-multilib"
20 - "binutils-gold"
21 - "git-core"
22 - "pkg-config"
23 - "autoconf"
24 - "libtool"
25 - "automake"
26 - "faketime"
27 - "bsdmainutils"
28 - "ca-certificates"
29 - "python"
30 remotes:
31 - "url": "https://github.com/bitcoin/bitcoin.git"
32   "dir": "bitcoin"
33 files: []
34 script: |
36   WRAP_DIR=$HOME/wrapped
37   HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu"
38   CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
39   FAKETIME_HOST_PROGS=""
40   FAKETIME_PROGS="date ar ranlib nm"
41   HOST_CFLAGS="-O2 -g"
42   HOST_CXXFLAGS="-O2 -g"
43   HOST_LDFLAGS=-static-libstdc++
45   export QT_RCC_TEST=1
46   export GZIP="-9n"
47   export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
48   export TZ="UTC"
49   export BUILD_DIR=`pwd`
50   mkdir -p ${WRAP_DIR}
51   if test -n "$GBUILD_CACHE_ENABLED"; then
52     export SOURCES_PATH=${GBUILD_COMMON_CACHE}
53     export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
54     mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
55   fi
57   function create_global_faketime_wrappers {
58   for prog in ${FAKETIME_PROGS}; do
59     echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
60     echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
61     echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
62     echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
63     echo "\$REAL \$@" >> $WRAP_DIR/${prog}
64     chmod +x ${WRAP_DIR}/${prog}
65   done
66   }
68   function create_per-host_faketime_wrappers {
69   for i in $HOSTS; do
70     for prog in ${FAKETIME_HOST_PROGS}; do
71         echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
72         echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
73         echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
74         echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
75         echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
76         chmod +x ${WRAP_DIR}/${i}-${prog}
77     done
78   done
79   }
81   # Faketime for depends so intermediate results are comparable
82   export PATH_orig=${PATH}
83   create_global_faketime_wrappers "2000-01-01 12:00:00"
84   create_per-host_faketime_wrappers "2000-01-01 12:00:00"
85   export PATH=${WRAP_DIR}:${PATH}
87   EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes
88   mkdir -p $EXTRA_INCLUDES_BASE
90   # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
91   # but we can't write there. Instead, create a link here and force it to be included in the
92   # search paths by wrapping gcc/g++.
94   mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu
95   rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm
96   ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm
98   for prog in gcc g++; do
99   rm -f ${WRAP_DIR}/${prog}
100   cat << EOF > ${WRAP_DIR}/${prog}
101   #!/bin/bash
102   REAL="`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`"
103   for var in "\$@"
104   do
105     if [ "\$var" = "-m32" ]; then
106       export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
107       export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
108       break
109     fi
110   done
111   \$REAL \$@
112   EOF
113   chmod +x ${WRAP_DIR}/${prog}
114   done
116   cd bitcoin
117   BASEPREFIX=`pwd`/depends
118   # Build dependencies for each host
119   for i in $HOSTS; do
120     EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
121     if [ -d "$EXTRA_INCLUDES" ]; then
122       export HOST_ID_SALT="$EXTRA_INCLUDES"
123     fi
124     make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
125     unset HOST_ID_SALT
126   done
128   # Faketime for binaries
129   export PATH=${PATH_orig}
130   create_global_faketime_wrappers "${REFERENCE_DATETIME}"
131   create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
132   export PATH=${WRAP_DIR}:${PATH}
134   # Create the release tarball using (arbitrarily) the first host
135   ./autogen.sh
136   CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
137   make dist
138   SOURCEDIST=`echo bitcoin-*.tar.gz`
139   DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
140   # Correct tar file order
141   mkdir -p temp
142   pushd temp
143   tar xf ../$SOURCEDIST
144   find bitcoin-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
145   popd
147   # Workaround for tarball not building with the bare tag version (prep)
148   make -C src obj/build.h
150   ORIGPATH="$PATH"
151   # Extract the release tarball into a dir for each host and build
152   for i in ${HOSTS}; do
153     export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
154     mkdir -p distsrc-${i}
155     cd distsrc-${i}
156     INSTALLPATH=`pwd`/installed/${DISTNAME}
157     mkdir -p ${INSTALLPATH}
158     tar --strip-components=1 -xf ../$SOURCEDIST
160     # Workaround for tarball not building with the bare tag version
161     echo '#!/bin/true' >share/genbuild.sh
162     mkdir src/obj
163     cp ../src/obj/build.h src/obj/
165     CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}"
166     make ${MAKEOPTS}
167     make ${MAKEOPTS} -C src check-security
169     #TODO: This is a quick hack that disables symbol checking for arm.
170     #      Instead, we should investigate why these are popping up.
171     #      For aarch64, we'll need to bump up the min GLIBC version, as the abi
172     #      support wasn't introduced until 2.17.
173     case $i in
174        aarch64-*) : ;;
175        arm-*) : ;;
176        *) make ${MAKEOPTS} -C src check-symbols ;;
177     esac
179     make install DESTDIR=${INSTALLPATH}
180     cd installed
181     find . -name "lib*.la" -delete
182     find . -name "lib*.a" -delete
183     rm -rf ${DISTNAME}/lib/pkgconfig
184     find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
185     find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
186     find ${DISTNAME} -not -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
187     find ${DISTNAME} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz
188     cd ../../
189     rm -rf distsrc-${i}
190   done
191   mkdir -p $OUTDIR/src
192   mv $SOURCEDIST $OUTDIR/src