From fea60a2fff443b9c172ed28bd37361e34e064f13 Mon Sep 17 00:00:00 2001 From: Guillaume Le Vaillant Date: Sun, 2 Jan 2022 13:44:19 +0100 Subject: gnu: 0ad: Fix building with mozjs version other than 78.6. Fixes . * gnu/packages/games.scm (0ad)[native-inputs]: Remove labels. [arguments]: Add 'fix-mozjs-compatibility' phase. --- gnu/packages/games.scm | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'gnu/packages/games.scm') diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index c61dafc7a0..f086252dba 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -42,7 +42,7 @@ ;;; Copyright © 2019 Julien Lepiller ;;; Copyright © 2019, 2020 Jesse Gibbons ;;; Copyright © 2019 Dan Frumin -;;; Copyright © 2019, 2020, 2021 Guillaume Le Vaillant +;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant ;;; Copyright © 2019, 2020 Timotej Lazar ;;; Copyright © 2019 Josh Holland ;;; Copyright © 2019 Pkill -9 @@ -6617,12 +6617,12 @@ fight against their plot and save his fellow rabbits from slavery.") wxwidgets zlib)) (native-inputs - `(("boost" ,boost) - ("cmake" ,cmake-minimal) - ("cxxtest" ,cxxtest) - ("mesa" ,mesa) - ("pkg-config" ,pkg-config) - ("python-2" ,python-2))) + (list boost + cmake-minimal + cxxtest + mesa + pkg-config + python-2)) (build-system gnu-build-system) (arguments `(#:make-flags '("config=release" "verbose=1" "-C" "build/workspaces/gcc") @@ -6638,6 +6638,18 @@ fight against their plot and save his fellow rabbits from slavery.") (string-append "\"" (assoc-ref inputs "cxxtest") "/bin/cxxtestgen" "\""))))) + (add-after 'unpack 'fix-mozjs-compatibility + ;; 0ad only builds fine with a specific version of mozjs + ;; (version 78.6 for 0ad-0.0.25). + ;; Here we change the error in case of version mismatch to a warning, + ;; and add some minor compatibility fixes. + (lambda _ + (substitute* "source/scriptinterface/ScriptTypes.h" + (("#error Your compiler is trying to use") + "#warning Your compiler is trying to use")) + (substitute* "source/scriptinterface/ScriptContext.cpp" + (("JS::PrepareZoneForGC\\(") + "JS::PrepareZoneForGC(m_cx, ")))) (replace 'configure (lambda* (#:key inputs outputs tests? #:allow-other-keys) (let* ((jobs (number->string (parallel-job-count))) -- cgit v1.2.3