diff options
author | Leo <thinkabit.ukim@gmail.com> | 2020-02-27 10:22:03 -0300 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-02-27 22:44:39 -0300 |
commit | 443f4644ae1d2003cfe2b03f4eb4a2bc9514449f (patch) | |
tree | 779f95ba0ddafb44bf43978c44c197cf416cbdcc /community/shaderc | |
parent | ebc102a48ad19dc82b0d32c777b3b8778c6ef519 (diff) | |
download | aports-443f4644ae1d2003cfe2b03f4eb4a2bc9514449f.tar.bz2 aports-443f4644ae1d2003cfe2b03f4eb4a2bc9514449f.tar.xz |
community/shaderc: upgrade to 2019.1
Diffstat (limited to 'community/shaderc')
-rw-r--r-- | community/shaderc/APKBUILD | 41 | ||||
-rw-r--r-- | community/shaderc/enum.patch | 23 | ||||
-rw-r--r-- | community/shaderc/fix-build.patch | 55 | ||||
-rw-r--r-- | community/shaderc/fix-includes.patch | 74 | ||||
-rw-r--r-- | community/shaderc/third-party.patch | 24 |
5 files changed, 141 insertions, 76 deletions
diff --git a/community/shaderc/APKBUILD b/community/shaderc/APKBUILD index bcc42b901b..8933b39dc3 100644 --- a/community/shaderc/APKBUILD +++ b/community/shaderc/APKBUILD @@ -1,8 +1,8 @@ # Contributor: Leo <thinkabit.ukim@gmail.com> # Maintainer: Leo <thinkabit.ukim@gmail.com> pkgname=shaderc -pkgver=2019.0 -pkgrel=2 +pkgver=2019.1 +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" @@ -12,38 +12,35 @@ 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 - fix-build.patch + enum.patch + third-party.patch + fix-includes.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 + rm -rf third_party + + _glslang_ver="$( . $startdir/../../*/glslang/APKBUILD; echo $pkgver)" + _spirv_ver="$( . $startdir/../../*/spirv-tools/APKBUILD; echo $pkgver)" # 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" + "shaderc $pkgver\n" + "SPIRV-Tools $_spirv_ver\n" + "glslang $_glslang_ver\n" EOF - - mkdir -p "$builddir"/build } build() { - cd build - + export CXXFLAGS="$CXXFLAGS -I/usr/include/glslang" if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi - cmake \ + cmake -B build . \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DBUILD_SHARED_LIBS=True \ @@ -52,14 +49,16 @@ build() { -DCMAKE_C_FLAGS="$CFLAGS" \ -DSHADERC_SKIP_TESTS=ON \ -DSHADERC_ENABLE_NV_EXTENSIONS=OFF \ - ${CMAKE_CROSSOPTS} .. - make + $CMAKE_CROSSOPTS + make -C build } package() { make -C build DESTDIR="$pkgdir" install } -sha512sums="c76887ad0a96145211b6550b0dfe63091df9e1463f9a3140aba2d1982c33e98ad14fb4bcf9ce2281433fc77626fc892c268d0636b9f348a159dd06e3f41b461a shaderc-2019.0.tar.gz +sha512sums="dc4d617a6619fa6f743827fbec4065e51190e5516fbef59c7fb450740732524fc81ad22ad60a58488d84b45f24e459b71922e37fa05b4c06e0ddd0b59d46c315 shaderc-2019.1.tar.gz bd24c90b93bf8bd7e56682e02543ff8a5c988549e76502144c2f4904e96b67ca0bc9d1e94b811bcdad1e765625256d3feabeb20ca299f2abb220e6e398d5a590 fix-link-order.patch -b0231c8e39b9755444d74855d79f9aa0aad038c652a83f8c316d2e75cf7084a775151e6ecd367340a92c568f86b9e89112338fcd0b37976e383db6a0f8ff5952 fix-build.patch" +d09a23d98278cdef6535c189fc331f092ac185f444ce673a5ea8acba06b791ca8565188ee33d4ec2ec0bd4d1852dc00523fdfdff93b89ff8013b4a745a71cac9 enum.patch +5c5171ef2561070fece6b4cfa087f5baace7e5f828443719570494d9adc39ad724a414da7570f38629dbc9e7b563c8ad8226143c907ce7139a87615098006585 third-party.patch +07e4662de3049157d82cd5283c1831c136ff033bf91daea24c655012916f0b21dd4a8ae10f9b0200e904957495617731c8433dd168e687e7daeafe27d8924a41 fix-includes.patch" diff --git a/community/shaderc/enum.patch b/community/shaderc/enum.patch new file mode 100644 index 0000000000..c4fe9629b5 --- /dev/null +++ b/community/shaderc/enum.patch @@ -0,0 +1,23 @@ +From 3d99fad173cc0c00d370eeb6663784fc67efd480 Mon Sep 17 00:00:00 2001 +From: David Neto <dneto@google.com> +Date: Fri, 24 Jan 2020 15:41:21 -0500 +Subject: [PATCH] Handle new Glslang profile enum in switch (#973) + +* Handle new Glslang profile enum in switch +--- + libshaderc/src/shaderc.cc | 1 + + 1 files changed, 1 insertions(+), 0 deletion(-) + +diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc +index abbab548..fe57c76b 100644 +--- a/libshaderc/src/shaderc.cc ++++ b/libshaderc/src/shaderc.cc +@@ -779,6 +779,7 @@ bool shaderc_parse_version_profile(const char* str, int* version, + *profile = shaderc_profile_none; + return true; + case EBadProfile: ++ case EProfileCount: + return false; + } + + diff --git a/community/shaderc/fix-build.patch b/community/shaderc/fix-build.patch deleted file mode 100644 index a1a06b4435..0000000000 --- a/community/shaderc/fix-build.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc -index 3c3c3de..b5fc6cb 100644 ---- a/libshaderc/src/shaderc.cc -+++ b/libshaderc/src/shaderc.cc -@@ -20,7 +20,7 @@ - #include <sstream> - #include <vector> - --#include "SPIRV/spirv.hpp" -+#include "glslang/SPIRV/spirv.hpp" - - #include "libshaderc_util/compiler.h" - #include "libshaderc_util/counting_includer.h" -diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc -index ef7867f..acc172b 100644 ---- a/libshaderc_util/src/compiler.cc -+++ b/libshaderc_util/src/compiler.cc -@@ -26,7 +26,7 @@ - #include "libshaderc_util/string_piece.h" - #include "libshaderc_util/version_profile.h" - --#include "SPIRV/GlslangToSpv.h" -+#include "glslang/SPIRV/GlslangToSpv.h" - - namespace { - using shaderc_util::string_piece; -@@ -291,17 +291,12 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile( - bases[static_cast<int>(UniformKind::StorageBuffer)]); - shader.setShiftUavBinding( - bases[static_cast<int>(UniformKind::UnorderedAccessView)]); -- shader.setHlslIoMapping(hlsl_iomap_); - shader.setResourceSetBinding( - hlsl_explicit_bindings_[static_cast<int>(used_shader_stage)]); - shader.setEnvClient(target_client_info.client, - target_client_info.client_version); - shader.setEnvTarget(target_client_info.target_language, - target_client_info.target_language_version); -- if (hlsl_functionality1_enabled_) { -- shader.setEnvTargetHlslFunctionality1(); -- } -- - const EShMessages rules = GetMessageRules(target_env_, source_language_, - hlsl_offsets_, - generate_debug_info_); -@@ -478,9 +473,6 @@ std::tuple<bool, std::string, std::string> Compiler::PreprocessShader( - } - shader.setEnvClient(target_client_info.client, - target_client_info.client_version); -- if (hlsl_functionality1_enabled_) { -- shader.setEnvTargetHlslFunctionality1(); -- } - - // The preprocessor might be sensitive to the target environment. - // So combine the existing rules with the just-give-me-preprocessor-output - diff --git a/community/shaderc/fix-includes.patch b/community/shaderc/fix-includes.patch new file mode 100644 index 0000000000..a96dc681f7 --- /dev/null +++ b/community/shaderc/fix-includes.patch @@ -0,0 +1,74 @@ +From eb3e5917134ec42590e6a27dea7b75b870b22d38 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com> +Date: Sun, 2 Feb 2020 23:03:53 +0100 +Subject: [PATCH] Fix SPIRV includes location +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +SPIRV includes have been moved under glslang/ in the latest version. + +Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com> +--- + libshaderc/src/shaderc.cc | 2 +- + libshaderc/src/shaderc_cpp_test.cc | 2 +- + libshaderc/src/shaderc_test.cc | 2 +- + libshaderc_util/src/compiler.cc | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc +index fe57c76..82c47ef 100644 +--- a/libshaderc/src/shaderc.cc ++++ b/libshaderc/src/shaderc.cc +@@ -20,7 +20,7 @@ + #include <sstream> + #include <vector> + +-#include "SPIRV/spirv.hpp" ++#include "glslang/SPIRV/spirv.hpp" + + #include "libshaderc_util/compiler.h" + #include "libshaderc_util/counting_includer.h" +diff --git a/libshaderc/src/shaderc_cpp_test.cc b/libshaderc/src/shaderc_cpp_test.cc +index 407d8f4..addb347 100644 +--- a/libshaderc/src/shaderc_cpp_test.cc ++++ b/libshaderc/src/shaderc_cpp_test.cc +@@ -18,7 +18,7 @@ + #include <thread> + #include <unordered_map> + +-#include "SPIRV/spirv.hpp" ++#include "glslang/SPIRV/spirv.hpp" + #include "spirv-tools/libspirv.hpp" + + #include "common_shaders_for_test.h" +diff --git a/libshaderc/src/shaderc_test.cc b/libshaderc/src/shaderc_test.cc +index a54b87c..cab5224 100644 +--- a/libshaderc/src/shaderc_test.cc ++++ b/libshaderc/src/shaderc_test.cc +@@ -18,7 +18,7 @@ + #include <thread> + #include <unordered_map> + +-#include "SPIRV/spirv.hpp" ++#include "glslang/SPIRV/spirv.hpp" + + #include "common_shaders_for_test.h" + #include "shaderc/shaderc.h" +diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc +index 1809eab..a485b12 100644 +--- a/libshaderc_util/src/compiler.cc ++++ b/libshaderc_util/src/compiler.cc +@@ -19,7 +19,7 @@ + #include <sstream> + #include <tuple> + +-#include "SPIRV/GlslangToSpv.h" ++#include "glslang/SPIRV/GlslangToSpv.h" + #include "libshaderc_util/format.h" + #include "libshaderc_util/io.h" + #include "libshaderc_util/message.h" +-- +2.24.1 + + diff --git a/community/shaderc/third-party.patch b/community/shaderc/third-party.patch new file mode 100644 index 0000000000..6d4c1df495 --- /dev/null +++ b/community/shaderc/third-party.patch @@ -0,0 +1,24 @@ +diff -up shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt.orig shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt +--- shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt.orig 2020-01-22 21:15:53.000000000 +0100 ++++ shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt 2020-02-02 21:06:15.193583552 +0100 +@@ -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 + |