media-libs/shaderc: Fix build
authorNick Sarnie <sarnex@gentoo.org>
Mon, 28 Oct 2019 23:14:17 +0000 (19:14 -0400)
committerNick Sarnie <sarnex@gentoo.org>
Mon, 28 Oct 2019 23:15:47 +0000 (19:15 -0400)
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=698688
Package-Manager: Portage-2.3.78, Repoman-2.3.17
Signed-off-by: Nick Sarnie <sarnex@gentoo.org>
media-libs/shaderc/files/shaderc-2019.0-fix-build-against-new-glslang.patch [new file with mode: 0644]
media-libs/shaderc/shaderc-2019.0-r1.ebuild [moved from media-libs/shaderc/shaderc-2019.0.ebuild with 86% similarity]

diff --git a/media-libs/shaderc/files/shaderc-2019.0-fix-build-against-new-glslang.patch b/media-libs/shaderc/files/shaderc-2019.0-fix-build-against-new-glslang.patch
new file mode 100644 (file)
index 0000000..807540c
--- /dev/null
@@ -0,0 +1,54 @@
+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
similarity index 86%
rename from media-libs/shaderc/shaderc-2019.0.ebuild
rename to media-libs/shaderc/shaderc-2019.0-r1.ebuild
index 6c1e8c8b019230c92124bff313dcdefe40a170bc..b125681aee456c78bb731420151d646b8dff6bc8 100644 (file)
@@ -17,12 +17,12 @@ KEYWORDS="~amd64 ~x86"
 IUSE="doc test"
 
 RDEPEND="
-       >=dev-util/glslang-7.10[${MULTILIB_USEDEP}]
-       dev-util/spirv-tools[${MULTILIB_USEDEP}]
+       >=dev-util/glslang-7.12.3353_pre20191027[${MULTILIB_USEDEP}]
+       >=dev-util/spirv-tools-2019.10_pre20191027[${MULTILIB_USEDEP}]
 "
 DEPEND="${RDEPEND}
        ${PYTHON_DEPS}
-       dev-util/spirv-headers
+       >=dev-util/spirv-headers-1.5.1
        doc? ( dev-ruby/asciidoctor )
        test? (
                dev-cpp/gtest
@@ -33,7 +33,8 @@ DEPEND="${RDEPEND}
 # https://github.com/google/shaderc/issues/470
 RESTRICT=test
 
-PATCHES=( "${FILESDIR}/${P}-fix-glslang-link-order.patch" )
+PATCHES=("${FILESDIR}/${P}-fix-glslang-link-order.patch"
+                "${FILESDIR}/${P}-fix-build-against-new-glslang.patch" )
 
 python_check_deps() {
        if use test; then