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-osx.yml 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ---
  2. name: "starwels-osx-0.15"
  3. enable_cache: true
  4. suites:
  5. - "trusty"
  6. architectures:
  7. - "amd64"
  8. packages:
  9. - "ca-certificates"
  10. - "curl"
  11. - "g++"
  12. - "git-core"
  13. - "pkg-config"
  14. - "autoconf"
  15. - "librsvg2-bin"
  16. - "libtiff-tools"
  17. - "libtool"
  18. - "automake"
  19. - "faketime"
  20. - "bsdmainutils"
  21. - "cmake"
  22. - "imagemagick"
  23. - "libcap-dev"
  24. - "libz-dev"
  25. - "libbz2-dev"
  26. - "python"
  27. - "python-dev"
  28. - "python-setuptools"
  29. - "fonts-tuffy"
  30. remotes:
  31. - "url": "https://github.com/starwels/starwels.git"
  32. "dir": "starwels"
  33. files:
  34. - "MacOSX10.11.sdk.tar.gz"
  35. script: |
  36. WRAP_DIR=$HOME/wrapped
  37. HOSTS="x86_64-apple-darwin11"
  38. CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
  39. FAKETIME_HOST_PROGS=""
  40. FAKETIME_PROGS="ar ranlib date dmg genisoimage"
  41. export QT_RCC_TEST=1
  42. export GZIP="-9n"
  43. export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
  44. export TZ="UTC"
  45. export BUILD_DIR=`pwd`
  46. mkdir -p ${WRAP_DIR}
  47. if test -n "$GBUILD_CACHE_ENABLED"; then
  48. export SOURCES_PATH=${GBUILD_COMMON_CACHE}
  49. export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
  50. mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
  51. fi
  52. export ZERO_AR_DATE=1
  53. function create_global_faketime_wrappers {
  54. for prog in ${FAKETIME_PROGS}; do
  55. echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
  56. echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
  57. echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
  58. echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
  59. echo "\$REAL \$@" >> $WRAP_DIR/${prog}
  60. chmod +x ${WRAP_DIR}/${prog}
  61. done
  62. }
  63. function create_per-host_faketime_wrappers {
  64. for i in $HOSTS; do
  65. for prog in ${FAKETIME_HOST_PROGS}; do
  66. echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
  67. echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
  68. echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
  69. echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
  70. echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
  71. chmod +x ${WRAP_DIR}/${i}-${prog}
  72. done
  73. done
  74. }
  75. # Faketime for depends so intermediate results are comparable
  76. export PATH_orig=${PATH}
  77. create_global_faketime_wrappers "2000-01-01 12:00:00"
  78. create_per-host_faketime_wrappers "2000-01-01 12:00:00"
  79. export PATH=${WRAP_DIR}:${PATH}
  80. cd starwels
  81. BASEPREFIX=`pwd`/depends
  82. mkdir -p ${BASEPREFIX}/SDKs
  83. tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
  84. # Build dependencies for each host
  85. for i in $HOSTS; do
  86. make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
  87. done
  88. # Faketime for binaries
  89. export PATH=${PATH_orig}
  90. create_global_faketime_wrappers "${REFERENCE_DATETIME}"
  91. create_per-host_faketime_wrappers "${REFERENCE_DATETIME}"
  92. export PATH=${WRAP_DIR}:${PATH}
  93. # Create the release tarball using (arbitrarily) the first host
  94. ./autogen.sh
  95. CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/
  96. make dist
  97. SOURCEDIST=`echo starwels-*.tar.gz`
  98. DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
  99. DISTDR=`echo starwels-*`
  100. # Correct tar file order
  101. mkdir -p temp
  102. pushd temp
  103. tar xf ../$SOURCEDIST
  104. find starwels-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
  105. popd
  106. # Workaround for tarball not building with the bare tag version (prep)
  107. make -C src obj/build.h
  108. ORIGPATH="$PATH"
  109. # Extract the release tarball into a dir for each host and build
  110. for i in ${HOSTS}; do
  111. export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
  112. mkdir -p distsrc-${i}
  113. cd distsrc-${i}
  114. INSTALLPATH=`pwd`/installed/${DISTDR}
  115. mkdir -p ${INSTALLPATH}
  116. tar --strip-components=1 -xf ../$SOURCEDIST
  117. # Workaround for tarball not building with the bare tag version
  118. echo '#!/bin/true' >share/genbuild.sh
  119. mkdir src/obj
  120. cp ../src/obj/build.h src/obj/
  121. CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
  122. make ${MAKEOPTS}
  123. make install-strip DESTDIR=${INSTALLPATH}
  124. make osx_volname
  125. make deploydir
  126. OSX_VOLNAME="$(cat osx_volname)"
  127. mkdir -p unsigned-app-${i}
  128. cp osx_volname unsigned-app-${i}/
  129. cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
  130. cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
  131. cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
  132. cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
  133. cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
  134. mv dist unsigned-app-${i}
  135. pushd unsigned-app-${i}
  136. find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTDR}-osx-unsigned.tar.gz
  137. popd
  138. make deploy
  139. ${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTDR}-osx-unsigned.dmg
  140. cd installed
  141. find . -name "lib*.la" -delete
  142. find . -name "lib*.a" -delete
  143. rm -rf ${DISTDR}/lib/pkgconfig
  144. find ${DISTDR} | 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
  145. cd ../../
  146. done
  147. mkdir -p $OUTDIR/src
  148. mv $SOURCEDIST $OUTDIR/src
  149. mv ${OUTDIR}/${DISTDR}-x86_64-*.tar.gz ${OUTDIR}/${DISTDR}-osx64.tar.gz