diff options
author | Leo <thinkabit.ukim@gmail.com> | 2019-06-27 17:21:40 -0300 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-06-28 15:18:09 +0000 |
commit | d036718feb2cfbebbcc9f72fbf57d4d56338623d (patch) | |
tree | 5af2cc1526cfac12429692b3c7086f68beb855c0 /community/shaderc | |
parent | 5e4ce4138dcdd19c0e272c9ccc354dfff63c6e74 (diff) | |
download | aports-d036718feb2cfbebbcc9f72fbf57d4d56338623d.tar.bz2 aports-d036718feb2cfbebbcc9f72fbf57d4d56338623d.tar.xz |
community/shaderc: move from testing
Diffstat (limited to 'community/shaderc')
-rw-r--r-- | community/shaderc/APKBUILD | 63 | ||||
-rw-r--r-- | community/shaderc/fix-link-order.patch | 44 |
2 files changed, 107 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" diff --git a/community/shaderc/fix-link-order.patch b/community/shaderc/fix-link-order.patch new file mode 100644 index 0000000000..f356959837 --- /dev/null +++ b/community/shaderc/fix-link-order.patch @@ -0,0 +1,44 @@ +Original upstream PR: https://github.com/google/shaderc/pull/463 + +From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001 +From: Niklas Haas <git@haasn.xyz> +Date: Tue, 29 May 2018 07:34:00 +0200 +Subject: [PATCH] Fix the link order of libglslang and libHLSL + +libglslang depends on libHLSL, so the latter needs to be specified last. +This fixes an issue when trying to build shaderc against system-wide +versions of libglslang/libHLSL, rather than the in-tree versions from +third_party. + +Additionally, libshaderc_util also depends on SPIRV-Tools +--- + glslc/CMakeLists.txt | 2 +- + libshaderc_util/CMakeLists.txt | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/glslc/CMakeLists.txt ++++ b/glslc/CMakeLists.txt +@@ -18,7 +18,7 @@ add_library(glslc STATIC + shaderc_default_compile_options(glslc) + target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR}) + target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler +- HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT}) ++ glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(glslc PRIVATE shaderc_util shaderc) + + add_executable(glslc_exe src/main.cc) +--- a/libshaderc_util/CMakeLists.txt ++++ b/libshaderc_util/CMakeLists.txt +@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL) + + find_package(Threads) + target_link_libraries(shaderc_util PRIVATE +- glslang OSDependent OGLCompiler HLSL glslang SPIRV +- SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT}) ++ glslang OSDependent OGLCompiler glslang HLSL SPIRV ++ SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT}) + + shaderc_add_tests( + TEST_PREFIX shaderc_util + + |