actions.py 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. # Licensed under the GNU General Public License, version 3.
  4. # See the file http://www.gnu.org/copyleft/gpl.txt
  5. from pisi.actionsapi import get
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. def setup():
  10. #shelltools.system("echo -e '\033[0;36mBuilding Bzip2\033[0m' ")
  11. #shelltools.makedirs("%s/temp/lib" %get.workDIR())
  12. #shelltools.cd("bzip2-1.0.8")
  13. #autotools.make('CC=%s AR=%s RANLIB=%s CFLAGS="%s -D_FILE_OFFSET_BITS=64 -fPIC" libbz2.a' % (get.CC(), get.AR(), get.RANLIB(), get.CFLAGS()))
  14. #shelltools.system("cp libbz2.a %s/temp/lib/libbz2.a" % get.workDIR())
  15. #shelltools.cd("..")
  16. pisitools.flags.add("-fwrapv")
  17. pisitools.dosed("Lib/cgi.py","^#.* /usr/local/bin/python","#!/usr/bin/python")
  18. shelltools.unlinkDir("Modules/expat")
  19. #shelltools.unlinkDir("Modules/zlib")
  20. shelltools.unlinkDir("Modules/_ctypes/darwin")
  21. #shelltools.unlinkDir("Modules/_ctypes/libffi")
  22. #shelltools.unlinkDir("Modules/_ctypes/libffi_msvc")
  23. shelltools.unlinkDir("Modules/_ctypes/libffi_osx")
  24. # shelltools.unlinkDir("Modules/_decimal/libmpdec")
  25. #shelltools.export("CFLAGS", "-I%s/temp/include -O3" %get.workDIR())
  26. #shelltools.export("LDFLAGS", "-L%s/temp/lib -lbz2 -lpthread -ldl" %get.workDIR())
  27. # fix unused direct dependency analysis
  28. autotools.rawConfigure("LDSHARED='x86_64-pc-linux-gnu-gcc -Wl,-O1,--as-needed -shared -lpthread'\
  29. --prefix=/usr \
  30. --enable-shared \
  31. --with-computed-gotos \
  32. --enable-ipv6 \
  33. --with-system-expat \
  34. --with-dbmliborder=gdbm:ndbm \
  35. --with-system-ffi \
  36. --enable-loadable-sqlite-extensions \
  37. --without-ensurepip")
  38. # --with-system-libmpdec \
  39. def build():
  40. autotools.make()
  41. def install():
  42. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  43. pisitools.remove("/usr/bin/2to3")
  44. pisitools.dodoc("LICENSE", "README.*")
  45. pisitools.removeDir("/usr/lib/python3.11/idlelib")
  46. pisitools.removeDir("/usr/lib/python3.11/tkinter")
  47. pisitools.removeDir("/usr/lib/python3.11/turtledemo")
  48. pisitools.remove("/usr/bin/idle3*")
  49. # pisitools.remove("/usr/lib/libpython3.11.a")