build 981 B

123456789101112131415161718192021222324252627
  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. [% IF c("var/osname") == "linux-i686" -%]
  9. export CC='gcc -m32'
  10. [% END %]
  11. [% IF c("var/osx") -%]
  12. # Tricking OpenSSL into using our clang as cross-compiler
  13. ln -s $clangdir/bin/clang $clangdir/bin/x86_64-apple-darwin-cc
  14. export CC="cc [% c("var/FLAGS") %]"
  15. patch -p1 < $rootdir/0001-Revert-apple-getentropy-removal.patch
  16. [% END -%]
  17. export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
  18. ./Configure [% c('var/configure_opts') %]
  19. make
  20. make DESTDIR="$distdir" install
  21. cd /var/tmp/dist
  22. ln -s '[% c("var/openssldir") %]' openssl/openssl
  23. [% c('tar', {
  24. tar_src => [ project ],
  25. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  26. }) %]