build 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. set -e
  3. [% c("var/set_default_env") -%]
  4. [% c("var/setarch") -%]
  5. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  6. distdir="/var/tmp/dist/[% project %]"
  7. [% IF c("var/linux") -%]
  8. [% c("var/set_PTDIR_DOCSDIR") -%]
  9. mkdir -p $PTDIR
  10. [% END -%]
  11. mkdir -p /var/tmp/build
  12. tar -C /var/tmp/build -xf $rootdir/[% project %]-[% c('version') %].tar.gz
  13. cd /var/tmp/build/[% project %]-[% c('version') %]
  14. [% IF c("var/linux-i686") -%]
  15. export CFLAGS=-m32
  16. export CXXFLAGS=-m32
  17. export LDFLAGS=-m32
  18. [% END -%]
  19. [% IF c("var/windows") -%]
  20. pydir="$distdir/python"
  21. mkdir -p "$pydir"
  22. export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
  23. export LD_PRELOAD=[% c("var/faketime_path") %]
  24. # This is bogus, that we run the configure script in the build environment,
  25. # but it seems to work. https://bugs.launchpad.net/pycrypto/+bug/1096207 for
  26. # ac_cv_func_malloc_0_nonnull.
  27. ac_cv_func_malloc_0_nonnull=yes sh configure --host=i686-w64-mingw32
  28. export LD_PRELOAD=
  29. $PYTHON setup.py build_ext -c mingw32
  30. $PYTHON setup.py install --prefix=$(wine winepath -w $pydir)
  31. [% ELSE -%]
  32. export PYTHON=python2[% IF c("var/linux-i686") %].7[% END %]
  33. ./configure --build=i686-linux-gnu [% c("var/configure_opt") %]
  34. $PYTHON setup.py build --build-lib build
  35. cp -a build/Crypto $PTDIR/
  36. [% END -%]
  37. cd $distdir
  38. [% c('tar', {
  39. tar_src => [ '.' ],
  40. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  41. }) %]