From patchwork Wed Aug 25 18:02:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 32258 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BF64E27BBE3; Wed, 25 Aug 2021 19:04:42 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 783EF27BBE1 for ; Wed, 25 Aug 2021 19:04:42 +0100 (BST) Received: from localhost ([::1]:57040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIxGT-0000YG-9w for patchwork@mira.cbaines.net; Wed, 25 Aug 2021 14:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIxFv-0007xq-3j for guix-patches@gnu.org; Wed, 25 Aug 2021 14:04:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIxFu-0000qi-Po for guix-patches@gnu.org; Wed, 25 Aug 2021 14:04:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIxFu-0002np-LE for guix-patches@gnu.org; Wed, 25 Aug 2021 14:04:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50201] [PATCH 08/52] gnu: mozjs-60: Fix cross-compilation build errors. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Aug 2021 18:04:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50201 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50201@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 50201-submit@debbugs.gnu.org id=B50201.162991463910598 (code B ref 50201); Wed, 25 Aug 2021 18:04:06 +0000 Received: (at 50201) by debbugs.gnu.org; 25 Aug 2021 18:03:59 +0000 Received: from localhost ([127.0.0.1]:47683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIxFm-0002km-JQ for submit@debbugs.gnu.org; Wed, 25 Aug 2021 14:03:58 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:50794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIxFW-0002g9-Ir for 50201@debbugs.gnu.org; Wed, 25 Aug 2021 14:03:43 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by michel.telenet-ops.be with bizsmtp id lu3d2500J0mfAB406u3hTT; Wed, 25 Aug 2021 20:03:41 +0200 From: Maxime Devos Date: Wed, 25 Aug 2021 20:02:48 +0200 Message-Id: <20210825180332.5720-8-maximedevos@telenet.be> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210825180332.5720-1-maximedevos@telenet.be> References: <20210825180332.5720-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629914622; bh=VAH7Fanzy1zZE0RSyLhTLquklReZfcFeTDVOEDmWdzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XM03ph550qzAMSVA0qoCmiWn8ZRopF2INti9hI2fj+pIOkQZ7BqQE3d+K9f/9M/HP cCKQOcGE9Fihje64gS4RI+C6cOJV2abm5zHuVgGw9kvv/pizMhkxE/u43sDCcCTsd6 XVwlRdEMCUwHm9uh3rN82Mg+EEa1yoNNxj2Es6Rs3XziYgaWaO5l6/FC5LIdUjTRTQ jlPZ8o9Jjqddj+iwREpIUFETih9LQB0shrMmeNdaFziL/hpND0Sj1PpofHHoC6CMdw wOFUpTIEyF4vmRpPNEU6ii2Pue0hw4F5SB1YR7ArV2PLyk45apnB6OXai3rpf8lRz2 wUlQ/8BE2QG7w== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 ;;; Copyright © 2020 Jonathan Brielmaier ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2021 Maxime Devos ;;; ;;; 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