aboutsummaryrefslogtreecommitdiffstats
path: root/community/shaderc/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/shaderc/APKBUILD')
-rw-r--r--community/shaderc/APKBUILD63
1 files changed, 63 insertions, 0 deletions
diff --git a/community/shaderc/APKBUILD b/community/shaderc/APKBUILD
new file mode 100644
index 0000000000..c5c2c72f0c
--- /dev/null
+++ b/community/shaderc/APKBUILD
@@ -0,0 +1,63 @@
+# Contributor: Leo <thinkabit.ukim@gmail.com>
+# Maintainer: Leo <thinkabit.ukim@gmail.com>
+pkgname=shaderc
+pkgver=2019.0
+pkgrel=0
+pkgdesc="A collection of tools, libraries, and tests for Vulkan shader compilation"
+options="!check" # Fails to configure when tests are enabled
+url="https://github.com/google/shaderc"
+arch="all"
+license="Apache-2.0"
+makedepends="cmake glslang-static glslang-dev spirv-tools-dev python3"
+subpackages="$pkgname-static $pkgname-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/google/shaderc/archive/v${pkgver}.tar.gz
+ fix-link-order.patch
+ "
+
+prepare() {
+ default_prepare
+ # Unbundle glslang, SPIRV-Headers and SPIRV-Tools, also don't build examples
+ sed -i \
+ -e '/add_subdirectory(third_party)/d' \
+ -e '/add_subdirectory(examples)/d' CMakeLists.txt
+
+ # Disable git versioning
+ sed -i -e '/build-version/d' glslc/CMakeLists.txt
+
+ # Create our own build-version.inc since we disabled git versioning
+ # need to keep this in sync with glslang and SPIRV-Tools versions
+ # this is displayed with 'glslc --version'
+ cat <<- EOF > glslc/src/build-version.inc
+ "shaderc 2019.0\n"
+ "SPIRV-Tools-2019.3\n"
+ "glslang-7.11.3214\n"
+ EOF
+
+ mkdir -p "$builddir"/build
+}
+
+build() {
+ cd build
+
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DBUILD_SHARED_LIBS=True \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DSHADERC_SKIP_TESTS=ON \
+ -DSHADERC_ENABLE_NV_EXTENSIONS=OFF \
+ ${CMAKE_CROSSOPTS} ..
+ make
+}
+
+package() {
+ make -C build DESTDIR="$pkgdir" install
+}
+
+sha512sums="c76887ad0a96145211b6550b0dfe63091df9e1463f9a3140aba2d1982c33e98ad14fb4bcf9ce2281433fc77626fc892c268d0636b9f348a159dd06e3f41b461a shaderc-2019.0.tar.gz
+bd24c90b93bf8bd7e56682e02543ff8a5c988549e76502144c2f4904e96b67ca0bc9d1e94b811bcdad1e765625256d3feabeb20ca299f2abb220e6e398d5a590 fix-link-order.patch"