build 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% c("var/setarch") -%]
  4. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  5. distdir="/var/tmp/dist/[% project %]"
  6. [% c("var/set_PTDIR_DOCSDIR") -%]
  7. mkdir -p $PTDIR $DOCSDIR
  8. mkdir -p /var/tmp/build
  9. tar -C /var/tmp/build -xf $rootdir/[% project %]-[% c('version') %].tar.gz
  10. cd /var/tmp/build/[% project %]-[% c('version') %]
  11. tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/gmp') %]
  12. ln -s /var/tmp/dist/gmp thirdparty/gmp
  13. mkdir -p $distdir
  14. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/obfsproxy') %]
  15. [% IF c("var/linux-i686") -%]
  16. export CFLAGS=-m32
  17. export CXXFLAGS=-m32
  18. export LDFLAGS=-m32
  19. [% END -%]
  20. [% IF c("var/windows") -%]
  21. patch -p1 < $rootdir/bug20302.patch
  22. pydir=$distdir/python
  23. export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
  24. export LD_PRELOAD=
  25. export PYTHONPATH="$(wine winepath -w $pydir)\\Lib\\site-packages"
  26. # FTE only needs libgmp-10.dll and no libgmpxx anymore.
  27. cp -a /var/tmp/dist/gmp/bin/libgmp-10.dll .
  28. cp -a /var/tmp/dist/gmp/bin/libgmp-10.dll $distdir/TorBrowser/Tor/
  29. WINDOWS_BUILD=1 CROSS_COMPILE=1 make
  30. $PYTHON setup.py install --prefix=$(wine winepath -w "$pydir")
  31. $PYTHON setup.py install
  32. [% ELSE -%]
  33. export PYTHON=python2[% IF c("var/linux-i686") %].7[% END %]
  34. make
  35. cp -ra fte $PTDIR/
  36. mkdir -p $PTDIR/fteproxy-lib
  37. cp /var/tmp/dist/gmp/lib/libgmp.so.10 $PTDIR/fteproxy-lib
  38. [% END -%]
  39. cp -a {LICENSE,README.md} $DOCSDIR/
  40. cp -a thirdparty/re2/LICENSE $DOCSDIR/LICENSE.re2
  41. cd $distdir
  42. [% c('tar', {
  43. tar_src => [ '.' ],
  44. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  45. }) %]