File vkquake2.spec of Package vkquake2

#
# spec file for package vkquake2
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2019-2023, Martin Hauke <mardnh@gmx.de>
#
# 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/
#


Name:           vkquake2
Version:        1.5.9
Release:        0
Summary:        Quake 2 with Vulkan support
License:        GPL-2.0-only
Group:          Amusements/Games/3D/Shoot
URL:            https://github.com/kondrak/vkQuake2
Source:         https://github.com/kondrak/vkQuake2/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM vkquake2-fix-build-with-gcc13.patch -- https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/commit/29d492b60c84ca784ea0943efc7d2e6e0f3bdaac
Patch0:         vkquake2-fix-build-with-gcc13.patch
# PATCH-FIX-UPSTREAM vkQuake2-force-c-standard-gnu99.patch -- Force C standard to gnu99 in Makefile, fixes building with gcc15
Patch1:         vkQuake2-force-c-standard-gnu99.patch
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glu)
BuildRequires:  pkgconfig(vulkan)
BuildRequires:  pkgconfig(xxf86dga)
BuildRequires:  pkgconfig(xxf86vm)
Requires:       vulkan-validationlayers

%description
Id Software's Quake 2 v3.21 with Vulkan support.
The goal is to maintain as much compatibility as possible with the original
game, so there are no fancy visual upgrades here – just pure, vanilla Quake 2
experience as we knew it back in 1997.

Note:
Game data (pak[0-2].pak) must be placed in %{_libexecdir}/vkquake2/baseq2/

%prep
%setup -q -n vkQuake2-%{version}
%patch -P 0 -p1
%patch -P 1 -p1

%build
%make_build -C linux release

%install
install -d %{buildroot}%{_libexecdir}/%{name}
mv linux/release*/* %{buildroot}%{_libexecdir}/%{name}
find %{buildroot}%{_libexecdir}/%{name} -name "*.o" | xargs rm
#
install -d %{buildroot}%{_bindir}
cat > %{buildroot}%{_bindir}/vkquake2 << EOF
#!/bin/sh
cd %{_libexecdir}/vkquake2/
./quake2 "\$@"
EOF

%files
%license LICENSE
%doc README.md
%attr(0755,root,root) %{_bindir}/vkquake2
%{_libexecdir}/%{name}

%changelog
openSUSE Build Service is sponsored by