From 59db4d7cd93c831aa0153efc88f75d2810f593085d03c83d99c1bc03006fc130 Mon Sep 17 00:00:00 2001 From: Aaron Puchert Date: Fri, 20 Dec 2024 23:52:32 +0000 Subject: [PATCH] NOTE: This is untested! Reason for change: wxWidgets-3_0 is slated for retirement. - Replace wxWidgets-3_0-nostl-devel with wxWidgets-devel BuildRequires. OBS-URL: https://build.opensuse.org/package/show/games/0ad?expand=0&rev=140 --- .gitattributes | 23 + .gitignore | 1 + 0ad-0.0.26-alpha-unix-build.tar.xz | 3 + 0ad-link-icu-76.patch | 20 + 0ad.changes | 434 +++++++++++++++++++ 0ad.spec | 182 ++++++++ PrepareZoneForGC.patch | 19 + _constraints | 11 + avoid_duplicate_global_symbol_from_asm.patch | 31 ++ fix-boost-1.85-build.patch | 22 + fix-fmt10-build.patch | 48 ++ fix-gcc13-build.patch | 13 + no-version-check.patch | 19 + premake-no-automatic-rpath.patch | 46 ++ 14 files changed, 872 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0ad-0.0.26-alpha-unix-build.tar.xz create mode 100644 0ad-link-icu-76.patch create mode 100644 0ad.changes create mode 100644 0ad.spec create mode 100644 PrepareZoneForGC.patch create mode 100644 _constraints create mode 100644 avoid_duplicate_global_symbol_from_asm.patch create mode 100644 fix-boost-1.85-build.patch create mode 100644 fix-fmt10-build.patch create mode 100644 fix-gcc13-build.patch create mode 100644 no-version-check.patch create mode 100644 premake-no-automatic-rpath.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0ad-0.0.26-alpha-unix-build.tar.xz b/0ad-0.0.26-alpha-unix-build.tar.xz new file mode 100644 index 0000000..d90ddeb --- /dev/null +++ b/0ad-0.0.26-alpha-unix-build.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e1c6df7e3312e77c5f82788664cffc3a78d3bf60606c00039275e1d13c0ee4b +size 75599800 diff --git a/0ad-link-icu-76.patch b/0ad-link-icu-76.patch new file mode 100644 index 0000000..ee6a97d --- /dev/null +++ b/0ad-link-icu-76.patch @@ -0,0 +1,20 @@ +Index: 0ad-0.0.26-alpha/build/premake/extern_libs5.lua +=================================================================== +--- 0ad-0.0.26-alpha.orig/build/premake/extern_libs5.lua ++++ 0ad-0.0.26-alpha/build/premake/extern_libs5.lua +@@ -396,6 +396,7 @@ extern_lib_defs = { + add_default_include_paths("icu") + else + pkgconfig.add_includes("icu-i18n") ++ pkgconfig.add_includes("icu-uc") + end + end, + link_settings = function() +@@ -408,6 +409,7 @@ extern_lib_defs = { + }) + else + pkgconfig.add_links("icu-i18n") ++ pkgconfig.add_links("icu-uc") + end + end, + }, diff --git a/0ad.changes b/0ad.changes new file mode 100644 index 0000000..b6885ce --- /dev/null +++ b/0ad.changes @@ -0,0 +1,434 @@ +------------------------------------------------------------------- +Fri Dec 20 17:19:01 UTC 2024 - Bjørn Lie + +- Replace wxWidgets-3_0-nostl-devel with wxWidgets-devel + BuildRequires. + +------------------------------------------------------------------- +Fri Nov 22 09:16:50 UTC 2024 - Dominique Leuenberger + +- Add 0ad-link-icu-76.patch: Fix build against ICU 76.x. + +------------------------------------------------------------------- +Thu Apr 25 22:29:04 UTC 2024 - Aaron Puchert + +- Add fix-boost-1.85-build.patch to fix build with boost 1.85. + +------------------------------------------------------------------- +Fri Mar 8 07:44:09 UTC 2024 - Dominique Leuenberger + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- +Tue Dec 5 22:44:36 UTC 2023 - Aaron Puchert + +- Add fix-fmt10-build.patch to fix build with libfmt 10. + +------------------------------------------------------------------- +Sat Mar 25 20:11:43 UTC 2023 - Aaron Puchert + +- Add fix-gcc13-build.patch to fix build with GCC 13. + +------------------------------------------------------------------- +Mon Sep 26 21:28:24 UTC 2022 - C J + +- Update to 0.0.26 +- Remove obsolete glibc-2.35.patch. + +------------------------------------------------------------------- +Wed Aug 10 21:06:44 UTC 2022 - Aaron Puchert + +- Fix rpmlint by adding premake-no-automatic-rpath.patch: don't let + premake automatically add RPATHs, these are unnecessary. +- Add distribution default link flags, especially -Wl,-z,now. + +------------------------------------------------------------------- +Sun Jun 26 11:24:08 UTC 2022 - Berthold Gunreben + +- s390x CPU not implemented. + ExcludeArch: s390x + +------------------------------------------------------------------- +Wed Mar 23 19:03:43 UTC 2022 - Bernhard Wiedemann + +- Drop fix-i586-build.patch after boo#1197065 was fixed + +------------------------------------------------------------------- +Sun Mar 13 11:57:58 UTC 2022 - Bernhard Wiedemann + +- Add fix-i586-build.patch to fix build on i586 + +------------------------------------------------------------------- +Fri Mar 11 10:35:08 UTC 2022 - Dominique Leuenberger + +- Do not build on i586. + +------------------------------------------------------------------- +Sun Feb 20 14:52:56 UTC 2022 - Aaron Puchert + +- Add glibc-2.35.patch: Fix build with glibc 2.35. +- Use system mozjs on Leap 15.4 as well. + +------------------------------------------------------------------- +Tue Jan 11 19:34:38 UTC 2022 - Simon Puchert + +- Get rid of Python 2 dependency. +- Disable tests. These require Python 2 to work, but also aren't + executed or packaged anyway. +- Remove duplicate listing of %{_libdir}/%{name}. + +------------------------------------------------------------------- +Fri Jan 7 18:34:02 UTC 2022 - Simon Puchert + +- Make 0ad compatible with Tumbleweed's version of mozjs78: + * no-version-check.patch: Disable the minor version check. This + is required for a successful build using mozjs78 > 78.6.0. + * PrepareZoneForGC.patch: This function got an additional + parameter, change its usage accordingly. (boo#1187732) + +------------------------------------------------------------------- +Sun Aug 29 10:25:25 UTC 2021 - ecsos + +- Update to version 0.0.25b: + * Ranked matches did not longer grant points in the lobby. + * Mod installation no longer require restart. + * Mod installation no longer prints errors when installing mods by double-clicking + * Mod installation now overwrites the existing mods to allow for easier updates. + * Fishes are now easier to spot on lowest settings with the addition of seagulls. + * See https://wildfiregames.com/forum/topic/53714-re-release-of-0-ad-alpha-25-yauna/ +- Increase disk size in _constraints to fix build error + "No space left on device" in Leap. + +------------------------------------------------------------------- +Mon Aug 16 20:42:52 UTC 2021 - Simon Puchert + +- Update to version 0.0.25: + * See https://play0ad.com/new-release-0-a-d-alpha-25-yauna/ +- Dropped mozjs-rust_1_50.patch, merged upstream + +------------------------------------------------------------------- +Tue Apr 27 09:51:16 UTC 2021 - Guillaume GARDET + +- BuildRequires nvidia-texture-tools only when needed + +------------------------------------------------------------------- +Mon Apr 26 12:33:03 UTC 2021 - Guillaume GARDET + +- Enable nvidia-texture-tools only on supported archs + +------------------------------------------------------------------- +Fri Apr 9 22:29:43 UTC 2021 - Ferdinand Thiessen + +- Install bundled mozjs if needed (boo#1184063) + +------------------------------------------------------------------- +Tue Mar 9 23:04:45 UTC 2021 - Ferdinand Thiessen + +- Update to version 0.0.24b: + * See https://play0ad.com/new-release-0-a-d-alpha-24-xsayarsa/ + * Added upstream mozjs-rust_1_50.patch for Factory +- Dropped upstream merged patches: + * 0001-fix-fcollada-error.patch + * 0001-Fix-ODR-violation-for-ShaderModelRendererInternals.patch + +------------------------------------------------------------------- +Mon Aug 3 08:24:07 UTC 2020 - Stefan Brüns + +- Fix build on ix86 in combination with LTO, the bundled mbedtls + from premake5 creates duplicate symbols from inline asm. + Add avoid_duplicate_global_symbol_from_asm.patch +- Add 0001-Fix-ODR-violation-for-ShaderModelRendererInternals.patch +- Clean up dozens of unnecessary build dependencies. + +------------------------------------------------------------------- +Sun Aug 2 16:00:41 UTC 2020 - Simon Vogl + +- Disable --with-system-mozjs38 option on systems which lack the mozjs38 package +- Include the libmozjs38-ps-release.so binary on systems which lack the mozjs38 package +- Require more build dependencies on systems which lack the mozjs38 package +- Add 0001-fix-fcollada-error.patch to fix a build failure with gcc10 + +------------------------------------------------------------------- +Fri Dec 20 10:14:09 UTC 2019 - Dominique Leuenberger + +- Disable LTO on i586. + +------------------------------------------------------------------- +Mon May 20 12:12:08 UTC 2019 - Guillaume GARDET + +- Add _constraints to avoid build failures due to OOM + +------------------------------------------------------------------- +Tue Apr 9 20:22:42 UTC 2019 - Stefan Brüns + +- Spec file cleanup: + * Use https for Url and Source tags + * Remove defattr + * Remove __DATE__ mangling, handled by GCC + SOURCE_DATE_EPOCH + * Remove support for Leap 42.x, unresolvable anyway + +------------------------------------------------------------------- +Tue Dec 25 12:18:12 UTC 2018 - Michael Vetter + +- Update to 0.0.23b: + See https://play0ad.com/re-release-of-0-a-d-alpha-23-ken-wood/ + +------------------------------------------------------------------- +Fri May 18 09:03:04 UTC 2018 - mvetter@suse.com + +- Update to 0.0.23: + See https://play0ad.com/new-release-0-a-d-alpha-23-ken-wood/ +- Remove fix_abs_of_unsigned_char_on_arm.patch: upstreamed +- Remove system-tinygettext.patch: + Upstream thinks this might lead to problems + See https://trac.wildfiregames.com/ticket/4192 +- Add BuildReq libsodium and remove tinygettext to use shipped one + +------------------------------------------------------------------- +Fri Mar 9 17:07:45 UTC 2018 - stefan.bruens@rwth-aachen.de + +- Keep fix_abs_of_unsigned_char_on_arm.patch intact and disable + the conflicting/irrelevant hunk in the spec file + +------------------------------------------------------------------- +Sun Feb 25 20:33:53 UTC 2018 - stefan.bruens@rwth-aachen.de + +- Revert the changes to use bundled mozjs38 on Leap 42.3 again + (no changelog entry), it does not build on 42.3. Use fixed + mozjs38 from distribution instead. + +------------------------------------------------------------------- +Sat Feb 24 18:46:33 UTC 2018 - stefan.bruens@rwth-aachen.de + +- Add fix_abs_of_unsigned_char_on_arm.patch, fixes build on 32/64 + bit ARM (and probably PPC) + +------------------------------------------------------------------- +Sat Feb 3 14:27:50 UTC 2018 - guillaume@opensuse.org + +- Enable nvidia-texture-tools only on supported archs + +------------------------------------------------------------------- +Fri Feb 2 06:06:05 UTC 2018 - stefan.bruens@rwth-aachen.de + +- Use system mozjs38, bundled one fails to build on TW +- Remove special handling for Leap 42.1 +- Pass compiler flags to bundled Collada + +------------------------------------------------------------------- +Tue Nov 21 08:43:30 UTC 2017 - adam.majer@suse.de + +- Stop depending on boost-devel (boo#1062766) + +------------------------------------------------------------------- +Fri Aug 11 19:35:27 UTC 2017 - mailaender@opensuse.org + +- Build with system nvidia-texture-tools (boo#1053393) + +------------------------------------------------------------------- +Fri Jul 28 10:37:17 UTC 2017 - dimstar@opensuse.org + +- Update to version 0.0.22: + + Remake of many models, animations and textures, two new music + tracks. + + Configuration-free Multiplayer Hosting. + + Capture the Relic Gamemode. + + Aura and Heal Range Visualization. + + Twelve new maps, including scripted enemies, rising water and a + tutorial. + + Espionage Technology, Team Bonuses and Hero Auras. + + Petra AI Diplomacy and Attack Strategies. + + Summary Screen Graphs. + + Cinema Path Editing. + + Buddy System. +- Drop 0ad-desktop.patch: fixed upstream. + +------------------------------------------------------------------- +Fri Feb 17 11:38:45 UTC 2017 - dimstar@opensuse.org + +- Install the upstream provided appdata.xml file. + +------------------------------------------------------------------- +Wed Dec 7 00:05:47 UTC 2016 - ecsos@opensuse.org + +- Update to version 0.0.21 + See: https://play0ad.com/new-release-0-a-d-alpha-21-ulysses/ +- Add patch 0ad-desktop.patch because of rpmlint-error invalid- + desktopfile invalid key URL +- Drop patch fix-c++14-compat.patch because now in upstream +- Rebase patch system-tinygettext.patch + +------------------------------------------------------------------- +Tue Aug 30 14:13:52 UTC 2016 - rpm@fthiessen.de + +- Added system-tinygettext.patch +- Removed code for other distributions from spec file, sine we just + build for openSUSE. + +------------------------------------------------------------------- +Fri Jul 29 09:22:25 UTC 2016 - jengelh@inai.de + +- Update License field and trim filler words from description. + +------------------------------------------------------------------- +Mon Jun 27 01:18:13 UTC 2016 - rpm@fthiessen.de + +- Fixed build with gcc6 (Tumbleweed), added fix-c++14-compat.patch + +------------------------------------------------------------------- +Mon May 16 13:12:05 UTC 2016 - jengelh@inai.de + +- Build with wxWidgets 3 and reenable dependency generation + +------------------------------------------------------------------- +Mon Apr 4 14:12:31 UTC 2016 - mvetter@suse.com + +- Update to version 0.0.20 + * New maps + * Better graphics and Camera + See https://play0ad.com/new-release-0-a-d-alpha-20-timosthenes/ + +------------------------------------------------------------------- +Sat Apr 2 17:23:08 UTC 2016 - bwiedemann@suse.com + +- use changelog time instead of build time to fix build-compare + +------------------------------------------------------------------- +Thu Nov 26 22:50:54 UTC 2015 - mvetter@suse.com + +- Update to version 0.0.19 + +------------------------------------------------------------------- +Tue Apr 7 12:43:56 UTC 2015 - g.bluehut@gmail.com + +- Use xz archive instead of gz + +------------------------------------------------------------------- +Thu Apr 2 21:30:23 UTC 2015 - opensuse@oeschti.de + +- update to version 0.0.18 +- use libminiupnpc-devel instead of builtin libminiupnpc + +------------------------------------------------------------------- +Mon Oct 13 19:02:57 UTC 2014 - opensuse@dstoecker.de + +- update to version 0.0.17 + +------------------------------------------------------------------- +Sun Oct 12 06:48:03 UTC 2014 - bwiedemann@suse.com + +- use builtin libminiupnpc to work inspite of incompatible OS version + +------------------------------------------------------------------- +Mon May 26 08:07:52 UTC 2014 - adrian@suse.de + +- require same versioned data package + +------------------------------------------------------------------- +Wed May 21 07:58:31 UTC 2014 - adrian@suse.de + +- build using external libicu + +------------------------------------------------------------------- +Tue May 20 11:10:15 UTC 2014 - adrian@suse.de + +- Update to version 0.0.16. + +------------------------------------------------------------------- +Sat Jan 4 19:58:53 UTC 2014 - aj@ajaissle.de + +- Update to version 0.0.15. + +------------------------------------------------------------------- +Tue Sep 10 17:09:06 UTC 2013 - mailaender@opensuse.org + +- Update to version 0.0.14. +- Adhere to https://en.opensuse.org/SourceUrls + +------------------------------------------------------------------- +Wed Apr 3 15:58:18 UTC 2013 - dimstar@opensuse.org + +- Update to version 0.0.13. + +------------------------------------------------------------------- +Sun Jan 13 09:33:32 UTC 2013 - joop.boonen@opensuse.org + +- Added BuildRequires libXcursor-devel as they are not + automatically installed for openSUSE > 12.2 + +------------------------------------------------------------------- +Sun Dec 16 21:55:40 UTC 2012 - philip@zaynar.co.uk + +- Update to 0.0.12 +- Remove obsolete unused Debian build scripts + +------------------------------------------------------------------- +Sun Oct 14 10:56:21 UTC 2012 - philip@zaynar.co.uk + +- Update to 0.0.11 +- New version number scheme +- Remove fam/gamin dependency + +------------------------------------------------------------------- +Wed May 16 20:14:34 UTC 2012 - philip@zaynar.co.uk + +- Update to r11863 + +------------------------------------------------------------------- +Thu Mar 15 17:35:49 UTC 2012 - philip@zaynar.co.uk + +- Update to r11339 + +------------------------------------------------------------------- +Fri Dec 23 19:53:20 UTC 2011 - philip@zaynar.co.uk + +- Update to r10803 + +------------------------------------------------------------------- +Sat Sep 17 12:03:28 UTC 2011 - philip@zaynar.co.uk + +- Update to r10288 + +------------------------------------------------------------------- +Sun Jul 10 12:17:14 UTC 2011 - philip@zaynar.co.uk + +- Update to r9786 +- libenet0-devel -> libenet-devel + +------------------------------------------------------------------- +Fri May 20 14:07:52 UTC 2011 - philip@zaynar.co.uk + +- Update to r9530 +- libenet-devel -> libenet0-devel + +------------------------------------------------------------------- +Fri Mar 11 16:52:07 UTC 2011 - philip@zaynar.co.uk + +- Update to r9049 + +------------------------------------------------------------------- +Mon Feb 21 00:05:53 UTC 2011 - reddwarf@opensuse.org + +- wxGTK -> wxWidgets migration + +------------------------------------------------------------------- +Fri Dec 10 23:40:26 UTC 2010 - philip@zaynar.co.uk + +- Update to r8832 + +------------------------------------------------------------------- +Sun Oct 17 22:15:45 UTC 2010 - philip@zaynar.co.uk + +- Update to r8413 + +------------------------------------------------------------------- +Sun Aug 15 15:29:40 UTC 2010 - philip@zaynar.co.uk + +- Update to r7970 +- Compile in Release mode + +------------------------------------------------------------------- +Mon Jul 12 21:10:44 UTC 2010 - bitshuffler@opensuse.org + +- Initial package + diff --git a/0ad.spec b/0ad.spec new file mode 100644 index 0000000..44ec684 --- /dev/null +++ b/0ad.spec @@ -0,0 +1,182 @@ +# +# spec file for package 0ad +# +# 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/ +# + + +# Enable NVTT only on arch supported by nvidia-texture-tools +%ifarch %{ix86} x86_64 ppc +%bcond_without nvtt +%else +%bcond_with nvtt +%endif +# We can use the system mozjs on Tumbleweed and Leap 15.4. +%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150400 +%bcond_without system_mozjs +%else +%bcond_with system_mozjs +%endif +# Use provided library +%bcond_without system_nvtt +Name: 0ad +Version: 0.0.26 +Release: 0 +Summary: A real-time strategy game of ancient warfare +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 +Group: Amusements/Games/Strategy/Real Time +URL: https://play0ad.com/ +Source: https://releases.wildfiregames.com/%{name}-%{version}-alpha-unix-build.tar.xz +# PATCH-FIX-UPSTREAM +Patch0: avoid_duplicate_global_symbol_from_asm.patch +# PATCH-FIX-OPENSUSE -- Disable the mozjs version check +Patch1: no-version-check.patch +# PATCH-FIX-OPENSUSE -- Use the newer variant of this function (related to mozjs78 upgrade) +Patch2: PrepareZoneForGC.patch +# PATCH-FIX-OPENSUSE -- Skip automatic addition of an RPATH. +Patch3: premake-no-automatic-rpath.patch +# PATCH-FIX-UPSTREAM -- Fix build with GCC 13 +Patch4: fix-gcc13-build.patch +# PATCH-FIX-UPSTREAM -- Fix build with fmt 10 +Patch5: fix-fmt10-build.patch +# PATCH-FIX-UPSTREAM -- Fix build with boost 1.85 +Patch6: fix-boost-1.85-build.patch +# PATCH-FIX-UPSTREAM -- Fix build with icu 76.x +Patch7: 0ad-link-icu-76.patch +BuildRequires: cmake +BuildRequires: gcc-c++ +BuildRequires: libXcursor-devel +BuildRequires: libboost_filesystem-devel +BuildRequires: libboost_system-devel +BuildRequires: libjpeg-devel +BuildRequires: libminiupnpc-devel +BuildRequires: libpng-devel +BuildRequires: pkgconfig +BuildRequires: update-desktop-files +BuildRequires: wxWidgets-devel +BuildRequires: pkgconfig(IL) +BuildRequires: pkgconfig(fmt) +BuildRequires: pkgconfig(gloox) +BuildRequires: pkgconfig(gnutls) +BuildRequires: pkgconfig(icu-i18n) +BuildRequires: pkgconfig(libcurl) +BuildRequires: pkgconfig(libenet) +BuildRequires: pkgconfig(libidn) +BuildRequires: pkgconfig(libsodium) >= 1.0.13 +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(openal) +BuildRequires: pkgconfig(sdl2) +BuildRequires: pkgconfig(vorbis) +BuildRequires: pkgconfig(zlib) +Requires: 0ad-data = %{version} +%if %{with nvtt} && %{with system_nvtt} +BuildRequires: nvidia-texture-tools >= 2.1 +%endif +%if %{with system_mozjs} +#FIXME: Depends on source/scriptinterface/ScriptTypes.h +# This is "fixed" by disabling the version check. +BuildRequires: pkgconfig(mozjs-78) >= 78.7 +%else +BuildRequires: cargo +BuildRequires: rust +%endif +ExcludeArch: s390x + +%description +0 A.D. (pronounced "zero ey-dee") is a real-time strategy (RTS) game +of ancient warfare. It is a historically-based war/economy game that +allows players to relive or rewrite the history of Western +civilizations, focusing on the years between 500 B.C. and 500 A.D. +The project contains 3D graphics, detailed artwork, sound, and a +flexible game engine. + +%prep +%setup -q -n %{name}-%{version}-alpha +%patch -P 0 -p1 +%patch -P 3 -p1 +%patch -P 4 -p1 +%patch -P 5 -p1 +%if %{with system_mozjs} +%patch -P 1 -p1 +%patch -P 2 -p1 +%endif +%if %{pkg_vcmp libboost_filesystem-devel >= 1.74} +%patch -P 6 -p1 +%endif +%patch -P 7 -p1 + +%build +export CFLAGS="%{optflags}" +# bundled Collada uses CCFLAGS +export CCFLAGS="%{optflags}" +export CPPFLAGS="%{optflags} -fpermissive" +# Copied from macros.cmake. +export LDFLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" +build/workspaces/update-workspaces.sh \ + %{?_smp_mflags} \ + --bindir=%{_bindir} \ + --datadir=%{_datadir}/%{name} \ + --libdir=%{_libdir}/%{name} \ + --without-tests \ +%if %{with nvtt} +%if %{with system_nvtt} + --with-system-nvtt \ +%endif +%else + --without-nvtt \ +%endif +%if %{with system_mozjs} + --with-system-mozjs +%else +export CARGO_PROFILE_RELEASE_LTO=true +%endif + +pushd build/workspaces/gcc +%make_build verbose=1 +popd + +%install +mkdir -p %{buildroot}%{_libdir}/%{name} +mkdir -p %{buildroot}%{_datadir}/%{name} +# Install binaries and wrapper +install -Dm 0755 binaries/system/ActorEditor %{buildroot}%{_bindir}/ActorEditor +install -Dm 0755 binaries/system/pyrogenesis %{buildroot}%{_bindir}/pyrogenesis +install -Dm 0755 build/resources/0ad.sh %{buildroot}%{_bindir}/0ad +# Install game libraries +install -m 0644 binaries/system/libCollada.so %{buildroot}%{_libdir}/%{name}/libCollada.so +install -m 0644 binaries/system/libAtlasUI.so %{buildroot}%{_libdir}/%{name}/libAtlasUI.so +# If without system mozjs we need to install the bundled one +%if %{without system_mozjs} +install -m 0644 binaries/system/libmozjs*-ps-release.so %{buildroot}%{_libdir}/%{name}/ +%endif +# Install appdata +install -Dm 0644 build/resources/0ad.desktop %{buildroot}%{_datadir}/applications/%{name}.desktop +install -Dm 0644 build/resources/0ad.appdata.xml %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml +install -Dm 0644 build/resources/0ad.png %{buildroot}%{_datadir}/pixmaps/%{name}.png + +%suse_update_desktop_file %{name} + +%files +%doc README.txt +%license LICENSE.txt license_gpl-2.0.txt license_lgpl-2.1.txt license_mit.txt +%{_bindir}/0ad +%{_bindir}/pyrogenesis +%{_bindir}/ActorEditor +%{_libdir}/%{name}/ +%{_datadir}/pixmaps/%{name}.png +%{_datadir}/appdata/%{name}.appdata.xml +%{_datadir}/applications/%{name}.desktop +%dir %{_datadir}/%{name} + +%changelog diff --git a/PrepareZoneForGC.patch b/PrepareZoneForGC.patch new file mode 100644 index 0000000..6b36767 --- /dev/null +++ b/PrepareZoneForGC.patch @@ -0,0 +1,19 @@ +diff -Nur 0ad-0.0.25b-alpha/source/scriptinterface/ScriptContext.cpp 0ad-0.0.25b-alpha-patched/source/scriptinterface/ScriptContext.cpp +--- 0ad-0.0.25b-alpha/source/scriptinterface/ScriptContext.cpp 2021-07-27 23:56:58.000000000 +0200 ++++ 0ad-0.0.25b-alpha-patched/source/scriptinterface/ScriptContext.cpp 2021-12-30 16:58:57.749562521 +0100 +@@ -143,7 +143,7 @@ + // Schedule the zone for GC, which will destroy the realm. + if (JS::IsIncrementalGCInProgress(m_cx)) + JS::FinishIncrementalGC(m_cx, JS::GCReason::API); +- JS::PrepareZoneForGC(js::GetRealmZone(realm)); ++ JS::PrepareZoneForGC(m_cx, js::GetRealmZone(realm)); + m_Realms.remove(realm); + } + +@@ -261,5 +261,5 @@ + void ScriptContext::PrepareZonesForIncrementalGC() const + { + for (JS::Realm* const& realm : m_Realms) +- JS::PrepareZoneForGC(js::GetRealmZone(realm)); ++ JS::PrepareZoneForGC(m_cx, js::GetRealmZone(realm)); + } diff --git a/_constraints b/_constraints new file mode 100644 index 0000000..7c453f3 --- /dev/null +++ b/_constraints @@ -0,0 +1,11 @@ + + + + + 12 + + + 5 + + + diff --git a/avoid_duplicate_global_symbol_from_asm.patch b/avoid_duplicate_global_symbol_from_asm.patch new file mode 100644 index 0000000..b4e8c3a --- /dev/null +++ b/avoid_duplicate_global_symbol_from_asm.patch @@ -0,0 +1,31 @@ +From 6872cc5f672da6fce5facebf697415208fe34b12 Mon Sep 17 00:00:00 2001 +From: StefanBruens +Date: Fri, 1 Nov 2019 21:07:33 +0100 +Subject: [PATCH] Use local label in inline asm, avoid symbol duplication + +The global label "unsupported" may lead to duplicated symbols +when the function is inlined in multiple places. This may happen +in any case, but using LTO exposes this problem reliably. + +See https://github.com/ARMmbed/mbed-crypto/issues/312 +--- + build/premake/premake5/contrib/mbedtls/library/padlock.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/build/premake/premake5/contrib/mbedtls/library/padlock.c b/build/premake/premake5/contrib/mbedtls/library/padlock.c +index b85ff9cd2c..bb0a1ef419 100644 +--- a/build/premake/premake5/contrib/mbedtls/library/padlock.c ++++ b/build/premake/premake5/contrib/mbedtls/library/padlock.c +@@ -58,10 +58,10 @@ int mbedtls_padlock_has_support( int feature ) + "cpuid \n\t" + "cmpl $0xC0000001, %%eax \n\t" + "movl $0, %%edx \n\t" +- "jb unsupported \n\t" ++ "jb 1f \n\t" + "movl $0xC0000001, %%eax \n\t" + "cpuid \n\t" +- "unsupported: \n\t" ++ "1: \n\t" + "movl %%edx, %1 \n\t" + "movl %2, %%ebx \n\t" + : "=m" (ebx), "=m" (edx) diff --git a/fix-boost-1.85-build.patch b/fix-boost-1.85-build.patch new file mode 100644 index 0000000..8119d17 --- /dev/null +++ b/fix-boost-1.85-build.patch @@ -0,0 +1,22 @@ +--- 0ad-0.0.26-alpha/source/graphics/TextureManager.cpp ++++ 0ad-0.0.26-alpha/source/graphics/TextureManager.cpp +@@ -785,7 +785,7 @@ + files.push_back(f); + p = p / GetWstringFromWpath(*it); + } +- return m_TextureConverter.ComputeSettings(GetWstringFromWpath(srcPath.leaf()), files); ++ return m_TextureConverter.ComputeSettings(GetWstringFromWpath(srcPath.filename()), files); + } + + /** +--- 0ad-0.0.26-alpha/source/lib/file/file_system.cpp ++++ 0ad-0.0.26-alpha/source/lib/file/file_system.cpp +@@ -218,7 +218,7 @@ + try + { + if(override_if_exists) +- fs::copy_file(fs::path(path.string()), fs::path(newPath.string()), boost::filesystem::copy_option::overwrite_if_exists); ++ fs::copy_file(fs::path(path.string()), fs::path(newPath.string()), boost::filesystem::copy_options::overwrite_existing); + else + fs::copy_file(fs::path(path.string()), fs::path(newPath.string())); + } diff --git a/fix-fmt10-build.patch b/fix-fmt10-build.patch new file mode 100644 index 0000000..1393875 --- /dev/null +++ b/fix-fmt10-build.patch @@ -0,0 +1,48 @@ +From 839edc3ae61cd313d37a14a9a24e2ef1bd4e5808 Mon Sep 17 00:00:00 2001 +From: Stan +Date: Wed, 31 May 2023 12:03:04 +0000 +Subject: [PATCH] Fix the removal of implicit conversions in libfmt 10 by using + explicit casts. Patch by: @phosit Accepted by: @vladislavbelov Comments by: + @sera + +Differential Revision: https://code.wildfiregames.com/D4998 + +git-svn-id: https://svn.wildfiregames.com/public/ps/trunk@27657 3db68df2-c116-0410-a063-a993310a9797 +--- + source/network/NetMessage.cpp | 5 +++-- + source/simulation2/serialization/BinarySerializer.cpp | 2 +- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/source/network/NetMessage.cpp b/source/network/NetMessage.cpp +index 61126d8e1b0..9515d939ded 100644 +--- a/source/network/NetMessage.cpp ++++ b/source/network/NetMessage.cpp +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2017 Wildfire Games. ++/* Copyright (C) 2023 Wildfire Games. + * This file is part of 0 A.D. + * + * 0 A.D. is free software: you can redistribute it and/or modify +@@ -216,7 +216,8 @@ CNetMessage* CNetMessageFactory::CreateMessage(const void* pData, + break; + + default: +- LOGERROR("CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", header.GetType()); ++ LOGERROR("CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", ++ static_cast(header.GetType())); + break; + } + +diff --git a/source/simulation2/serialization/BinarySerializer.cpp b/source/simulation2/serialization/BinarySerializer.cpp +index c24b84bb2c1..4a6b57d7a99 100644 +--- a/source/simulation2/serialization/BinarySerializer.cpp ++++ b/source/simulation2/serialization/BinarySerializer.cpp +@@ -52,7 +52,7 @@ static u8 GetArrayType(js::Scalar::Type arrayType) + case js::Scalar::Uint8Clamped: + return SCRIPT_TYPED_ARRAY_UINT8_CLAMPED; + default: +- LOGERROR("Cannot serialize unrecognized typed array view: %d", arrayType); ++ LOGERROR("Cannot serialize unrecognized typed array view: %d", static_cast(arrayType)); + throw PSERROR_Serialize_InvalidScriptValue(); + } + } diff --git a/fix-gcc13-build.patch b/fix-gcc13-build.patch new file mode 100644 index 0000000..1a17741 --- /dev/null +++ b/fix-gcc13-build.patch @@ -0,0 +1,13 @@ +diff --git a/source/tools/atlas/GameInterface/Messages.h b/source/tools/atlas/GameInterface/Messages.h +index 2fa4780..515ae94 100644 +--- a/source/tools/atlas/GameInterface/Messages.h ++++ b/source/tools/atlas/GameInterface/Messages.h +@@ -212,7 +212,7 @@ QUERY(GetCurrentMapSize, + QUERY(RasterizeMinimap, + , + ((int, dimension)) +- ((std::vector, imageBytes)) ++ ((std::vector, imageBytes)) + ); + + QUERY(GetRMSData, diff --git a/no-version-check.patch b/no-version-check.patch new file mode 100644 index 0000000..532b134 --- /dev/null +++ b/no-version-check.patch @@ -0,0 +1,19 @@ +diff -Nur 0ad-0.0.25b-alpha/source/scriptinterface/ScriptTypes.h 0ad-0.0.25b-alpha-patched/source/scriptinterface/ScriptTypes.h +--- 0ad-0.0.25b-alpha/source/scriptinterface/ScriptTypes.h 2021-07-27 23:56:58.000000000 +0200 ++++ 0ad-0.0.25b-alpha-patched/source/scriptinterface/ScriptTypes.h 2021-12-30 17:18:03.719142315 +0100 +@@ -81,6 +81,7 @@ + include paths. + #endif + ++#if 0 + #if MOZJS_MINOR_VERSION != 6 + #error Your compiler is trying to use an untested minor version of the \ + SpiderMonkey library. If you are a package maintainer, please make sure \ +@@ -93,6 +94,7 @@ + final hash (check trac.wildfiregames.com/wiki/Debugging#Replaymode). \ + For more information check this link: trac.wildfiregames.com/wiki/Debugging#Outofsync + #endif ++#endif + + class ScriptInterface; + diff --git a/premake-no-automatic-rpath.patch b/premake-no-automatic-rpath.patch new file mode 100644 index 0000000..71d0b47 --- /dev/null +++ b/premake-no-automatic-rpath.patch @@ -0,0 +1,46 @@ +diff --git a/build/premake/premake5/src/scripts.c b/build/premake/premake5/src/scripts.c +index 9ed203c..144ea46 100644 +--- a/build/premake/premake5/src/scripts.c ++++ b/build/premake/premake5/src/scripts.c +@@ -5184,17 +5184,8 @@ static const unsigned char builtin_script_37[] = { + 99, 102, 103, 46, 98, 117, 105, 108, 100, 116, 97, 114, 103, 101, 116, 46, 100, 105, 114, 101, 99, 116, 111, 114, 121, 44, 32, 102, 117, 108, 108, 112, + 97, 116, 104, 41, 10, 105, 102, 32, 110, 111, 116, 32, 40, 116, 97, 98, 108, 101, 46, 99, 111, 110, 116, 97, 105, 110, 115, 40, 114, 112, 97, 116, + 104, 115, 44, 32, 114, 112, 97, 116, 104, 41, 41, 32, 116, 104, 101, 110, 10, 116, 97, 98, 108, 101, 46, 105, 110, 115, 101, 114, 116, 40, 114, 112, +- 97, 116, 104, 115, 44, 32, 114, 112, 97, 116, 104, 41, 10, 101, 110, 100, 10, 101, 110, 100, 10, 102, 111, 114, 32, 95, 44, 32, 115, 105, 98, 108, +-105, 110, 103, 32, 105, 110, 32, 105, 112, 97, 105, 114, 115, 40, 99, 111, 110, 102, 105, 103, 46, 103, 101, 116, 108, 105, 110, 107, 115, 40, 99, 102, +-103, 44, 32, 34, 115, 105, 98, 108, 105, 110, 103, 115, 34, 44, 32, 34, 111, 98, 106, 101, 99, 116, 34, 41, 41, 32, 100, 111, 10, 105, 102, 32, +- 40, 115, 105, 98, 108, 105, 110, 103, 46, 107, 105, 110, 100, 32, 61, 61, 32, 112, 46, 83, 72, 65, 82, 69, 68, 76, 73, 66, 41, 32, 116, 104, +-101, 110, 10, 108, 111, 99, 97, 108, 32, 102, 117, 108, 108, 112, 97, 116, 104, 32, 61, 32, 115, 105, 98, 108, 105, 110, 103, 46, 108, 105, 110, 107, +-116, 97, 114, 103, 101, 116, 46, 100, 105, 114, 101, 99, 116, 111, 114, 121, 10, 108, 111, 99, 97, 108, 32, 114, 112, 97, 116, 104, 32, 61, 32, 112, +- 97, 116, 104, 46, 103, 101, 116, 114, 101, 108, 97, 116, 105, 118, 101, 40, 99, 102, 103, 46, 98, 117, 105, 108, 100, 116, 97, 114, 103, 101, 116, 46, +-100, 105, 114, 101, 99, 116, 111, 114, 121, 44, 32, 102, 117, 108, 108, 112, 97, 116, 104, 41, 10, 105, 102, 32, 110, 111, 116, 32, 40, 116, 97, 98, +-108, 101, 46, 99, 111, 110, 116, 97, 105, 110, 115, 40, 114, 112, 97, 116, 104, 115, 44, 32, 114, 112, 97, 116, 104, 41, 41, 32, 116, 104, 101, 110, +- 10, 116, 97, 98, 108, 101, 46, 105, 110, 115, 101, 114, 116, 40, 114, 112, 97, 116, 104, 115, 44, 32, 114, 112, 97, 116, 104, 41, 10, 101, 110, 100, +- 10, 101, 110, 100, 10, 101, 110, 100, 10, 102, 111, 114, 32, 95, 44, 32, 114, 112, 97, 116, 104, 32, 105, 110, 32, 105, 112, 97, 105, 114, 115, 40, ++ 97, 116, 104, 115, 44, 32, 114, 112, 97, 116, 104, 41, 10, 101, 110, 100, 10, 101, 110, 100, ++ 10, 102, 111, 114, 32, 95, 44, 32, 114, 112, 97, 116, 104, 32, 105, 110, 32, 105, 112, 97, 105, 114, 115, 40, + 114, 112, 97, 116, 104, 115, 41, 32, 100, 111, 10, 105, 102, 32, 116, 97, 98, 108, 101, 46, 99, 111, 110, 116, 97, 105, 110, 115, 40, 111, 115, 46, + 103, 101, 116, 83, 121, 115, 116, 101, 109, 84, 97, 103, 115, 40, 99, 102, 103, 46, 115, 121, 115, 116, 101, 109, 41, 44, 32, 34, 100, 97, 114, 119, + 105, 110, 34, 41, 32, 116, 104, 101, 110, 10, 114, 112, 97, 116, 104, 32, 61, 32, 34, 64, 108, 111, 97, 100, 101, 114, 95, 112, 97, 116, 104, 47, +diff --git a/build/premake/premake5/src/tools/gcc.lua b/build/premake/premake5/src/tools/gcc.lua +index abd4c55..89f73b5 100644 +--- a/build/premake/premake5/src/tools/gcc.lua ++++ b/build/premake/premake5/src/tools/gcc.lua +@@ -296,17 +296,6 @@ + end + end + +- -- Automatically add linked shared libraries path relative to target directory +- for _, sibling in ipairs(config.getlinks(cfg, "siblings", "object")) do +- if (sibling.kind == p.SHAREDLIB) then +- local fullpath = sibling.linktarget.directory +- local rpath = path.getrelative(cfg.buildtarget.directory, fullpath) +- if not (table.contains(rpaths, rpath)) then +- table.insert(rpaths, rpath) +- end +- end +- end +- + for _, rpath in ipairs(rpaths) do + if table.contains(os.getSystemTags(cfg.system), "darwin") then + rpath = "@loader_path/" .. rpath