actions.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. options = "-B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
  12. -DWITH_JPEG8=TRUE \
  13. -DENABLE_STATIC=FALSE \
  14. -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib \
  15. "
  16. if get.buildTYPE() == "emul32":
  17. shelltools.export("CC", "gcc -m32")
  18. shelltools.export("CXX", "g++ -m32")
  19. shelltools.export("PKG_CONFIG_PATH","/usr/lib32/pkgconfig")
  20. options += " -DCMAKE_INSTALL_DEFAULT_LIBDIR=/usr/lib32 \
  21. -DCMAKE_INSTALL_PREFIX=/emul32"
  22. else:
  23. options += " -DCMAKE_INSTALL_PREFIX=/usr"
  24. cmaketools.configure(options)
  25. def build():
  26. shelltools.system("cmake --build build -v")
  27. # cmaketools.make("--build -C build -v")
  28. # def check():
  29. # shelltools.cd("build")
  30. # cmaketools.make("test")
  31. def install():
  32. # shelltools.cd("build")
  33. shelltools.system("DESTDIR=%s cmake --install build -v" % get.installDIR())
  34. # cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
  35. if get.buildTYPE() == "emul32":
  36. pisitools.removeDir("/emul32")
  37. pisitools.dosed("%s/usr/lib32/pkgconfig/*.pc" % get.installDIR(), "emul32", "usr")
  38. pisitools.dosed("%s/usr/lib32/cmake/libjpeg-turbo/*.cmake" % get.installDIR(), "emul32", "usr")
  39. return
  40. # provide jpegint.h as it is required by various software
  41. #pisitools.insinto("/usr/lib/include", "jpegint.h")
  42. pisitools.insinto("/usr/include", "jpegint.h")