Blame 0ad.spec

f2d453
#
f2d453
# spec file for package 0ad
f2d453
#
ab4b0e
# Copyright (c) 2022 SUSE LLC
f2d453
#
f2d453
# All modifications and additions to the file contributed by third parties
f2d453
# remain the property of their copyright owners, unless otherwise agreed
f2d453
# upon. The license for this file, and modifications and additions to the
f2d453
# file, is the same license as for the pristine package itself (unless the
f2d453
# license for the pristine package is not an Open Source License, in which
f2d453
# case the license is the MIT License). An "Open Source License" is a
f2d453
# license that conforms to the Open Source Definition (Version 1.9)
f2d453
# published by the Open Source Initiative.
f2d453
f2d453
# Please submit bugfixes or comments via https://bugs.opensuse.org/
f2d453
#
f2d453
f2d453
f2d453
# Enable NVTT only on arch supported by nvidia-texture-tools
f2d453
%ifarch %{ix86} x86_64 ppc
f2d453
%bcond_without nvtt
f2d453
%else
f2d453
%bcond_with nvtt
f2d453
%endif
ab4b0e
ExcludeArch:    %{ix86}
b8872b
# We can use the system mozjs on Tumbleweed and Leap 15.4.
b8872b
%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400
f2d453
%bcond_without system_mozjs
f2d453
%else
f2d453
%bcond_with system_mozjs
f2d453
%endif
f2d453
# Use provided library
f2d453
%bcond_without system_nvtt
f2d453
Name:           0ad
f2d453
Version:        0.0.25b
f2d453
Release:        0
f2d453
Summary:        A real-time strategy game of ancient warfare
ab4b0e
License:        BSD-3-Clause AND CC-BY-SA-3.0 AND GPL-2.0-or-later AND LGPL-3.0-or-later AND MIT AND ISC AND MPL-2.0
f2d453
Group:          Amusements/Games/Strategy/Real Time
f2d453
URL:            https://play0ad.com/
f2d453
Source:         https://releases.wildfiregames.com/%{name}-%{version}-alpha-unix-build.tar.xz
f2d453
# PATCH-FIX-UPSTREAM
f2d453
Patch0:         avoid_duplicate_global_symbol_from_asm.patch
f2d453
# PATCH-FIX-OPENSUSE -- Disable the mozjs version check
f2d453
Patch1:         no-version-check.patch
f2d453
# PATCH-FIX-OPENSUSE -- Use the newer variant of this function (related to mozjs78 upgrade)
f2d453
Patch2:         PrepareZoneForGC.patch
b8872b
# PATCH-FIX-UPSTREAM -- Don't define M_PIf if glibc already provides it
b8872b
Patch3:         glibc-2.35.patch
f2d453
BuildRequires:  cmake
f2d453
BuildRequires:  gcc-c++
f2d453
BuildRequires:  libXcursor-devel
f2d453
BuildRequires:  libboost_filesystem-devel
f2d453
BuildRequires:  libboost_system-devel
f2d453
BuildRequires:  libjpeg-devel
f2d453
BuildRequires:  libminiupnpc-devel
f2d453
BuildRequires:  libpng-devel
f2d453
BuildRequires:  pkgconfig
f2d453
BuildRequires:  update-desktop-files
f2d453
BuildRequires:  wxWidgets-3_0-nostl-devel
f2d453
BuildRequires:  pkgconfig(IL)
f2d453
BuildRequires:  pkgconfig(fmt)
f2d453
BuildRequires:  pkgconfig(gloox)
f2d453
BuildRequires:  pkgconfig(gnutls)
f2d453
BuildRequires:  pkgconfig(icu-i18n)
f2d453
BuildRequires:  pkgconfig(libcurl)
f2d453
BuildRequires:  pkgconfig(libenet)
f2d453
BuildRequires:  pkgconfig(libidn)
f2d453
BuildRequires:  pkgconfig(libsodium) >= 1.0.13
f2d453
BuildRequires:  pkgconfig(libxml-2.0)
f2d453
BuildRequires:  pkgconfig(openal)
f2d453
BuildRequires:  pkgconfig(sdl2)
f2d453
BuildRequires:  pkgconfig(vorbis)
f2d453
BuildRequires:  pkgconfig(zlib)
f2d453
Requires:       0ad-data = %{version}
f2d453
%if %{with nvtt} && %{with system_nvtt}
f2d453
BuildRequires:  nvidia-texture-tools >= 2.1
f2d453
%endif
f2d453
%if %{with system_mozjs}
f2d453
#FIXME: Depends on source/scriptinterface/ScriptTypes.h
f2d453
# This is "fixed" by disabling the version check.
f2d453
BuildRequires:  pkgconfig(mozjs-78) >= 78.7
f2d453
%else
f2d453
BuildRequires:  cargo
f2d453
BuildRequires:  rust
f2d453
%endif
f2d453
f2d453
%description
f2d453
0 A.D. (pronounced "zero ey-dee") is a real-time strategy (RTS) game
f2d453
of ancient warfare. It is a historically-based war/economy game that
f2d453
allows players to relive or rewrite the history of Western
f2d453
civilizations, focusing on the years between 500 B.C. and 500 A.D.
f2d453
The project contains 3D graphics, detailed artwork, sound, and a
f2d453
flexible game engine.
f2d453
f2d453
%prep
f2d453
%setup -q -n %{name}-%{version}-alpha
f2d453
%patch0 -p1
b8872b
%patch3 -p1
f2d453
%if %{with system_mozjs}
f2d453
%patch1 -p1
f2d453
%patch2 -p1
f2d453
%endif
f2d453
f2d453
%build
f2d453
export CFLAGS="%{optflags}"
f2d453
# bundled Collada uses CCFLAGS
f2d453
export CCFLAGS="%{optflags}"
f2d453
export CPPFLAGS="%{optflags} -fpermissive"
f2d453
build/workspaces/update-workspaces.sh \
f2d453
    %{?_smp_mflags} \
f2d453
    --bindir=%{_bindir} \
f2d453
    --datadir=%{_datadir}/%{name} \
f2d453
    --libdir=%{_libdir}/%{name} \
f2d453
    --without-tests \
f2d453
%if %{with nvtt}
f2d453
%if %{with system_nvtt}
f2d453
    --with-system-nvtt \
f2d453
%endif
f2d453
%else
f2d453
    --without-nvtt \
f2d453
%endif
f2d453
%if %{with system_mozjs}
f2d453
    --with-system-mozjs
f2d453
%else
f2d453
export CARGO_PROFILE_RELEASE_LTO=true
f2d453
%endif
f2d453
f2d453
pushd build/workspaces/gcc
f2d453
%make_build verbose=1
f2d453
popd
f2d453
f2d453
%install
f2d453
mkdir -p %{buildroot}%{_libdir}/%{name}
f2d453
mkdir -p %{buildroot}%{_datadir}/%{name}
f2d453
# Install binaries and wrapper
f2d453
install -Dm 0755 binaries/system/ActorEditor %{buildroot}%{_bindir}/ActorEditor
f2d453
install -Dm 0755 binaries/system/pyrogenesis %{buildroot}%{_bindir}/pyrogenesis
f2d453
install -Dm 0755 build/resources/0ad.sh %{buildroot}%{_bindir}/0ad
f2d453
# Install game libraries
f2d453
install -m 0644 binaries/system/libCollada.so %{buildroot}%{_libdir}/%{name}/libCollada.so
f2d453
install -m 0644 binaries/system/libAtlasUI.so %{buildroot}%{_libdir}/%{name}/libAtlasUI.so
f2d453
# If without system mozjs we need to install the bundled one
f2d453
%if %{without system_mozjs}
f2d453
install -m 0644 binaries/system/libmozjs*-ps-release.so %{buildroot}%{_libdir}/%{name}/
f2d453
%endif
f2d453
# Install appdata
f2d453
install -Dm 0644 build/resources/0ad.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop
f2d453
install -Dm 0644 build/resources/0ad.appdata.xml %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
f2d453
install -Dm 0644 build/resources/0ad.png %{buildroot}%{_datadir}/pixmaps/%{name}.png
f2d453
f2d453
%suse_update_desktop_file %{name}
f2d453
f2d453
%files
f2d453
%doc README.txt
f2d453
%license LICENSE.txt license_gpl-2.0.txt license_lgpl-2.1.txt license_mit.txt
f2d453
%{_bindir}/0ad
f2d453
%{_bindir}/pyrogenesis
f2d453
%{_bindir}/ActorEditor
f2d453
%{_libdir}/%{name}/
f2d453
%{_datadir}/pixmaps/%{name}.png
f2d453
%{_datadir}/appdata/%{name}.appdata.xml
f2d453
%{_datadir}/applications/%{name}.desktop
f2d453
%dir %{_datadir}/%{name}
f2d453
f2d453
%changelog