actions.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 cmaketools
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import get
  11. def setup():
  12. shelltools.copy("INSTALL/make.inc.gfortran", "make.inc")
  13. if get.ARCH() == "x86_64":
  14. pisitools.dosed("make.inc", "-O2", "%s -fPIC -m64 -funroll-all-loops" % get.CFLAGS())
  15. pisitools.dosed("make.inc", "NOOPT =", "NOOPT =-m64 -fPIC ")
  16. else:
  17. pisitools.dosed("make.inc", "-O2", "%s -fPIC -funroll-all-loops" % get.CFLAGS())
  18. shelltools.makedirs("build")
  19. shelltools.cd("build")
  20. options = "-DCMAKE_INSTALL_LIBDIR=lib \
  21. -DBUILD_SHARED_LIBS=ON \
  22. -DBUILD_TESTING=OFF"
  23. if get.buildTYPE() == "static":
  24. options = "-DCMAKE_INSTALL_LIBDIR=lib \
  25. -DBUILD_SHARED_LIBS=OFF \
  26. -DBUILD_TESTING=OFF"
  27. cmaketools.configure(options, sourceDir="..")
  28. def build():
  29. shelltools.cd("build")
  30. cmaketools.make()
  31. def install():
  32. shelltools.cd("build")
  33. cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
  34. shelltools.cd("../")
  35. pisitools.dodoc("LICENSE", "README.md")