summaryrefslogtreecommitdiff
path: root/shaderc
diff options
context:
space:
mode:
authorDanny Rawlins <monster.romster@gmail.com>2019-04-20 11:48:32 +1000
committerDanny Rawlins <monster.romster@gmail.com>2019-04-20 11:58:48 +1000
commite3971b7e71c9e75cf9c56beb2e668f07badede15 (patch)
tree173de95e7afd4698bd21935ee514e1509d271e32 /shaderc
parent3729a0573fdb1e25a8b68413537e2cbde63aa0a5 (diff)
downloadcontrib-e3971b7e71c9e75cf9c56beb2e668f07badede15.tar.gz
contrib-e3971b7e71c9e75cf9c56beb2e668f07badede15.tar.xz
shaderc: initial import
Diffstat (limited to 'shaderc')
-rw-r--r--shaderc/.footprint13
-rw-r--r--shaderc/.signature6
-rw-r--r--shaderc/Pkgfile44
-rw-r--r--shaderc/fix-glslang-link-order.patch44
4 files changed, 107 insertions, 0 deletions
diff --git a/shaderc/.footprint b/shaderc/.footprint
new file mode 100644
index 000000000..7bc39dedb
--- /dev/null
+++ b/shaderc/.footprint
@@ -0,0 +1,13 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/glslc
+drwxr-xr-x root/root usr/include/
+drwxr-xr-x root/root usr/include/shaderc/
+-rw-r--r-- root/root usr/include/shaderc/shaderc.h
+-rw-r--r-- root/root usr/include/shaderc/shaderc.hpp
+drwxr-xr-x root/root usr/lib/
+-rw-r--r-- root/root usr/lib/libshaderc.a
+-rw-r--r-- root/root usr/lib/libshaderc_combined.a
+lrwxrwxrwx root/root usr/lib/libshaderc_shared.so -> libshaderc_shared.so.1
+-rwxr-xr-x root/root usr/lib/libshaderc_shared.so.1
+-rw-r--r-- root/root usr/lib/libshaderc_util.a
diff --git a/shaderc/.signature b/shaderc/.signature
new file mode 100644
index 000000000..b04f06758
--- /dev/null
+++ b/shaderc/.signature
@@ -0,0 +1,6 @@
+untrusted comment: verify with /etc/ports/contrib.pub
+RWSagIOpLGJF371GTbgUPufTmR0tFTdyAtBaRo56fn/dzuwcNV/oi25B63Dbe2fRYEbYunpABNFH/qMHZdXY/oXF/kLGsyBxTAk=
+SHA256 (Pkgfile) = 18eb6194163dd19914ed1ddf5aa5c78e4a234f8d20bbf82739238f40dd3266f9
+SHA256 (.footprint) = da2cc5a9f214dd43b006db6f17cc4fdbdaeef2703bf9e2d5480feb69ff1ca9e9
+SHA256 (shaderc-v2018.0.tar.gz) = b96f27e7375a6df08732ebd47c18febf82bd0a87e541fd7814fd8c3aa6c8913a
+SHA256 (fix-glslang-link-order.patch) = 986a972d8b8fbfa750e92b750673108c4ae77af47acdc4dbb684358e2600a4ea
diff --git a/shaderc/Pkgfile b/shaderc/Pkgfile
new file mode 100644
index 000000000..15a0dc889
--- /dev/null
+++ b/shaderc/Pkgfile
@@ -0,0 +1,44 @@
+# Description: Collection of tools, libraries and tests for shader compilation.
+# URL: https://github.com/google/shaderc
+# Maintainer: Danny Rawlins, crux at romster dot me
+# Depends on: glslang ninja
+
+name=shaderc
+version=2018.0
+release=1
+source=(https://github.com/google/$name/archive/v$version/$name-v$version.tar.gz
+ fix-glslang-link-order.patch)
+
+build() {
+ cd $name-$version
+
+ patch -p1 -i $SRC/fix-glslang-link-order.patch
+
+ # de-vendor libs and disable git versioning
+ sed '/examples/d;/third_party/d' -i CMakeLists.txt
+ sed '/build-version/d' -i glslc/CMakeLists.txt
+ cat <<- EOF > glslc/src/build-version.inc
+"${pkgver}\\n"
+"$(prt-get info spirv-tools | awk '/^Version:/ {print $2}')\\n"
+"$(prt-get info glslang | awk '/^Version:/ {print $2}')\\n"
+EOF
+
+ mkdir build
+ cd build
+
+ cmake .. \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DSHADERC_SKIP_TESTS=ON \
+ -GNinja \
+ -DSHADERC_ENABLE_NV_EXTENSIONS=OFF # Currently requires glslang-git
+
+ ninja -j ${JOBS:-1}
+
+ DESTDIR=$PKG ninja install
+
+ #cd ../glslc
+ #asciidoctor -b manpage README.asciidoc -o glslc.1
+ #install -D -m 0644 -t $PKG/usr/share/man/man1 glslc/glslc.1
+}
diff --git a/shaderc/fix-glslang-link-order.patch b/shaderc/fix-glslang-link-order.patch
new file mode 100644
index 000000000..a404c8583
--- /dev/null
+++ b/shaderc/fix-glslang-link-order.patch
@@ -0,0 +1,44 @@
+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(-)
+
+diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
+index acf6fb0b..0f5d8886 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 873540ab..6d0c465c 100644
+--- 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

Generated by cgit