actions.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from pisi.actionsapi import shelltools
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import get
  10. import os
  11. WorkDir = "Python-%s" % get.srcVERSION()
  12. PythonVersion = "2.7"
  13. def setup():
  14. pisitools.cflags.add("-fwrapv")
  15. # no rpath
  16. pisitools.dosed("configure.ac", "-rpath \$\(LIBDIR\) ")
  17. pisitools.dosed("Lib/cgi.py", r"/usr/local/bin/", r"/usr/bin/")
  18. pisitools.dosed("setup.py", "SQLITE_OMIT_LOAD_EXTENSION", deleteLine=True)
  19. pisitools.dosed("setup.py","ndbm_libs =.*","ndbm_libs = ['gdbm', 'gdbm_compat']")
  20. for dir in ["expat","zlib","_ctypes/libffi_arm_wince","_ctypes/libffi_msvc",
  21. "_ctypes/libffi_osx","_ctypes/libffi","_ctypes/darwin"]:
  22. shelltools.unlinkDir("Modules/%s" % dir)
  23. autotools.autoreconf("-vif")
  24. # disable bsddb
  25. pisitools.dosed("setup.py", "^(disabled_module_list = \[)\]", r"\1'_bsddb', 'dbm']")
  26. # no rpath
  27. pisitools.dosed("Lib/distutils/command/build_ext.py", "self.rpath.append\(user_lib\)", "pass")
  28. autotools.configure("--with-fpectl \
  29. --enable-shared \
  30. --enable-ipv6 \
  31. --with-threads \
  32. --with-libc='' \
  33. --enable-unicode=ucs4 \
  34. --with-wctype-functions \
  35. --with-system-expat \
  36. --with-system-ffi \
  37. --with-dbmliborder=gdbm \
  38. ")
  39. def build():
  40. autotools.make()
  41. # some tests fail. let's disable testing temporarily
  42. # def check():
  43. #autotools.make("test")
  44. def install():
  45. autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "altinstall")
  46. pisitools.dosym("/usr/bin/python%s" % PythonVersion, "/usr/bin/python")
  47. pisitools.dosym("/usr/bin/python%s-config" % PythonVersion, "/usr/bin/python-config")
  48. pisitools.dosym("/usr/lib/python%s/pdb.py" % PythonVersion, "/usr/bin/pdb")
  49. pisitools.dodoc("LICENSE", "README")