[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#50201] [PATCH 08/52] gnu: mozjs-60: Fix cross-compilation build err
From: |
Maxime Devos |
Subject: |
[bug#50201] [PATCH 08/52] gnu: mozjs-60: Fix cross-compilation build errors. |
Date: |
Wed, 25 Aug 2021 20:02:48 +0200 |
Presumably the other versions of mozjs need some changes
as well, but for now only fix mozjs@60, which is a dependency
of polkit.
* gnu/packages/gnuzilla.scm
(mozjs-60)[arguments]<#:configure-flags>: Set --with-nspr-prefix
and set --host and --target inappropriately when cross-compiling.
(mozjs-60)[arguments]<#:phases>{set-PKG_CONFIG}: New phase
when cross-compiling.
---
gnu/packages/gnuzilla.scm | 51 ++++++++++++++++++++++++++++-----------
1 file changed, 37 insertions(+), 14 deletions(-)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index a4d193ce11..df1926dc51 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net>
;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -367,22 +368,44 @@ in C/C++.")
`(#:tests? #f ; FIXME: all tests pass, but then the check phase fails
anyway.
#:test-target "check-jstests"
#:configure-flags
- '("--enable-ctypes"
- "--enable-optimize"
- "--enable-pie"
- "--enable-readline"
- "--enable-shared-js"
- "--enable-system-ffi"
- "--with-system-nspr"
- "--with-system-zlib"
- "--with-system-icu"
- "--with-intl-api"
- ;; This is important because without it gjs will segfault during the
- ;; configure phase. With jemalloc only the standalone mozjs console
- ;; will work.
- "--disable-jemalloc")
+ ;; TODO(core-updates): unconditionally use 'quasiquote
+ ,#~(#$(if (%current-target-system)
+ #~quasiquote
+ #~quote)
+ ("--enable-ctypes"
+ "--enable-optimize"
+ "--enable-pie"
+ "--enable-readline"
+ "--enable-shared-js"
+ "--enable-system-ffi"
+ "--with-system-nspr"
+ #$@(if (%current-target-system)
+ #~(,(string-append "--with-nspr-prefix="
+ #$(this-package-input "nspr")))
+ #~())
+ "--with-system-zlib"
+ "--with-system-icu"
+ "--with-intl-api"
+ ;; This is important because without it gjs will segfault during
the
+ ;; configure phase. With jemalloc only the standalone mozjs
console
+ ;; will work.
+ "--disable-jemalloc"
+ ;; Mozilla deviates from Autotools conventions due to historical
+ ;; reasons.
+ #$@(if (%current-target-system)
+ #~(#$(string-append
+ "--host="
+ (nix-system->gnu-triplet (%current-system)))
+ #$(string-append "--target=" (%current-target-system)))
+ #~())))
#:phases
(modify-phases %standard-phases
+ ;; Make sure pkg-config will be found.
+ ,@(if (%current-target-system)
+ `((add-before 'configure 'set-PKG-CONFIG
+ (lambda _
+ (setenv "PKG_CONFIG" ,(pkg-config-for-target)))))
+ '())
(replace 'configure
(lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
;; The configure script does not accept environment variables as
--
2.33.0
- [bug#50201] [PATCH core-updates-frozen 0/52] Support cross-compilation in glib-or-gtk-build-system and fix cross-compilation errors, Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 01/52] gnu: dbus-glib: Support cross-compilation., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 03/52] gnu: elogind: Fix cross-compilation., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 02/52] gnu: elogind: Make #:configure-flags a G-exp., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 04/52] gnu: libcap: Fix cross-compilation build failures., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 06/52] gnu: nspr: Adjust to Mozilla cross-compilation conventions., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 07/52] gnu: nspr: Don't retain references to native inputs., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 09/52] gnu: poppler: Find pkg-config when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 08/52] gnu: mozjs-60: Fix cross-compilation build errors.,
Maxime Devos <=
- [bug#50201] [PATCH 10/52] build-system/meson: Allow 'configure-flags' to be a G-exp., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 12/52] gnu: dbus-cairo: Add missing bash-minimal input., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 20/52] gnu: gamin: Recognise aarch64 as architecture when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 22/52] gnu: iso-codes: Move inputs to native-inputs when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 17/52] gnu: atk: Disable introspection when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 14/52] gnu: gobject-introspection: Don't build introspection data when cross-compiling., Maxime Devos, 2021/08/25
- [bug#50201] [PATCH 19/52] gnu: graphene: Don't build introspection data when cross-compiling., Maxime Devos, 2021/08/25