[packages/shaderc] - initial
qboosh
qboosh at pld-linux.org
Fri Oct 26 22:25:50 CEST 2018
commit 5153f5613b1c8e18afacfdf47fcae8b351d3896e
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Fri Oct 26 22:29:26 2018 +0200
- initial
shaderc-shared.patch | 32 ++++++++++++
shaderc-system-libs.patch | 58 ++++++++++++++++++++++
shaderc.spec | 124 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 214 insertions(+)
---
diff --git a/shaderc.spec b/shaderc.spec
new file mode 100644
index 0000000..1c4fab3
--- /dev/null
+++ b/shaderc.spec
@@ -0,0 +1,124 @@
+# TODO: glslc docs using asciidoctor
+Summary: Collection of tools, libraries and tests for shader compilation
+Summary(pl.UTF-8): Zestaw narzędzi, bibliotek i testów do kompilacji shaderów
+Name: shaderc
+# 2018.0 requires glslang >= 201803xx
+#Version: 2018.0
+Version: 0
+%define snap 20180209
+%define gitref d1f763cc3742b93f0fc090493be8ba0588f296da
+Release: 0.%{snap}.1
+License: Apache v2.0
+Group: Libraries
+#Source0Download: https://github.com/google/shaderc/releases
+Source0: https://github.com/google/shaderc/archive/%{gitref}/%{name}-%{snap}.tar.gz
+# Source0-md5: 95a05fcd88a242b2f391cf5d165171be
+#Source0: https://github.com/google/shaderc/archive/v%{version}/%{name}-%{version}.tar.gz
+Patch0: %{name}-system-libs.patch
+Patch1: %{name}-shared.patch
+URL: https://github.com/google/shaderc
+# for docs
+#BuildRequires: asciidoctor
+BuildRequires: cmake >= 2.8.12
+BuildRequires: glslang-devel >= 3.0.s20180205
+BuildRequires: python >= 2
+BuildRequires: spirv-tools
+BuildRequires: spirv-tools-devel >= v2018.1-0.s20180210
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+A collection of tools, libraries and tests for shader compilation. At
+the moment it includes:
+ - glslc, a command line compiler for GLSL/HLSL to SPIR-V, and
+ - libshaderc, a library API for doing the same.
+
+Shaderc wraps around core functionality in glslang and SPIRV-Tools.
+Shaderc aims to to provide:
+ - a command line compiler with GCC- and Clang-like usage, for better
+ integration with build systems
+ - an API where functionality can be added without breaking existing
+ clients
+ - an API supporting standard concurrency patterns across multiple
+ operating systems
+ - increased functionality such as file #include support
+
+%description -l pl.UTF-8
+Zestaw narzędzi, bibliotek i testów do kompilacji shaderów. Obecnie
+zawiera:
+ - glslc - kompilator linii poleceń dla GLSL/HLSL do SPIR-V
+ - libshaderc - biblioteka do tego samego
+
+Shaderc obudowuje podstawową funkcjonalność glslang i SPIRV-Tools.
+Celem shaderc jest zapewnienie:
+ - kompilatora linii poleceń używalnego podobnie do GCC czy Clang
+ (w celu lepszej integracji z systemami budowania)
+ - API, do którego można dodawać funkcjonalność bez psucia
+ istniejących klientów
+ - API obsługującego standardowe wzorce współbieżności na wielu
+ systemach operacyjnych
+ - zwiększonej funkcjonalności, np. obsługi #include
+
+%package devel
+Summary: Header files for shaderc library
+Summary(pl.UTF-8): Pliki nagłówkowe biblioteki shaderc
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Header files for shaderc library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki shaderc.
+
+%package static
+Summary: Static shaderc libraries
+Summary(pl.UTF-8): Statyczne biblioteki shaderc
+Group: Development/Libraries
+Requires: %{name}-devel = %{version}-%{release}
+
+%description static
+Static shaderc libraries.
+
+%description static -l pl.UTF-8
+Statyczne biblioteki shaderc.
+
+%prep
+%setup -q -n %{name}-%{gitref}
+%patch0 -p1
+%patch1 -p1
+
+%build
+install -d build
+cd build
+%cmake .. \
+ -DSHADERC_SKIP_TESTS=ON
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -p /sbin/ldconfig
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS CHANGES CONTRIBUTORS README.md glslc/README.asciidoc
+%attr(755,root,root) %{_bindir}/glslc
+%attr(755,root,root) %{_libdir}/libshaderc.so
+
+%files devel
+%defattr(644,root,root,755)
+%{_includedir}/shaderc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libshaderc.a
+%{_libdir}/libshaderc_combined.a
+%{_libdir}/libshaderc_util.a
diff --git a/shaderc-shared.patch b/shaderc-shared.patch
new file mode 100644
index 0000000..7d3dafa
--- /dev/null
+++ b/shaderc-shared.patch
@@ -0,0 +1,32 @@
+--- shaderc-d1f763cc3742b93f0fc090493be8ba0588f296da/libshaderc/CMakeLists.txt.orig 2018-10-26 20:30:58.662584981 +0200
++++ shaderc-d1f763cc3742b93f0fc090493be8ba0588f296da/libshaderc/CMakeLists.txt 2018-10-26 21:20:56.322550754 +0200
+@@ -15,6 +15,7 @@
+ target_include_directories(shaderc PUBLIC include PRIVATE ${glslang_SOURCE_DIR})
+
+ add_library(shaderc_shared SHARED ${SHADERC_SOURCES})
++set_target_properties(shaderc_shared PROPERTIES OUTPUT_NAME shaderc)
+ shaderc_default_compile_options(shaderc_shared)
+ target_include_directories(shaderc_shared PUBLIC include PRIVATE ${glslang_SOURCE_DIR})
+ target_compile_definitions(shaderc_shared
+--- shaderc-d1f763cc3742b93f0fc090493be8ba0588f296da/glslc/CMakeLists.txt.orig 2018-02-26 19:23:46.000000000 +0100
++++ shaderc-d1f763cc3742b93f0fc090493be8ba0588f296da/glslc/CMakeLists.txt 2018-10-26 21:22:00.139216692 +0200
+@@ -17,15 +17,13 @@
+
+ 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})
+-target_link_libraries(glslc PRIVATE shaderc_util shaderc)
++target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../libshaderc_util/include)
++target_link_libraries(glslc PRIVATE shaderc_shared ${CMAKE_THREAD_LIBS_INIT})
+
+ add_executable(glslc_exe src/main.cc)
+ shaderc_default_compile_options(glslc_exe)
+-target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${spirv-tools_SOURCE_DIR}/include)
++target_include_directories(glslc_exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../libshaderc_util/include ${CMAKE_CURRENT_SOURCE_DIR}/../libshaderc/include ${spirv-tools_SOURCE_DIR}/include)
+ set_target_properties(glslc_exe PROPERTIES OUTPUT_NAME glslc)
+-target_link_libraries(glslc_exe PRIVATE glslc shaderc_util shaderc)
++target_link_libraries(glslc_exe PRIVATE glslc shaderc_shared shaderc_util SPIRV-Tools)
+ add_dependencies(glslc_exe build-version)
+
+ shaderc_add_tests(
diff --git a/shaderc-system-libs.patch b/shaderc-system-libs.patch
new file mode 100644
index 0000000..fa08760
--- /dev/null
+++ b/shaderc-system-libs.patch
@@ -0,0 +1,58 @@
+--- shaderc-3c85d2636607054666a0966486ea78e3a553b209/CMakeLists.txt.orig 2017-05-16 19:32:41.000000000 +0200
++++ shaderc-3c85d2636607054666a0966486ea78e3a553b209/CMakeLists.txt 2017-05-30 21:41:43.451874678 +0200
+@@ -46,7 +46,8 @@
+
+ # Configure subdirectories.
+ # We depend on these for later projects, so they should come first.
+-add_subdirectory(third_party)
++set(glslang_SOURCE_DIR /usr/include/glslang)
++set(spirv-tools_SOURCE_DIR /usr)
+
+ add_subdirectory(libshaderc_util)
+ add_subdirectory(libshaderc)
+@@ -57,5 +57,5 @@
+ add_custom_target(build-version
+ ${PYTHON_EXE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py
+- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR}
++ ${shaderc_SOURCE_DIR}
+ COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).")
+--- shaderc-3c85d2636607054666a0966486ea78e3a553b209/glslc/test/CMakeLists.txt.orig 2017-05-16 19:32:41.000000000 +0200
++++ shaderc-3c85d2636607054666a0966486ea78e3a553b209/glslc/test/CMakeLists.txt 2017-05-30 21:50:42.181868527 +0200
+@@ -5,6 +5,6 @@
+ add_test(NAME glslc_tests
+ COMMAND ${PYTHON_EXE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/glslc_test_framework.py
+- $<TARGET_FILE:glslc_exe> $<TARGET_FILE:spirv-dis>
++ $<TARGET_FILE:glslc_exe> spirv-dis
+ --test-dir ${CMAKE_CURRENT_SOURCE_DIR})
+ endif()
+--- shaderc-3c85d2636607054666a0966486ea78e3a553b209/utils/update_build_version.py.orig 2017-05-16 19:32:41.000000000 +0200
++++ shaderc-3c85d2636607054666a0966486ea78e3a553b209/utils/update_build_version.py 2017-05-30 21:58:02.445196831 +0200
+@@ -113,12 +113,12 @@
+
+
+ def main():
+- if len(sys.argv) != 4:
+- print('usage: {} <shaderc-dir> <spirv-tools-dir> <glslang-dir>'.format(
++ if len(sys.argv) != 2:
++ print('usage: {} <shaderc-dir>'.format(
+ sys.argv[0]))
+ sys.exit(1)
+
+- projects = ['shaderc', 'spirv-tools', 'glslang']
++ projects = ['shaderc']
+ new_content = ''.join([
+ '"{}\\n"\n'.format(get_version_string(p, d))
+ for (p, d) in zip(projects, sys.argv[1:])
+--- shaderc-d1f763cc3742b93f0fc090493be8ba0588f296da/libshaderc/CMakeLists.txt.orig 2018-10-26 20:30:19.875918754 +0200
++++ shaderc-d1f763cc3742b93f0fc090493be8ba0588f296da/libshaderc/CMakeLists.txt 2018-10-26 20:30:36.765918565 +0200
+@@ -37,7 +37,7 @@
+
+ find_package(Threads)
+ set(SHADERC_LIBS
+- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT}
++ glslang OSDependent OGLCompiler HLSL glslang ${CMAKE_THREAD_LIBS_INIT}
+ shaderc_util
+ SPIRV # from glslang
+ SPIRV-Tools
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/shaderc.git/commitdiff/5153f5613b1c8e18afacfdf47fcae8b351d3896e
More information about the pld-cvs-commit
mailing list