actions.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/usr/bin/env 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 cmaketools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import autotools
  10. from pisi.actionsapi import get
  11. libdir = "/usr/lib32" if get.buildTYPE() == "emul32" else "/usr/lib"
  12. def setup():
  13. pisitools.dosed("CMakeLists.txt", "{CMAKE_INSTALL_DATADIR}", "{CMAKE_INSTALL_LIBDIR}")
  14. #shelltools.export("CC", "clang")
  15. #shelltools.export("CXX", "clang++")
  16. if get.buildTYPE() == "emul32":
  17. pisitools.cflags.add("-m32 ")
  18. pisitools.cxxflags.add("-m32")
  19. shelltools.system("chmod +x clang32")
  20. options = "-DLLVM_CLANG='%s/%s-%s.src/clang32' \
  21. -DLLVM_CONFIG='/usr/bin/llvm-config-32' \
  22. -DLLVM_SPIRV='/usr/bin/llvm-spirv' \
  23. -DCMAKE_INSTALL_LIBDIR=lib32 \
  24. " % (get.workDIR(), get.srcNAME(), get.srcVERSION())
  25. else:
  26. pisitools.cflags.add("-m64 ")
  27. pisitools.cxxflags.add("-m64")
  28. options = "-DLLVM_CLANG='/usr/bin/clang' \
  29. -DLLVM_CONFIG='/usr/bin/llvm-config' \
  30. -DLLVM_SPIRV='/usr/bin/llvm-spirv' \
  31. -DCMAKE_INSTALL_LIBDIR=lib \
  32. "
  33. cmaketools.configure(options)
  34. def build():
  35. cmaketools.make()
  36. def install():
  37. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  38. #pisitools.domove("/usr/share/clc/", "%s" %libdir)
  39. #pisitools.domove("/usr/share/pkgconfig/libclc.pc", "%s/pkgconfig" % libdir)
  40. if get.buildTYPE() == "emul32":
  41. shelltools.system("sed -i 's/\/usr\/share/\/usr\/lib32/' %s/usr/lib32/pkgconfig/libclc.pc" % get.installDIR())
  42. else:
  43. shelltools.system("sed -i 's/\/usr\/share/\/usr\/lib/' %s/usr/lib/pkgconfig/libclc.pc" % get.installDIR())
  44. #pisitools.removeDir("/usr/share/clc")
  45. #pisitools.removeDir("/usr/share/pkgconfig")
  46. pisitools.dodoc("LICENSE*", "README*")