shaderc/shaderc.spec

123 lines
3.8 KiB
RPMSpec

# Glslang revision from packaged version
%global glslang_version ca8d07d0bc1c6390b83915700439fa7719de6a2a
Name: shaderc
Version: 2023.7
Release: 1mamba
Summary: A collection of tools, libraries, and tests for Vulkan shader compilation
Group: System/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/google/shaderc
Source: https://github.com/google/shaderc.git/v%{version}/shaderc-%{version}.tar.bz2
Patch0: shaderc-2023.6-Drop-third-party-code-in-CMakeLists.txt.patch
Patch1: shaderc-2023.6-glslang_linker_flags.patch
License: Apache License 2.0
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libglslang-devel
BuildRequires: libspirv-tools-devel
BuildRequires: libstdc++6-devel
## AUTOBUILDREQ-END
BuildRequires: libglslang-devel >= 13.0.0-1mamba
BuildRequires: cmake
BuildRequires: spirv-headers
BuildRequires: libspirv-tools-devel
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
%description
A collection of tools, libraries, and tests for Vulkan shader compilation.
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
%description -n lib%{name}
This package contains shared libraries for %{name}.
%package -n lib%{name}-devel
Group: Development/Libraries
Summary: Development files for %{name}
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: pkg-config
%description -n lib%{name}-devel
This package contains libraries and header files for developing applications that use %{name}.
%debug_package
%prep
%setup -q
%patch 0 -p1 -b .Drop-third-party-code-in-CMakeLists.txt
%patch 1 -p1 -b .glslang_linker_flags
rm -r third_party
# Stolen from Gentoo
# Create build-version.inc since we want to use our packaged
# SPIRV-Tools and glslang
sed -i -e '/build-version/d' glslc/CMakeLists.txt
echo \"shaderc $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\? [[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}$' CHANGES)\" \
> glslc/src/build-version.inc
echo \"spirv-tools $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\? [[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}$' /usr/share/doc/spirv-tools/CHANGES)\" \
>> glslc/src/build-version.inc
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
%build
%cmake -d build \
-Wno-dev \
-DCMAKE_SKIP_RPATH=True \
-DSHADERC_SKIP_TESTS=True \
-DPYTHON_EXE=%{__python310} \
-GNinja
ninja
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
DESTDIR=%{buildroot} ninja -C build install
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/glslc
%files -n lib%{name}
%defattr(-,root,root)
%{_libdir}/libshaderc_shared.so.*
%doc AUTHORS LICENSE
%files -n lib%{name}-devel
%defattr(-,root,root)
%dir %{_includedir}/shaderc
%{_includedir}/shaderc/*
%{_libdir}/libshaderc.a
%{_libdir}/libshaderc_combined.a
%{_libdir}/libshaderc_shared.so
%{_libdir}/pkgconfig/shaderc.pc
%{_libdir}/pkgconfig/shaderc_combined.pc
%{_libdir}/pkgconfig/shaderc_static.pc
%doc CHANGES README.md
%changelog
* Sat Oct 14 2023 Automatic Build System <autodist@mambasoft.it> 2023.7-1mamba
- automatic version update by autodist
* Thu Aug 31 2023 Automatic Build System <autodist@mambasoft.it> 2023.6-2mamba
- rebuilt by autoport with build requirements: libglslang-devel>=13.0.0-1mamba
* Sun Aug 20 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 2023.6-1mamba
- package created using the webbuild interface