actions.py 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file https://www.gnu.org/licenses/gpl-3.0.txt
  6. from pisi.actionsapi import autotools
  7. from pisi.actionsapi import pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import get
  10. def build():
  11. shelltools.system("sed -i 's|lib64|lib|' config/Makefile.linux")
  12. shelltools.system("sed -i '/^.PHONY: .*\.pc$/d' Makefile")
  13. if get.buildTYPE() == "emul32":
  14. pisitools.dosed("config/Makefile.linux", "LD = cc", "LD = gcc -m32")
  15. shelltools.system("sed -i 's|lib64|lib32|' config/Makefile.linux")
  16. autotools.make('CC="%s -m32" CXXFLAGS="%s" LIBDIR=/usr/lib32' % (get.CC(), get.CXXFLAGS()))
  17. return
  18. else:
  19. autotools.make('CC=%s CXXFLAGS="%s"' % (get.CC(), get.CXXFLAGS()))
  20. return
  21. def install():
  22. if get.buildTYPE() == "emul32":
  23. autotools.rawInstall("GLEW_DEST=%s/usr/ \
  24. INCDIR=%s/emul32 \
  25. BINDIR=%s/emul32 \
  26. LIBDIR=%s/usr/lib32 \
  27. PKGDIR=%s/usr/lib32/pkgconfig" % (get.installDIR() , get.installDIR(), get.installDIR(), get.installDIR(), get.installDIR()))
  28. pisitools.remove("/usr/lib32/libGLEW.a")
  29. #pisitools.dosed("%s/usr/lib32/pkgconfig/glew.pc" % get.installDIR(), "/usr/lib", "/usr/lib32")
  30. return
  31. autotools.rawInstall("GLEW_DEST=%s/usr/ \
  32. INCDIR=%s/usr/include/GL \
  33. BINDIR=%s/usr/bin \
  34. LIBDIR=%s/usr/lib" % (get.installDIR() , get.installDIR(), get.installDIR(), get.installDIR()))
  35. pisitools.dobin("bin/glewinfo")
  36. pisitools.dobin("bin/visualinfo")
  37. pisitools.dohtml("doc/*")
  38. pisitools.dodoc("README.md", "doc/*.txt", "LICENSE.txt")