File gardens-of-kadesh.spec of Package gardens-of-kadesh
#
# spec file for package gardens-of-kadesh
#
# Copyright (c) 2025 Boian Berberov
#
# 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/
#
%global gitrev %{version}
Name: gardens-of-kadesh
Version: 1.2.0
Release: 0%{?dist}
Summary: SDL port of the Homeworld 1 source code
License: NonFree
URL: https://%{name}.gitlab.io/
%if %{undefined gitrev}
Source0: https://gitlab.com/%{name}/%{name}/-/archive/%{version}/%{name}-%{version}.tar.gz
%else
Source0: %{name}-%{gitrev}.tar.gz
%endif
BuildRequires: meson >= 0.60
BuildRequires: pkgconfig
%if 0%{?fedora}
BuildRequires: libasan
BuildRequires: libubsan
%endif
%if 0%{?mageia}
BuildRequires: libasan-devel
BuildRequires: libubsan-devel
%endif
BuildRequires: pkgconfig(gl)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavformat)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(x11)
# tools/kas2c
BuildRequires: bison
BuildRequires: flex
%description
Source port of Homeworld 1 to modern systems (Linux, Windows, macOS, and web browsers). Homeworld is a 3D space real-time strategy game released in 1999. It's source code was released in 2003 by Relic Entertainment, allowing a small but dedicated community of fans to port it to SDL, enabling native versions for Linux, MacOS, and more recently, web browsers.
%prep
%if %{undefined gitrev}
%setup -q
%else
%setup -q -n %{name}-%{gitrev}
%endif
%__sed -i \
-e 's/HW_GAME_HOMEWORLD/HW_GAME_DEMO/' \
meson.build
echo "FLAGS: %optflags"
%if 40 < 0%{?fedora} || 9 < 0%{?mageia}
%__sed -i \
-e '/-Werror/d' \
meson.build
%endif
%build
%if 42 < 0%{?fedora} || 9 < 0%{?mageia}
%meson --buildtype release -D demo=true -D movies=false -D b_sanitize=none
%else
%meson --buildtype release -D demo=true -D movies=false -D b_sanitize=none
%endif
%meson_build
%install
%meson_install
%files
%license LICENSE.txt
%{_bindir}/homeworld
%changelog
* Wed Jul 23 2025 Boian Berberov
- Initial package