2022-10-23 11:28:09 +00:00
|
|
|
# Glslang revision from packaged version
|
2023-11-02 16:18:59 +00:00
|
|
|
%global glslang_version 066853941a3f097b6196f452dde42c0cbf7f98f4
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
Name: shaderc
|
2023-11-02 16:18:59 +00:00
|
|
|
Version: 2023.7
|
2021-07-25 15:31:36 +00:00
|
|
|
Release: %autorelease
|
2023-06-22 06:36:04 +00:00
|
|
|
Summary: Collection of tools, libraries, and tests for Vulkan shader compilation
|
2018-10-02 16:08:23 +00:00
|
|
|
|
2022-10-23 11:34:38 +00:00
|
|
|
License: Apache-2.0
|
2018-10-02 16:08:23 +00:00
|
|
|
URL: https://github.com/google/shaderc
|
2023-06-22 06:36:04 +00:00
|
|
|
Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
2018-10-02 16:08:23 +00:00
|
|
|
# Patch to unbundle 3rd party code
|
2023-06-22 06:36:04 +00:00
|
|
|
Patch: 0001-Drop-third-party-code-in-CMakeLists.txt.patch
|
|
|
|
Patch: glslang_linker_flags.patch
|
2018-10-02 16:08:23 +00:00
|
|
|
|
2023-06-22 06:36:04 +00:00
|
|
|
BuildRequires: cmake
|
2018-10-02 16:08:23 +00:00
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: ninja-build
|
2023-06-22 06:36:04 +00:00
|
|
|
BuildRequires: sed
|
|
|
|
BuildRequires: spirv-tools
|
|
|
|
|
2018-10-02 16:08:23 +00:00
|
|
|
BuildRequires: glslang-devel
|
2023-06-22 06:36:04 +00:00
|
|
|
BuildRequires: python3-devel
|
2018-10-02 16:08:23 +00:00
|
|
|
BuildRequires: spirv-headers-devel
|
|
|
|
BuildRequires: spirv-tools-devel
|
|
|
|
|
|
|
|
%description
|
2019-06-10 15:51:37 +00:00
|
|
|
A collection of tools, libraries and tests for shader compilation.
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
Shaderc aims to to provide:
|
2019-06-10 15:51:37 +00:00
|
|
|
- a command line compiler with GCC- and Clang-like usage, for better
|
2018-10-02 16:08:23 +00:00
|
|
|
integration with build systems
|
|
|
|
- an API where functionality can be added without breaking existing clients
|
2019-06-10 15:51:37 +00:00
|
|
|
- an API supporting standard concurrency patterns across multiple
|
2018-10-02 16:08:23 +00:00
|
|
|
operating systems
|
|
|
|
- increased functionality such as file #include support
|
|
|
|
|
|
|
|
%package -n glslc
|
|
|
|
Summary: A command line compiler for GLSL/HLSL to SPIR-V
|
|
|
|
|
|
|
|
%description -n glslc
|
|
|
|
A command line compiler for GLSL/HLSL to SPIR-V.
|
|
|
|
|
|
|
|
%package -n libshaderc
|
|
|
|
Summary: A library for compiling shader strings into SPIR-V
|
|
|
|
|
|
|
|
%description -n libshaderc
|
|
|
|
A library for compiling shader strings into SPIR-V.
|
|
|
|
|
|
|
|
%package -n libshaderc-devel
|
|
|
|
Summary: Development files for libshaderc
|
|
|
|
Requires: libshaderc%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description -n libshaderc-devel
|
|
|
|
A library for compiling shader strings into SPIR-V.
|
|
|
|
|
|
|
|
Development files for libshaderc.
|
|
|
|
|
|
|
|
%package -n libshaderc-static
|
|
|
|
Summary: A library for compiling shader strings into SPIR-V (static libraries)
|
|
|
|
|
|
|
|
%description -n libshaderc-static
|
|
|
|
A library for compiling shader strings into SPIR-V.
|
|
|
|
|
|
|
|
Static libraries for libshaderc.
|
|
|
|
|
|
|
|
%prep
|
2023-06-22 06:36:04 +00:00
|
|
|
%autosetup -p1
|
2018-10-02 16:08:23 +00:00
|
|
|
|
2023-06-22 06:36:04 +00:00
|
|
|
rm -r third_party
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
# Stolen from Gentoo
|
2019-06-10 15:51:37 +00:00
|
|
|
# Create build-version.inc since we want to use our packaged
|
2018-10-02 16:08:23 +00:00
|
|
|
# SPIRV-Tools and glslang
|
2023-02-16 01:29:31 +00:00
|
|
|
sed -i -e '/build-version/d' glslc/CMakeLists.txt
|
2020-06-17 19:21:06 +00:00
|
|
|
echo \"shaderc $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\? [[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}$' CHANGES)\" \
|
2018-10-02 16:08:23 +00:00
|
|
|
> glslc/src/build-version.inc
|
2020-06-17 19:21:06 +00:00
|
|
|
echo \"spirv-tools $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\? [[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}$' /usr/share/doc/spirv-tools/CHANGES)\" \
|
2018-10-02 16:08:23 +00:00
|
|
|
>> glslc/src/build-version.inc
|
2020-06-17 19:21:06 +00:00
|
|
|
echo \"glslang %{glslang_version}\" >> glslc/src/build-version.inc
|
|
|
|
|
|
|
|
# Point to correct include
|
|
|
|
sed -i 's|SPIRV/GlslangToSpv.h|glslang/SPIRV/GlslangToSpv.h|' libshaderc_util/src/compiler.cc
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
# We disable the tests because they don't work with our unbundling of 3rd party.
|
|
|
|
# See https://github.com/google/shaderc/issues/470
|
2023-06-22 06:36:04 +00:00
|
|
|
%cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
-DCMAKE_SKIP_RPATH=True \
|
|
|
|
-DSHADERC_SKIP_TESTS=True \
|
|
|
|
-DPYTHON_EXE=%{python3} \
|
|
|
|
-GNinja
|
|
|
|
%cmake_build
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
%install
|
2023-06-22 06:36:04 +00:00
|
|
|
%cmake_install
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
%check
|
2023-06-22 06:36:04 +00:00
|
|
|
%ctest
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
%files -n glslc
|
|
|
|
%doc glslc/README.asciidoc
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/glslc
|
|
|
|
|
|
|
|
%files -n libshaderc
|
|
|
|
%doc AUTHORS CHANGES CONTRIBUTORS README.md
|
|
|
|
%license LICENSE
|
|
|
|
%{_libdir}/libshaderc_shared.so.1*
|
|
|
|
|
|
|
|
%files -n libshaderc-devel
|
|
|
|
%{_includedir}/%{name}/
|
|
|
|
%{_libdir}/libshaderc_shared.so
|
2019-06-10 15:51:37 +00:00
|
|
|
%{_libdir}/pkgconfig/shaderc.pc
|
2018-10-02 16:08:23 +00:00
|
|
|
|
|
|
|
%files -n libshaderc-static
|
|
|
|
%license LICENSE
|
|
|
|
%{_libdir}/libshaderc.a
|
|
|
|
%{_libdir}/libshaderc_combined.a
|
2019-06-10 15:51:37 +00:00
|
|
|
%{_libdir}/pkgconfig/shaderc_static.pc
|
|
|
|
%{_libdir}/pkgconfig/shaderc_combined.pc
|
|
|
|
|
2018-10-02 16:08:23 +00:00
|
|
|
%changelog
|
2021-07-25 15:31:36 +00:00
|
|
|
%autochangelog
|