diff --git a/pkgs/shaderc/build.sh b/pkgs/shaderc/build.sh new file mode 100644 index 0000000..2c1b320 --- /dev/null +++ b/pkgs/shaderc/build.sh @@ -0,0 +1,36 @@ +pkgname=shaderc +pkgver=main + +fetch() { + curl -L "https://github.com/google/shaderc/archive/refs/heads/main.tar.gz" -o $pkgname-$pkgver.tar.xz + tar -xf $pkgname-$pkgver.tar.xz + cp ../third-party.patch . + mkdir $pkgname-$pkgver/build + cd $pkgname-$pkgver + patch -p1 < ../third-party.patch + echo \"$pkgver\" > glslc/src/build-version.inc +} + +build() { + cd $pkgname-$pkgver + cd build + cmake -G Ninja ../ \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DSHADERC_SKIP_TESTS=ON \ + -Dglslang_SOURCE_DIR=/usr/include/glslang + samu +} + +package() { + cd $pkgname-$pkgver + cd build + DESTDIR=$pkgdir samu install +} + +license() { + cd $pkgname-$pkgver + cat LICENSE +# cat COPYING +} diff --git a/pkgs/shaderc/third-party.patch b/pkgs/shaderc/third-party.patch new file mode 100644 index 0000000..5ad5dfd --- /dev/null +++ b/pkgs/shaderc/third-party.patch @@ -0,0 +1,23 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -92,7 +92,6 @@ endif(MSVC) + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) + + if(SHADERC_ENABLE_SPVC) + add_subdirectory(libshaderc_spvc) +@@ -103,11 +102,6 @@ add_subdirectory(libshaderc) + add_subdirectory(glslc) + add_subdirectory(examples) + +-add_custom_target(build-version +- ${PYTHON_EXECUTABLE} +- ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py +- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc +- COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") + + function(define_pkg_config_file NAME LIBS) + add_custom_target(${NAME}-pkg-config ALL +