actions.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.system("python3 ./utils/git-sync-deps")
  12. shelltools.system("sed '/examples/d;/third_party/d' -i CMakeLists.txt")
  13. shelltools.system("sed '/build-version/d' -i glslc/CMakeLists.txt")
  14. # shelltools.system("cat <<- EOF > glslc/src/build-version.inc")
  15. cmaketools.configure("-B build \
  16. -GNinja \
  17. -DCMAKE_BUILD_TYPE=Release \
  18. -DCMAKE_INSTALL_PREFIX=/usr \
  19. -DSHADERC_SKIP_TESTS=ON \
  20. -Dglslang_SOURCE_DIR=/usr/include/glslang \
  21. -DPYTHON_EXECUTABLE=python3")
  22. def build():
  23. shelltools.system("ninja -C build")
  24. def install():
  25. shelltools.system("DESTDIR=%s ninja -C build install" % get.installDIR())
  26. # pisitools.removeDir("/usr/include/spirv-tools")
  27. # pisitools.removeDir("/usr/lib/cmake")
  28. # pisitools.remove("/usr/lib/libSPIRV-Tools*")
  29. # pisitools.remove("/usr/lib/pkgconfig/SPIRV*")
  30. # pisitools.remove("/usr/bin/spirv*")
  31. pisitools.dodoc("AUTHORS", "LICENSE", "CONTRIBUTORS*", "README*")