You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gitian-linux.yml 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. ---
  2. name: "starwels-linux-0.15"
  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/starwels/starwels.git"
  32. "dir": "starwels"
  33. files: []
  34. script: |
  35. WRAP_DIR=$HOME/wrapped
  36. HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu"
  37. CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
  38. FAKETIME_HOST_PROGS=""
  39. FAKETIME_PROGS="date ar ranlib nm"
  40. HOST_CFLAGS="-O2 -g"
  41. HOST_CXXFLAGS="-O2 -g"
  42. HOST_LDFLAGS=-static-libstdc++
  43. export QT_RCC_TEST=1
  44. export GZIP="-9n"
  45. export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
  46. export TZ="UTC"
  47. export BUILD_DIR=`pwd`
  48. mkdir -p ${WRAP_DIR}
  49. if test -n "$GBUILD_CACHE_ENABLED"; then
  50. export SOURCES_PATH=${GBUILD_COMMON_CACHE}
  51. export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
  52. mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
  53. fi
  54. function create_global_faketime_wrappers {
  55. for prog in ${FAKETIME_PROGS}; do
  56. echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
  57. echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
  58. echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
  59. echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
  60. echo "\$REAL \$@" >> $WRAP_DIR/${prog}
  61. chmod +x ${WRAP_DIR}/${prog}
  62. done
  63. }
  64. function create_per-host_faketime_wrappers {
  65. for i in $HOSTS; do
  66. for prog in ${FAKETIME_HOST_PROGS}; do
  67. echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
  68. echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
  69. echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
  70. echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
  71. echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
  72. chmod +x ${WRAP_DIR}/${i}-${prog}
  73. done
  74. done
  75. }
  76. # Faketime for depends so intermediate results are comparable
  77. export PATH_orig=${PATH}
  78. create_global_faketime_wrappers "2000-01-01 12:00:00"
  79. create_per-host_faketime_wrappers "2000-01-01 12:00:00"
  80. export PATH=${WRAP_DIR}:${PATH}
  81. EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes
  82. mkdir -p $EXTRA_INCLUDES_BASE
  83. # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
  84. # but we can't write there. Instead, create a link here and force it to be included in the
  85. # search paths by wrapping gcc/g++.
  86. mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu
  87. rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm
  88. ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm
  89. for prog in gcc g++; do
  90. rm -f ${WRAP_DIR}/${prog}
  91. cat << EOF > ${WRAP_DIR}/${prog}
  92. #!/bin/bash
  93. REAL="`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`"
  94. for var in "\$@"
  95. do
  96. if [ "\$var" = "-m32" ]; then
  97. export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
  98. export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
  99. break
  100. fi
  101. done
  102. \$REAL \$@
  103. EOF
  104. chmod +x ${WRAP_DIR}/${prog}
  105. done
  106. cd starwels
  107. BASEPREFIX=`pwd`/depends
  108. # Build dependencies for each host
  109. for i in $HOSTS; do
  110. EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
  111. if [ -d "$EXTRA_INCLUDES" ]; then
  112. export HOST_ID_SALT="$EXTRA_INCLUDES"
  113. fi
  114. make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
  115. unset HOST_ID_SALT
  116. done
  117. # Faketime for binaries
  118. export PATH=${PATH_orig}
  119. create_global_faketime_wrappers "${REFERENCE_DATETIME}"
  120. create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
  121. export PATH=${WRAP_DIR}:${PATH}
  122. # Create the release tarball using (arbitrarily) the first host
  123. ./autogen.sh
  124. CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
  125. make dist
  126. SOURCEDIST=`echo starwels-*.tar.gz`
  127. DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
  128. DISTDR=`echo starwels-*`
  129. # Correct tar file order
  130. mkdir -p temp
  131. pushd temp
  132. tar xf ../$SOURCEDIST
  133. find starwels-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
  134. popd
  135. # Workaround for tarball not building with the bare tag version (prep)
  136. make -C src obj/build.h
  137. ORIGPATH="$PATH"
  138. # Extract the release tarball into a dir for each host and build
  139. for i in ${HOSTS}; do
  140. export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
  141. mkdir -p distsrc-${i}
  142. cd distsrc-${i}
  143. INSTALLPATH=`pwd`/installed/${DISTDR}
  144. mkdir -p ${INSTALLPATH}
  145. tar --strip-components=1 -xf ../$SOURCEDIST
  146. # Workaround for tarball not building with the bare tag version
  147. echo '#!/bin/true' >share/genbuild.sh
  148. mkdir src/obj
  149. cp ../src/obj/build.h src/obj/
  150. 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}"
  151. make ${MAKEOPTS}
  152. make ${MAKEOPTS} -C src check-security
  153. #TODO: This is a quick hack that disables symbol checking for arm.
  154. # Instead, we should investigate why these are popping up.
  155. # For aarch64, we'll need to bump up the min GLIBC version, as the abi
  156. # support wasn't introduced until 2.17.
  157. case $i in
  158. aarch64-*) : ;;
  159. arm-*) : ;;
  160. *) make ${MAKEOPTS} -C src check-symbols ;;
  161. esac
  162. make install DESTDIR=${INSTALLPATH}
  163. cd installed
  164. find . -name "lib*.la" -delete
  165. find . -name "lib*.a" -delete
  166. rm -rf ${DISTDR}/lib/pkgconfig
  167. find ${DISTDR}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
  168. find ${DISTDR}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \;
  169. find ${DISTDR} -not -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTDR}-${i}.tar.gz
  170. find ${DISTDR} -name "*.dbg" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTDR}-${i}-debug.tar.gz
  171. cd ../../
  172. rm -rf distsrc-${i}
  173. done
  174. mkdir -p $OUTDIR/src
  175. mv $SOURCEDIST $OUTDIR/src