build 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. #!/bin/bash
  2. [% c("var/setarch") -%]
  3. [% c("var/set_default_env") -%]
  4. [% IF c("var/windows") -%]
  5. [% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcc') }) %]
  6. # We need a link to our GCC, otherwise the system cc gets used which points to
  7. # /usr/bin/gcc.
  8. ln -s gcc /var/tmp/dist/gcc/bin/cc
  9. [% END -%]
  10. [% IF c("var/gcc-cross") -%]
  11. [% pc('gcc-cross', 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ 'gcc-cross') }) %]
  12. # Work around missing libraries. Maybe there's a better way?
  13. #ln -s -T /usr/include/fontconfig /var/tmp/dist/gcc-cross/[% c(crosstarget) %]/include/fontconfig
  14. #ln -s -T /usr/include/ft2build.h /var/tmp/dist/gcc-cross/[% c(crosstarget) %]/include/ft2build.h
  15. #ln -s -T /usr/include/X11 /var/tmp/dist/gcc-cross/[% c(crosstarget) %]/include/X11
  16. # Work around try2
  17. #crossdepsdir=/var/tmp/dist/cross-deps-chroot
  18. #mkdir -p $crossdepsdir
  19. #fakeroot /usr/sbin/qemu-debootstrap --arch=armhf --variant=minbase --include=libgtk2.0-dev,libdbus-glib-1-dev,libxt-dev,libpulse-dev,libgconf2-dev,libx11-xcb-dev,libmpc2 wheezy $crossdepsdir
  20. #cp --archive --no-clobber $crossdepsdir/usr/include/* /var/tmp/dist/gcc-cross/[% c(crosstarget) %]/include/
  21. #cp --archive --no-clobber $crossdepsdir/usr/lib/[% c(crosstarget) %]/lib*.so* /var/tmp/dist/gcc-cross/[% c(crosstarget) %]/lib/
  22. # Work around try3
  23. crossdepsdir=/var/tmp/dist/cross-deps-chroot
  24. aptoptions=APT::Architecture=[% c("var/apt_arch") %]
  25. mkdir -p $crossdepsdir
  26. pushd $crossdepsdir
  27. apt-get --option $aptoptions download $(apt-rdepends libgtk2.0-dev:[% c("var/apt_arch") %] libgtk-3-dev:[% c("var/apt_arch") %] libdbus-glib-1-dev:[% c("var/apt_arch") %] libxt-dev:[% c("var/apt_arch") %] libpulse-dev:[% c("var/apt_arch") %] libgconf2-dev:[% c("var/apt_arch") %] libx11-xcb-dev:[% c("var/apt_arch") %] libmpc2:[% c("var/apt_arch") %]|grep -v "^ "|grep -v "debconf-2.0"|grep -v "gsettings-backend"|grep -v "libc-dev"|grep -v "libz-dev")
  28. #apt-get download $(apt-rdepends libgtk2.0-dev:armhf libdbus-glib-1-dev:armhf libxt-dev:armhf libpulse-dev:armhf libgconf2-dev:armhf libx11-xcb-dev:armhf libmpc2:armhf|grep -v "^ "|grep -v "debconf-2.0"|grep -v "libc-dev"|grep -v "libz-dev"|sed 's/:armhf//'|sed 's/$/:armhf/')
  29. #apt-get download $(apt-rdepends libgtk2.0-dev:armhf libdbus-glib-1-dev:armhf libxt-dev:armhf libpulse-dev:armhf libgconf2-dev:armhf libx11-xcb-dev:armhf libmpc2:armhf|grep -v "^ "|grep -v "debconf-2.0"|grep -v "libc-dev"|grep -v "libz-dev"|sed 's/:armhf//'|sed 's/$/:all/')
  30. #apt-get download libdbus-glib-1-dev:armhf libgconf2-dev:armhf libgtk2.0-dev:armhf libmpc2:armhf libpulse-dev:armhf libx11-6:armhf libx11-xcb-dev:armhf libx11-xcb1:armhf libxcb1:armhf libxcb-shm0:armhf libxext6:armhf libxt-dev:armhf libxt6:armhf
  31. for PACKAGE in ./*.deb; do
  32. dpkg -x $PACKAGE ./
  33. done
  34. popd
  35. cp --archive --no-clobber $crossdepsdir/usr/include/* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/include/
  36. cp --archive --no-clobber $crossdepsdir/usr/lib/[% c("var/gcc_target") %]/lib*.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  37. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libuuid.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  38. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libselinux.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  39. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/ld-linux.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  40. # Workaround for: /usr/bin/ld.gold.real: error: cannot open /var/tmp/dist/gcc-cross/lib/gcc/[% c(crosstarget) %]/6.4.0/../../../../[% c(crosstarget) %]/lib/libglib-2.0.so: No such file or directory
  41. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libglib*.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  42. cp --archive $crossdepsdir/lib/[% c("var/gcc_target") %]/libglib-2.0.so.0 /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libglib-2.0.so
  43. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libdbus*.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  44. cp --archive $crossdepsdir/lib/[% c("var/gcc_target") %]/libdbus-1.so.3 /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libdbus-1.so
  45. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libz*.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  46. cp --archive $crossdepsdir/lib/[% c("var/gcc_target") %]/libz.so.1 /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libz.so
  47. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libpng12*.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  48. cp --archive $crossdepsdir/lib/[% c("var/gcc_target") %]/libpng12.so.0 /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libpng12.so
  49. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libpcre.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  50. cp --archive $crossdepsdir/lib/[% c("var/gcc_target") %]/libpcre.so.3 /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libpcre.so
  51. cp --archive --no-clobber $crossdepsdir/lib/[% c("var/gcc_target") %]/libexpat.so* /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/
  52. cp --archive $crossdepsdir/lib/[% c("var/gcc_target") %]/libexpat.so.1 /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libexpat.so
  53. [% END -%]
  54. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  55. distdir=/var/tmp/dist/[% project %]
  56. mkdir -p /var/tmp/build
  57. mkdir -p [% dest_dir _ '/' _ c('filename') %]
  58. [% IF c("var/windows") -%]
  59. mingwdir=/var/tmp/dist/mingw-w64
  60. mkdir -p $mingwdir/helpers
  61. cat > $mingwdir/helpers/[% c("arch") %]-w64-mingw32-g++ << 'EOF'
  62. #!/bin/sh
  63. /var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-g++ [% c("var/LDFLAGS") %] [% c("var/CFLAGS") %] "$@"
  64. EOF
  65. cat > $mingwdir/helpers/[% c("arch") %]-w64-mingw32-gcc << 'EOF'
  66. #!/bin/sh
  67. /var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-gcc [% c("var/LDFLAGS") %] [% c("var/CFLAGS") %] "$@"
  68. EOF
  69. cat > $mingwdir/helpers/[% c("arch") %]-w64-mingw32-ld << 'EOF'
  70. #!/bin/sh
  71. /var/tmp/dist/mingw-w64/bin/[% c("arch") %]-w64-mingw32-ld [% c("var/LDFLAGS") %] "$@"
  72. EOF
  73. chmod +x $mingwdir/helpers/*
  74. export PATH="$mingwdir/helpers:$PATH"
  75. [% END -%]
  76. [% IF c("var/windows") %]
  77. # Unpack fxc2.
  78. mkdir -p /var/tmp/dist
  79. tar -C /var/tmp/dist -xf [% c('input_files_by_name/fxc2') %]
  80. fxcdir=/var/tmp/dist/fxc2/bin
  81. cp $mingwdir/[% c("arch") %]-w64-mingw32/bin/libwinpthread-1.dll $fxcdir
  82. export PATH="$fxcdir:$PATH"
  83. # fxc2 requires Wine.
  84. [% IF c("var/windows-x86_64") %]
  85. export WINEARCH=win64
  86. [% END %]
  87. export HOME=/var/tmp/home
  88. mkdir -p $HOME
  89. WINEROOT=$HOME/.wine/drive_c
  90. wine wineboot -i
  91. [% END -%]
  92. [% IF c("var/linux") %]
  93. mkdir -p /var/tmp/dist
  94. tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
  95. export PATH="/var/tmp/dist/binutils/bin:$PATH"
  96. [% END -%]
  97. [% IF c("var/selfrando") -%]
  98. tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/selfrando') %]
  99. # Selfrando wrapper
  100. export PATH="/var/tmp/dist/selfrando/Tools/TorBrowser/tc-wrapper/:$PATH"
  101. # We need to avoid the shuffling while building as this breaks compilation
  102. export SELFRANDO_skip_shuffle=
  103. [% END -%]
  104. mkdir -p /var/tmp/dist
  105. tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
  106. export PATH="/var/tmp/dist/rust/bin:$PATH"
  107. [% IF c("var/linux") %]
  108. # Add llvm so stylo can build
  109. tar -C /var/tmp/dist -xf [% c('input_files_by_name/llvm') %]
  110. export LLVM_CONFIG="/var/tmp/dist/llvm/bin/llvm-config"
  111. [% END -%]
  112. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  113. [% IF c("var/osx") %]
  114. mkdir -p "$distdir/Tor Browser.app/Contents/MacOS"
  115. [% ELSE %]
  116. mkdir -p $distdir/Browser
  117. [% END %]
  118. [% IF c("var/linux") %]
  119. mkdir -p $distdir/Debug/Browser/
  120. [% END %]
  121. cd /var/tmp/build/[% project %]-[% c("version") %]
  122. mv -f $rootdir/[% c('input_files_by_name/mozconfig') %] .mozconfig
  123. [% IF c("var/asan") -%]
  124. mv -f .mozconfig-asan .mozconfig
  125. # Without disabling LSan our build is blowing up:
  126. # https://bugs.torproject.org/10599#comment:52
  127. export ASAN_OPTIONS="detect_leaks=0"
  128. [% END -%]
  129. [% IF c("var/android") %]
  130. export GRADLE_MAVEN_REPOSITORIES="file:///var/tmp/gradle-dependencies"
  131. gradle_repo=/var/tmp/gradle-dependencies
  132. # Move Gradle Repo to hard-coded location. This location is embedded in the file
  133. # chrome/toolkit/content/global/buildconfig.html so needs to be standard for reproducibility
  134. mv $rootdir/[% c('input_files_by_name/gradle-dependencies') %] $gradle_repo
  135. # The download script assumes the artifact package name is the complete URL path.
  136. # In some cases this is incorrect, so copy those artifacts to the correct location
  137. cp -r $gradle_repo/guardianproject/gpmaven/master/* $gradle_repo
  138. # Move orbot files so they will be included in the apk during the build
  139. cp $rootdir/[% c('input_files_by_name/orbot') %]/* mobile/android/app
  140. # Prepare building the multi-locale .apk
  141. mkdir -p /var/tmp/dist/locales
  142. tar -C /var/tmp/dist/locales -xf $rootdir/[% c('input_files_by_name/firefox-locale-bundle') %]
  143. [% END %]
  144. eval $(perl $rootdir/get-moz-build-date [% c("var/copyright_year") %] [% c("var/torbrowser_version") %])
  145. if [ -z $MOZ_BUILD_DATE ]
  146. then
  147. echo "MOZ_BUILD_DATE is not set"
  148. exit 1
  149. fi
  150. [% IF c("var/windows") %]
  151. # FIXME
  152. # Ideally, using LDFLAGS (and e.g. DLLFLAGS for NSS) would be enough to get
  153. # all Firefox libraries linked against msvcr100. Alas, this does not hold for
  154. # NSPR. Without patching it we get a "missing entry points for _strcmpi in
  155. # msvcr100.dll". Now, this should be fixed in rev>=6179 as the def file there
  156. # contains a proper patch according to the mingw-w64 developers.
  157. # However, even with this patch the _strcmpi issue is still popping up,
  158. # probably due to a bug in our current linking setup. The small patch below
  159. # is therefore just a workaround which should get fixed but is at least
  160. # justified as the signature of _strcmpi and _stricmp is the same, see:
  161. # http://msdn.microsoft.com/en-us/library/k59z8dwe.aspx.
  162. sed 's/strcmpi/stricmp/' -i nsprpub/pr/src/linking/prlink.c
  163. export HOST_LDFLAGS=" "
  164. export LDFLAGS="-specs=/var/tmp/dist/mingw-w64/msvcr100.spec"
  165. # Our flags don't get passed to NSS. We need to do that manually using an
  166. # obscure one.
  167. export DLLFLAGS="-specs=/var/tmp/dist/mingw-w64/msvcr100.spec"
  168. # Make sure widl is not inserting random timestamps, see #21837.
  169. export WIDL_TIME_OVERRIDE="0"
  170. [% END %]
  171. [% IF c("var/osname") == "linux-i686" -%]
  172. export LDFLAGS=-m32
  173. export CFLAGS=-m32
  174. export CC='gcc -m32'
  175. [% END -%]
  176. [% IF c("var/windows") %]
  177. patch -p1 < $rootdir/nsis-uninstall.patch
  178. [% END -%]
  179. rm -f configure
  180. rm -f js/src/configure
  181. ./mach configure --with-tor-browser-version=[% c("var/torbrowser_version") %] --with-distribution-id=org.torproject --enable-update-channel=[% c("var/torbrowser_update_channel") %] --enable-bundled-fonts --with-branding=[% c("var/branding_directory") %]
  182. ./mach build --verbose
  183. [% IF c("var/android") %]
  184. # Building a multi-locale .apk
  185. [% FOREACH lang = c('var/locales') %]
  186. [% SET lang = tmpl(lang) %]
  187. ./mach build chrome-[% lang %];
  188. [% END %]
  189. export MOZ_CHROME_MULTILOCALE='[% tmpl(c('var/locales').join(' ')) %]'
  190. AB_CD=multi ./mach package
  191. # Copy the result over and return. There is nothing more to do for mobile.
  192. cp obj-*/dist/*unsigned-unaligned.apk [% dest_dir _ '/' _ c('filename') %]/tor-browser-unsigned-unaligned.apk
  193. [% RETURN %]
  194. [% END %]
  195. ./mach build stage-package
  196. [% IF c("var/osx") %]
  197. cp -a obj-macos/dist/firefox/* $distdir
  198. # Remove firefox-bin (we don't use it, see ticket #10126)
  199. rm -f "$distdir/Tor Browser.app/Contents/MacOS/firefox-bin"
  200. # Adjust the Info.plist file
  201. INFO_PLIST="$distdir/Tor Browser.app/Contents/Info.plist"
  202. mv "$INFO_PLIST" tmp.plist
  203. python $rootdir/fix-info-plist.py '[% c("var/torbrowser_version") %]' '[% c("var/copyright_year") %]' < tmp.plist > "$INFO_PLIST"
  204. rm -f tmp.plist
  205. [% END %]
  206. [% IF c("var/linux") %]
  207. cp -a obj-*/dist/firefox/* $distdir/Browser/
  208. # Remove firefox-bin (we don't use it, see ticket #10126)
  209. rm -f $distdir/Browser/firefox-bin
  210. # TODO: There goes FIPS-140.. We could upload these somewhere unique and
  211. # subsequent builds could test to see if they've been uploaded before...
  212. # But let's find out if it actually matters first..
  213. rm -f $distdir/Browser/*.chk
  214. # Replace firefox by a wrapper script (#25485)
  215. mv $distdir/Browser/firefox $distdir/Browser/firefox.real
  216. mv $rootdir/start-firefox $distdir/Browser/firefox
  217. chmod 755 $distdir/Browser/firefox
  218. [% END %]
  219. [% IF c("var/windows-x86_64") -%]
  220. mv $rootdir/msvcr100-x86_64.dll $rootdir/msvcr100.dll
  221. [% END -%]
  222. [% IF c("var/windows") %]
  223. cp -a obj-*/dist/firefox/* $distdir/Browser/
  224. cp -a $rootdir/msvcr100.dll $distdir/Browser
  225. cp -a $gcclibs/libssp-0.dll $distdir/Browser
  226. cp -a $fxcdir/d3dcompiler_47.dll $distdir/Browser
  227. [% END %]
  228. [% IF c("var/gcc-cross") -%]
  229. cp -a /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libssp.so* $distdir/Browser
  230. [% END %]
  231. # Make MAR-based update tools available for use during the bundle phase.
  232. # Note that mar and mbsdiff are standalone tools, compiled for the build
  233. # host's architecture. We also include signmar, certutil, and the libraries
  234. # they require; these utilities and libraries are built for the target
  235. # architecture.
  236. MARTOOLS=$distdir/mar-tools
  237. mkdir -p $MARTOOLS
  238. cp -p config/createprecomplete.py $MARTOOLS/
  239. cp -p tools/update-packaging/*.sh $MARTOOLS/
  240. cp -p obj-*/dist/host/bin/mar $MARTOOLS/
  241. cp -p obj-*/dist/host/bin/mbsdiff $MARTOOLS/
  242. [% IF c("var/linux") %]
  243. cp -p obj-*/modules/libmar/tool/signmar $MARTOOLS/
  244. cp -p obj-*/security/nss/cmd/certutil/certutil_certutil/certutil $MARTOOLS/
  245. cp -p obj-*/security/nss/cmd/modutil/modutil_modutil/modutil $MARTOOLS/
  246. cp -p obj-*/security/nss/cmd/pk12util/pk12util_pk12util/pk12util $MARTOOLS/
  247. cp -p obj-*/security/nss/cmd/shlibsign/shlibsign_shlibsign/shlibsign $MARTOOLS/
  248. NSS_LIBS="libfreeblpriv3.so libmozsqlite3.so libnss3.so libnssckbi.so libnssdbm3.so libnssutil3.so libsmime3.so libsoftokn3.so libssl3.so"
  249. NSPR_LIBS="libnspr4.so libplc4.so libplds4.so"
  250. for LIB in $NSS_LIBS $NSPR_LIBS; do
  251. cp -p obj-*/dist/bin/$LIB $MARTOOLS/
  252. done
  253. [% END %]
  254. [% IF c("var/osx") %]
  255. cp -p obj-*/modules/libmar/tool/signmar $MARTOOLS/
  256. cp -p obj-*/security/nss/cmd/certutil/certutil_certutil/certutil $MARTOOLS/
  257. cp -p obj-*/security/nss/cmd/modutil/modutil_modutil/modutil $MARTOOLS/
  258. cp -p obj-*/security/nss/cmd/pk12util/pk12util_pk12util/pk12util $MARTOOLS/
  259. cp -p obj-*/security/nss/cmd/shlibsign/shlibsign_shlibsign/shlibsign $MARTOOLS/
  260. NSS_LIBS="libfreebl3.dylib libmozglue.dylib libnss3.dylib libnssckbi.dylib libnssdbm3.dylib libsoftokn3.dylib"
  261. for LIB in $NSS_LIBS; do
  262. cp -p obj-*/dist/bin/$LIB $MARTOOLS/
  263. done
  264. [% END %]
  265. [% IF c("var/windows") %]
  266. cp -p obj-*/modules/libmar/tool/signmar.exe $MARTOOLS/
  267. cp -p obj-*/security/nss/cmd/certutil/certutil_certutil/certutil.exe $MARTOOLS/
  268. cp -p obj-*/security/nss/cmd/modutil/modutil_modutil/modutil.exe $MARTOOLS/
  269. cp -p obj-*/security/nss/cmd/pk12util/pk12util_pk12util/pk12util.exe $MARTOOLS/
  270. cp -p obj-*/security/nss/cmd/shlibsign/shlibsign_shlibsign/shlibsign.exe $MARTOOLS/
  271. NSS_LIBS="freebl3.dll mozglue.dll nss3.dll nssckbi.dll nssdbm3.dll softokn3.dll"
  272. for LIB in $NSS_LIBS; do
  273. cp -p obj-*/dist/bin/$LIB $MARTOOLS/
  274. done
  275. cp -a $rootdir/msvcr100.dll $MARTOOLS/
  276. [% END %]
  277. cd $distdir
  278. [% IF c("var/linux-x86_64") %]
  279. # Strip and generate debuginfo for the firefox binary that we keep, all *.so
  280. # files, the plugin-container, and the updater (see ticket #10126)
  281. for LIB in Browser/*.so Browser/firefox.real Browser/plugin-container Browser/updater
  282. do
  283. objcopy --only-keep-debug $LIB Debug/$LIB
  284. strip $LIB
  285. objcopy --add-gnu-debuglink=./Debug/$LIB $LIB
  286. [% IF c("var/selfrando") -%]
  287. # remove RUNPATH added by selfrando (see #22242)
  288. chrpath -d $LIB
  289. [% END -%]
  290. done
  291. [% END %]
  292. # Re-zipping the omni.ja files is not needed to make them reproductible,
  293. # however if we don't re-zip them, the files become corrupt when we
  294. # update them using 'zip' and firefox will silently fail to load some
  295. # parts.
  296. [% IF c("var/windows") || c("var/linux") %]
  297. [% c("var/rezip", { rezip_file => 'Browser/omni.ja' }) %]
  298. [% c("var/rezip", { rezip_file => 'Browser/browser/omni.ja' }) %]
  299. [% ELSIF c("var/osx") %]
  300. [% c("var/rezip", { rezip_file => '"Tor Browser.app/Contents/Resources/omni.ja"' }) %]
  301. [% c("var/rezip", { rezip_file => '"Tor Browser.app/Contents/Resources/browser/omni.ja"' }) %]
  302. [% END %]
  303. [% IF c("var/gcc-cross") -%]
  304. cp /var/tmp/dist/gcc-cross/[% c("var/gcc_target") %]/lib/libssp.so* Browser/
  305. [% END %]
  306. [%
  307. IF c("var/osx");
  308. SET browserdir='"Tor Browser.app/Contents"';
  309. ELSE;
  310. SET browserdir='Browser';
  311. END;
  312. %]
  313. [% IF c("var/linux") %]
  314. /var/tmp/dist/gcc/bin/g++ $rootdir/abicheck.cc -o Browser/abicheck
  315. [% END %]
  316. [% c('tar', {
  317. tar_src => [ browserdir ],
  318. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename') _ '/tor-browser.tar.gz',
  319. }) %]
  320. [% IF c("var/linux-x86_64") %]
  321. [% c('tar', {
  322. tar_src => [ 'Debug' ],
  323. tar_args => '-cJf ' _ dest_dir _ '/' _ c('filename') _ '/tor-browser-debug.tar.xz',
  324. }) %]
  325. [% END %]
  326. [% c('zip', {
  327. zip_src => [ 'mar-tools' ],
  328. zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'),
  329. }) %]