File shaderc.spec of Package shaderc-moronic
#
# spec file for package shaderc-moronic
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# Remember to bump in baselibs.conf
%define lname libshaderc_moronic
Name: shaderc
Version: 20240728.feb2460
Release: 0
Summary: A collection of tools for shader compilation by morons
License: Apache-2.0
Group: Development/Tools/Other
URL: https://github.com/stenzek/duckstation/commit/59eeb892432c587f3bff0400b93c26291c61ba05
#Source: v%version.tar.gz
Source: %{name}-%{version}.tar.xz
Source99: baselibs.conf
# not only these forking changes are unbelievably retarded but the original patch
# also contains an obvious typo which breaks PCSX2 build for which it was originally created
#Patch1: shaderc-changes_duckstation.patch
Patch2: shaderc-moronicize.patch
Patch3: shaderc-Use-system-third-party-libs.patch
BuildRequires: c++_compiler
BuildRequires: cmake >= 2.8.12
BuildRequires: glslang-devel >= 14.1.0
BuildRequires: glslang-nonstd-devel
BuildRequires: python3-base
BuildRequires: spirv-headers >= 1.6.1~sdk280
BuildRequires: spirv-tools-devel >= 2024.1~rc1
%description
A collection of tools, libraries and tests for shader compilation.
Shaderc wraps around core functionality in glslang and SPIRV-Tools.
This is the broken fork by mouthbreathing morons from PCSX2 and Duckstation projects
who refuse to communicate outside of their circlejerk clique unless to throw shit at passers-by.
Of course, they also had to force dependency on it to be shared and with the same name as the original.
%package -n %lname
Summary: SPIR-V shader compiler library
Group: System/Libraries
%description -n %lname
A compiler library for GLSL/HLSL to SPIR-V.
Shaderc wraps around core functionality in glslang and SPIRV-Tools
This is the broken fork by mouthbreathing morons from PCSX2 and Duckstation projects
who refuse to communicate outside of their circlejerk clique unless to throw shit at passers-by.
Of course, they also had to force dependency on it to be shared and with the same name as the original.
%package devel-moronic
Summary: Header files for the shaderc library
Group: Development/Libraries/C and C++
Requires: %lname = %version
%description devel-moronic
A compiler library for GLSL/HLSL to SPIR-V.
Shaderc wraps around core functionality in glslang and SPIRV-Tools
This is the broken fork by mouthbreathing morons from PCSX2 and Duckstation projects
who refuse to communicate outside of their circlejerk clique unless to throw shit at passers-by.
Of course, they also had to force dependency on it to be shared and with the same name as the original.
%prep
%autosetup -p1
#setup -q
#patch -P1 -p1 -F3
#patch -P3 -p1 -F3
# can't even test his own moronic changes…
sed -i -e 's:non_sematic_debug_info:non_semantic_debug_info:g' libshaderc/include/shaderc-moronic/shaderc.hpp
chmod a+x utils/update_build_version.sh
echo "\"%version\"" >glslc/src/build-version.inc
find . -type f -exec grep -l '#!/usr/bin/env python' {} + | xargs perl -i -lpe 's{/env python\w*}{/python3}g'
%build
export CXXFLAGS="%{optflags} -I%_includedir/External"
%cmake -DSHADERC_SKIP_TESTS=ON -DSHADERC_SKIP_EXAMPLES=ON -DSHADERC_ENABLE_TESTS=OFF
%cmake_build
%install
%cmake_install
%ldconfig_scriptlets -n %lname
%files -n %lname
%_libdir/libshaderc_moronic.so*
%files devel-moronic
%_includedir/shaderc-moronic/
#_libdir/libshaderc_moronic.so
%_libdir/pkgconfig/shaderc-moronic.pc
%changelog