build 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/windows") -%]
  16. patch -p1 < $rootdir/bug20302.patch
  17. pydir=$distdir/python
  18. export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
  19. export LD_PRELOAD=
  20. export PYTHONPATH="$(wine winepath -w $pydir)\\Lib\\site-packages"
  21. # FTE only needs libgmp-10.dll and no libgmpxx anymore.
  22. cp -a /var/tmp/dist/gmp/bin/libgmp-10.dll .
  23. cp -a /var/tmp/dist/gmp/bin/libgmp-10.dll $distdir/TorBrowser/Tor/
  24. WINDOWS_BUILD=1 CROSS_COMPILE=1 make
  25. $PYTHON setup.py install --prefix=$(wine winepath -w "$pydir")
  26. $PYTHON setup.py install
  27. [% ELSE -%]
  28. export PYTHON=python2
  29. make
  30. cp -ra fte $PTDIR/
  31. mkdir -p $distdir/TorBrowser/Tor
  32. cp /var/tmp/dist/gmp/lib/libgmp.so.10 $distdir/TorBrowser/Tor/
  33. [% END -%]
  34. cp -a {LICENSE,README.md} $DOCSDIR/
  35. cp -a thirdparty/re2/LICENSE $DOCSDIR/LICENSE.re2
  36. cd $distdir
  37. [% c('tar', {
  38. tar_src => [ '.' ],
  39. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  40. }) %]