build 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  4. distdir=/var/tmp/dist/[% project %]
  5. mkdir -p /var/tmp/build
  6. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  7. cd /var/tmp/build/[% project %]-[% c('version') %]
  8. # Fix for tor-browser-build#40470
  9. patch -p1 < $rootdir/0001-Fix-configure-issue-that-discarded-provided-CC-defin.patch
  10. [% IF c("var/windows") -%]
  11. make BINARY_PATH=$distdir/lib INCLUDE_PATH=$distdir/include LIBRARY_PATH=$distdir/lib -f win32/Makefile.gcc PREFIX=[% c("arch") %]-w64-mingw32- -j[% c("num_procs") %] SHARED_MODE=1 LOC="[% c("var/CFLAGS") %] [% c("var/LDFLAGS") %]"
  12. make BINARY_PATH=$distdir/lib INCLUDE_PATH=$distdir/include LIBRARY_PATH=$distdir/lib -f win32/Makefile.gcc PREFIX=[% c("arch") %]-w64-mingw32- -j[% c("num_procs") %] SHARED_MODE=1 LOC="[% c("var/CFLAGS") %] [% c("var/LDFLAGS") %]" install
  13. [% END -%]
  14. [% IF c("var/android") -%]
  15. export CHOST=[% c("var/cross_prefix") %]
  16. export CC=[% c("var/CC") %]
  17. ./configure --prefix=$distdir
  18. make -j[% c("num_procs") %]
  19. make -j[% c("num_procs") %] install
  20. # Only need static libraries
  21. rm -r $distdir/lib/{*.so*,pkgconfig}
  22. [% END -%]
  23. cd /var/tmp/dist
  24. [% c('tar', {
  25. tar_src => [ project ],
  26. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  27. }) %]