build 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. set -e
  3. [% c("var/set_default_env") -%]
  4. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  5. distdir="/var/tmp/dist/[% project %]"
  6. mkdir -p $distdir
  7. WINEROOT=$HOME/.wine/drive_c
  8. wine wineboot -i
  9. wine msiexec /qn /i python-[% c("version") %].msi TARGETDIR=$distdir
  10. sed -i 's/self.dll_libraries = get_msvcr()/pass#self.dll_libraries = get_msvcr()/g' $distdir/Lib/distutils/cygwinccompiler.py
  11. tar xf setuptools-*.tar.gz
  12. rm setuptools-*.tar.gz
  13. cd setuptools-*
  14. wine $distdir/python.exe setup.py install
  15. cd $rootdir
  16. 7z x $rootdir/py2exe-*.exe
  17. cp -a PLATLIB/* $distdir/Lib/site-packages/
  18. export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
  19. export LD_PRELOAD=[% c("var/faketime_path") %]
  20. cd wine-wrappers
  21. # Push our config into wine-wrappers.
  22. > settings.py
  23. echo "LD_PRELOAD = \"$LD_PRELOAD\"" >> settings.py
  24. echo "FAKETIME = \"$FAKETIME\"" >> settings.py
  25. # Must pre-copy python27.dll into the build directory, or else py2exe can't find it.
  26. mkdir -p build/bdist.win32/winexe/bundle-2.7/
  27. cp -a $distdir/python27.dll build/bdist.win32/winexe/bundle-2.7/
  28. LD_PRELOAD= wine $distdir/python.exe setup.py py2exe
  29. mkdir -p $distdir/wineroot/windows/
  30. cp -a dist/gcc.exe dist/g++.exe dist/dllwrap.exe $distdir/wineroot/windows/
  31. cp $rootdir/pyc-timestamp.sh $distdir/
  32. cd $distdir/..
  33. [% c('tar', {
  34. tar_src => [ project, 'mingw-w64' ],
  35. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  36. }) %]