actions.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 cmaketools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import libtools
  10. from pisi.actionsapi import get
  11. def setup():
  12. shelltools.system("sed -r 's|(CMAKE_SKIP_BUILD_RPATH) FALSE|\1 TRUE|g' -i CMakeLists.txt")
  13. shelltools.makedirs("build")
  14. shelltools.cd("build")
  15. if get.buildTYPE() != "emul32":
  16. options = "-DCMAKE_INSTALL_PREFIX=/usr \
  17. -DCMAKE_INSTALL_LIBDIR=lib"
  18. if get.buildTYPE() == "emul32":
  19. options = "-DCMAKE_INSTALL_PREFIX=/emul32 \
  20. -DCMAKE_INSTALL_LIBDIR=lib32"
  21. cmaketools.configure("-DCMAKE_BUILD_TYPE=Release \
  22. %s \
  23. -DALLOW_IN_SOURCE_BUILD=ON \
  24. -DCMAKE_JAS_ENABLE_AUTOMATIC_DEPENDENCIES=false \
  25. -DCMAKE_SKIP_INSTALL_RPATH=YES" % options, sourceDir=".." )
  26. def build():
  27. shelltools.cd("build")
  28. cmaketools.make()
  29. def install():
  30. shelltools.cd("build")
  31. cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
  32. if get.buildTYPE() == "emul32":
  33. pisitools.domove("/emul32/lib32/", "/usr/")
  34. pisitools.removeDir("/emul32")
  35. shelltools.cd("..")
  36. pisitools.dodoc("LICENSE", "README")