From ece7ecab2698d44caaa5c1aa20ae1f8c83cd0dc5 Mon Sep 17 00:00:00 2001 From: Ella-0 <23418164+Ella-0@users.noreply.github.com> Date: Fri, 21 May 2021 10:41:15 +0100 Subject: [PATCH] added shaderc --- pkgs/shaderc/build.sh | 36 ++++++++++++++++++++++++++++++++++ pkgs/shaderc/third-party.patch | 23 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 pkgs/shaderc/build.sh create mode 100644 pkgs/shaderc/third-party.patch 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 +