actions.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/usr/bin/env python3
  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 inary.actionsapi import autotools
  7. from inary.actionsapi import inarytools
  8. from inary.actionsapi import shelltools
  9. from inary.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. inarytools.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"' % (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.make("install.all 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. inarytools.remove("/usr/lib32/libGLEW.a")
  29. inarytools.dosed("%s/usr/lib32/pkgconfig/glew.pc" % get.installDIR(), "/usr/lib", "/usr/lib32")
  30. inarytools.removeDir("/emul32")
  31. return
  32. autotools.make("install.all GLEW_DEST=%s/usr/ \
  33. INCDIR=%s/usr/include/GL \
  34. BINDIR=%s/usr/bin \
  35. LIBDIR=%s/usr/lib" % (get.installDIR() , get.installDIR(), get.installDIR(), get.installDIR()))
  36. inarytools.dobin("bin/glewinfo")
  37. inarytools.dobin("bin/visualinfo")
  38. inarytools.dohtml("doc/*")
  39. inarytools.dodoc("README.md", "doc/*.txt", "LICENSE.txt")