actions.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 pisitools
  8. from pisi.actionsapi import shelltools
  9. from pisi.actionsapi import get
  10. def setup():
  11. shelltools.makedirs("build")
  12. shelltools.cd("build")
  13. options = "-DCMAKE_INSTALL_PREFIX=/usr \
  14. -DCMAKE_INSTALL_SYSCONFDIR=/etc \
  15. -DCMAKE_INSTALL_DATADIR=/usr/share \
  16. -DCMAKE_BUILD_TYPE=Release \
  17. "
  18. if get.buildTYPE() == "_emul32":
  19. shelltools.export("ASFLAGS", "--32")
  20. shelltools.export("CFLAGS", "-m32")
  21. shelltools.export("CXXFLAGS", "-m32")
  22. shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")
  23. options += " -DCMAKE_INSTALL_LIBDIR=lib32 \
  24. "
  25. cmaketools.configure(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. shelltools.cd("..")
  33. pisitools.dodoc("LICENSE.md", "README*")