%bcond_with check # Use vendor tarball %bcond_without vendor %global soname_ver 2 %global api_ver 2 %global vendor_hash 357cfe9fa3294298d82fcd1205aa9660 Name: librashader Version: 0.8.1 Release: 1%{?dist} Summary: RetroArch shaders for all License: MPL-2.0 OR GPL-3.0-only%{?with_vendor: AND ((0BSD OR MIT OR Apache-2.0) AND (Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND ((Apache-2.0 OR MIT) AND BSD-3-Clause) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND BSD-2-Clause AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND CC0-1.0 AND (CC0-1.0 OR Apache-2.0) AND (CC0-1.0 OR MIT-0 OR Apache-2.0) AND ISC AND MIT AND (MIT OR Apache-2.0) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (MIT OR Apache-2.0 OR Zlib) AND (MIT OR Zlib OR Apache-2.0) AND MPL-2.0 AND (Unlicense OR MIT) AND Zlib AND (Zlib OR Apache-2.0 OR MIT))} URL: https://github.com/SnowflakePowered/%{name} Source0: %{url}/archive/%{name}-v%{version}/%{name}-%{version}.tar.gz %if %{with vendor} # rust2rpm -t fedora -V auto --no-rpmautospec --ignore-missing-license-files --path . Source1: https://copr-dist-git.fedorainfracloud.org/repo/pkgs/phantomx/chinforpms/%{name}/%{name}-capi-%{version}-vendor.tar.xz/%{vendor_hash}/%{name}-capi-%{version}-vendor.tar.xz %endif Patch0: 0001-RPM-fixes.patch Patch1: %{name}-9909b6d.patch ExclusiveArch: %{rust_arches} BuildRequires: cargo-rpm-macros >= 26 BuildRequires: cmake BuildRequires: rust-packaging BuildRequires: gcc BuildRequires: g++ BuildRequires: make BuildRequires: patchelf BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcursor) BuildRequires: pkgconfig(xi) BuildRequires: pkgconfig(xinerama) BuildRequires: pkgconfig(xrandr) Requires: libglvnd-glx%{?_isa} Requires: vulkan-loader%{?_isa} %description %{name} is a preprocessor, compiler, and runtime for RetroArch 'slang' shaders, rewritten in pure Rust. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %prep %autosetup -n %{name}-%{name}-v%{version} -p1 %{?with_vendor:-a1} sed -e 's|_RPM_SO_VER_|%{soname_ver}|' -i include/librashader_ld.h cat > %{name}.pc <<'EOF' prefix=%{_prefix} exec_prefix=%{_exec_prefix} libdir=%{_libdir} includedir=%{_includedir}/%{name} Name: %{name} Description: RetroArch shaders for all Version: %{version} Libs: -L${libdir} -lrashader Cflags: -I${includedir} EOF %dnl sed -e '/define_opaque/d' \ %dnl -i librashader-runtime-*/src/filter_chain.rs librashader-runtime-*/src/filter_chain/chain.rs %if %{with vendor} %cargo_prep -v vendor %else %generate_buildrequires %cargo_generate_buildrequires %endif %build %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %if %{with vendor} %{cargo_vendor_manifest} %endif patchelf --set-soname librashader.so.%{soname_ver} target/release/liblibrashader_capi.so %install mkdir -p %{buildroot}/%{_libdir}/pkgconfig install -m 0755 target/release/liblibrashader_capi.so \ %{buildroot}%{_libdir}/librashader.so.%{soname_ver}.%{api_ver} ln -s librashader.so.%{soname_ver}.%{api_ver} %{buildroot}%{_libdir}/librashader.so.%{soname_ver} ln -s librashader.so.%{soname_ver} %{buildroot}%{_libdir}/librashader.so install -pm0644 %{name}.pc %{buildroot}/%{_libdir}/pkgconfig/ mkdir -p %{buildroot}%{_includedir}/%{name} install -pm0644 include/*.h %{buildroot}%{_includedir}/%{name}/ %if %{with check} %check %cargo_test %endif %files %license LICENSE-GPL.md %license LICENSE.md %license LICENSE.dependencies %doc BROKEN_SHADERS.md %doc README.md %{_libdir}/librashader.so.* %files devel %{_includedir}/%{name} %{_libdir}/librashader.so %{_libdir}/pkgconfig/%{name}.pc %changelog * Wed Jun 04 2025 Phantom X - 0.8.1-1 - 0.8.1 * Tue Apr 29 2025 Phantom X - 0.8.0-1 - 0.8.0 * Wed Feb 05 2025 Phantom X - 0.6.2-1 - 0.6.2 * Fri Nov 15 2024 Phantom X - 0.5.1-1 - 0.5.1 * Thu Sep 19 2024 Phantom X - 0.4.3-1 - 0.4.3 * Tue Apr 02 2024 Phantom X - 0.2.7-1 - Initial spec