diff --git a/0ad.changes b/0ad.changes index 0e32f42..58c1021 100644 --- a/0ad.changes +++ b/0ad.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +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 diff --git a/0ad.spec b/0ad.spec index dc47373..40199bd 100644 --- a/0ad.spec +++ b/0ad.spec @@ -40,6 +40,10 @@ 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 BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: libXcursor-devel @@ -72,8 +76,8 @@ BuildRequires: nvidia-texture-tools >= 2.1 %endif %if %{with system_mozjs} #FIXME: Depends on source/scriptinterface/ScriptTypes.h -BuildRequires: pkgconfig(mozjs-78) < 78.7 -BuildRequires: pkgconfig(mozjs-78) >= 78.6 +# This is "fixed" by disabling the version check. +BuildRequires: pkgconfig(mozjs-78) >= 78.7 %else BuildRequires: cargo BuildRequires: rust @@ -90,6 +94,10 @@ flexible game engine. %prep %setup -q -n %{name}-%{version}-alpha %patch0 -p1 +%if %{with system_mozjs} +%patch1 -p1 +%patch2 -p1 +%endif %build export CFLAGS="%{optflags}" 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/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; +