summaryrefslogtreecommitdiff
path: root/media-libs/shaderc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-11-03 16:06:58 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-11-03 16:06:58 +0000
commitbd4aeefe33e63f613512604e47bfca7b2187697d (patch)
treeadb35b5a9a00ee7ea591ab0c987f70167c23b597 /media-libs/shaderc
parent48ece6662cbd443015f5a57ae6d8cbdbd69ef37c (diff)
gentoo resync : 03.11.2019
Diffstat (limited to 'media-libs/shaderc')
-rw-r--r--media-libs/shaderc/Manifest6
-rw-r--r--media-libs/shaderc/files/shaderc-2019.0-fix-build-against-new-glslang.patch54
-rw-r--r--media-libs/shaderc/files/shaderc-2019.0-fix-glslang-link-order.patch26
-rw-r--r--media-libs/shaderc/metadata.xml11
-rw-r--r--media-libs/shaderc/shaderc-2019.0-r1.ebuild86
5 files changed, 178 insertions, 5 deletions
diff --git a/media-libs/shaderc/Manifest b/media-libs/shaderc/Manifest
index f37ce44ad894..b739d91798ae 100644
--- a/media-libs/shaderc/Manifest
+++ b/media-libs/shaderc/Manifest
@@ -1,4 +1,8 @@
AUX shaderc-2018.0-fix-glslang-link-order.patch 1059 BLAKE2B e8985d1de7f6e425eabbd05201aeff854304fe227f2a83878ed41e5494e71742d46c49b86aa97c3a9b364909f5d6adcc2a3aed21128935febbc7765b90b2f2b3 SHA512 09a61e04dd68674d159c69a497ce412b924967d595526a54693e1999345fd45c88999b5e793b5bfd21a0a555b535d89d1611c44a76f81e1ce308bff821c86f87
+AUX shaderc-2019.0-fix-build-against-new-glslang.patch 2158 BLAKE2B df0c6cc0067ca6b8e2a10e890b7b006680856fa3df2565df3da97759c45445606530e81eee46b1d576d8cdb43b4a84c3241fcd14828c769d418c72f880402c25 SHA512 96d2e6a67a8c38e374b56b16936574e374592eec6b38b2a4fd35ae80419298196a849bfbacc5bf7f1b6175c417ead469b18d2c196147119e490556d49eebc89f
+AUX shaderc-2019.0-fix-glslang-link-order.patch 1030 BLAKE2B 281fc55196762ffbc08daa63a401e13330719c50f9e0f5f30199f9fc96c3c00148eb3a6efb0f4e083eea0a53a19a3f65e0f3e52d995356279a18cf8596029bb3 SHA512 c4fbc5db2a40adc45cdb470c1fc09f65bee38b1f46da84a47c60db3ba081b536539f40567c28111fb598fe6a6ba47602cff3b2835247460d08bab5d5e3ea28c4
DIST shaderc-2018.0.tar.gz 206013 BLAKE2B b45fb6e959f621566817f8e31b1947e479b6ea392eb64f334dca9ad24cc4e8b736dd236e634de3f96342f48d8138722a2b769efb9db65025def5ed59bf5b911b SHA512 7a420fde73c9f2aae3f13558d538a1f4ae43bba19e2b4d2da8fbbd017e9e4f328ece5f330f1bbcb9fe84c91b7eb84b9158dc2e3d144c82939090a0fa6f5b4ef0
+DIST shaderc-2019.0.tar.gz 232620 BLAKE2B 53fd0967fe22e5a89783fccb485dc07c31a18eb328c6cf7244349714c6774d1877c1fbae0b8ffcf47d189f1e0c5f2d501f027ff3aa05bdd59950d49a4084e9b5 SHA512 c76887ad0a96145211b6550b0dfe63091df9e1463f9a3140aba2d1982c33e98ad14fb4bcf9ce2281433fc77626fc892c268d0636b9f348a159dd06e3f41b461a
EBUILD shaderc-2018.0.ebuild 1982 BLAKE2B 65f9c467b19222fc0d74454ae5564fe9f807cf4ec03f204b1dea7cef0c3898146b690771787953be671b9adcd4d77624a56ab209cd91055edf89b54914af202f SHA512 89ec6b3a50cff8021cf51eea7c11ac6c106f6e6a9bf0fae44ef881749ece590660947a86bd358089c87ea3c623f4f5268602241f16ccd9885fef10e3caf7af20
-MISC metadata.xml 246 BLAKE2B 1b5ed67f52168f632fd290d848b5cff1b99d79ce844a73d99fec57c671b0788d9e7c83b9e657a8a7172f89cbf0728bb7f3d8016db2e3575f686e60dabafef941 SHA512 ed75da45f240a95d52b0b1d6164e68c174c8083997636a3ddae0ee8c7b1921b18d09a8da0e7fe289b829e076f4d914828e830428aebe82d3274ee83aa44e98dc
+EBUILD shaderc-2019.0-r1.ebuild 2091 BLAKE2B 02f511ed0dbc836471ce55ffa74b72bd299e3f26a8322168f4c385de47f9329be32ddf2f14c4dda11411c43e70ac4e8be69a85e86de602d0c8c1fbc03b26244b SHA512 51353ec7681d2e4a1c85a6cdb2adc428b885ad49faf9ccdb85b0ec478218cbb3e203669235567baa34f97550e4c1bd2d9d00bd9a375099866c2f5be4b2a21fbf
+MISC metadata.xml 335 BLAKE2B 295aaacdd867834ddc93fd5f52a7d5c50b14a63936e4f97f5cba62d7ddc47fda07dc620203f6e27adf01d8df13b5d9c2b0f5621a0d21bb53f8b846b78023ddfa SHA512 f9b82e65002f90c0e253b712ac3a11c483a3d7bb1750d46f3d8bf4de577927421e6e1cb3c3403afb89a8168e02e9b3736cc21adf6994827a17a82b237a8973a5
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
index 000000000000..807540cf62a2
--- /dev/null
+++ b/media-libs/shaderc/files/shaderc-2019.0-fix-build-against-new-glslang.patch
@@ -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
diff --git a/media-libs/shaderc/files/shaderc-2019.0-fix-glslang-link-order.patch b/media-libs/shaderc/files/shaderc-2019.0-fix-glslang-link-order.patch
new file mode 100644
index 000000000000..660d1bf8dfd3
--- /dev/null
+++ b/media-libs/shaderc/files/shaderc-2019.0-fix-glslang-link-order.patch
@@ -0,0 +1,26 @@
+diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
+index acf6fb0..0f5d888 100644
+--- 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)
+diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
+index f8ae95d..069c48a 100644
+--- a/libshaderc_util/CMakeLists.txt
++++ b/libshaderc_util/CMakeLists.txt
+@@ -32,7 +32,7 @@ add_definitions(-DENABLE_HLSL)
+
+ find_package(Threads)
+ target_link_libraries(shaderc_util PRIVATE
+- glslang OSDependent OGLCompiler HLSL glslang SPIRV
++ glslang OSDependent OGLCompiler glslang SPIRV HLSL
+ SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
+
+ shaderc_add_tests(
diff --git a/media-libs/shaderc/metadata.xml b/media-libs/shaderc/metadata.xml
index d71aaf4a995a..b63343c6be5b 100644
--- a/media-libs/shaderc/metadata.xml
+++ b/media-libs/shaderc/metadata.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <!-- maintainer-needed -->
- <upstream>
- <remote-id type="github">google/shaderc</remote-id>
- </upstream>
+ <maintainer type="person">
+ <email>sarnex@gentoo.org</email>
+ <name>Nick Sarnie</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">google/shaderc</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/media-libs/shaderc/shaderc-2019.0-r1.ebuild b/media-libs/shaderc/shaderc-2019.0-r1.ebuild
new file mode 100644
index 000000000000..a1cb035a3150
--- /dev/null
+++ b/media-libs/shaderc/shaderc-2019.0-r1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{3_5,3_6,3_7} )
+
+inherit cmake-multilib python-any-r1
+
+DESCRIPTION="Collection of tools, libraries and tests for shader compilation"
+HOMEPAGE="https://github.com/google/shaderc"
+SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc test"
+
+RDEPEND="
+ >=dev-util/glslang-7.12.3353_pre20191027-r1[${MULTILIB_USEDEP}]
+ >=dev-util/spirv-tools-2019.10_pre20191027[${MULTILIB_USEDEP}]
+"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ >=dev-util/spirv-headers-1.5.1
+ doc? ( dev-ruby/asciidoctor )
+ test? (
+ dev-cpp/gtest
+ $(python_gen_any_dep 'dev-python/nose[${PYTHON_USEDEP}]')
+ )
+"
+
+# https://github.com/google/shaderc/issues/470
+RESTRICT=test
+
+PATCHES=("${FILESDIR}/${P}-fix-glslang-link-order.patch"
+ "${FILESDIR}/${P}-fix-build-against-new-glslang.patch" )
+
+python_check_deps() {
+ if use test; then
+ has_version --host-root "dev-python/nose[${PYTHON_USEDEP}]"
+ fi
+}
+
+src_prepare() {
+ cmake_comment_add_subdirectory examples
+
+ # Unbundle glslang, spirv-headers, spirv-tools
+ cmake_comment_add_subdirectory third_party
+ sed -i \
+ -e "s|\$<TARGET_FILE:spirv-dis>|${EPREFIX}/usr/bin/spirv-dis|" \
+ glslc/test/CMakeLists.txt || die
+
+ # Disable git versioning
+ sed -i -e '/build-version/d' glslc/CMakeLists.txt || die
+
+ # Manually create build-version.inc as we disabled git versioning
+ cat <<- EOF > glslc/src/build-version.inc || die
+ "${P}\n"
+ "$(best_version dev-util/spirv-tools)\n"
+ "$(best_version dev-util/glslang)\n"
+ EOF
+
+ cmake-utils_src_prepare
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DSHADERC_SKIP_TESTS="$(usex !test)"
+ )
+ cmake-utils_src_configure
+}
+
+multilib_src_compile() {
+ if multilib_is_native_abi && use doc; then
+ cmake-utils_src_make glslc_doc_README
+ fi
+ cmake-utils_src_compile
+}
+
+multilib_src_install() {
+ if multilib_is_native_abi; then
+ use doc && local HTML_DOCS=( "${BUILD_DIR}/glslc/README.html" )
+ fi
+ cmake-utils_src_install
+}