From patchwork Mon Jun 14 15:22:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 165 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 DC12027BC83; Mon, 14 Jun 2021 16:45:19 +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_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham 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 3EB7B27BC81 for ; Mon, 14 Jun 2021 16:45:19 +0100 (BST) Received: from localhost ([::1]:48462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsom5-0002VT-SK for patchwork@mira.cbaines.net; Mon, 14 Jun 2021 11:45:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsoQY-0002Zu-Is for guix-patches@gnu.org; Mon, 14 Jun 2021 11:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsoQY-0006Kc-Aq for guix-patches@gnu.org; Mon, 14 Jun 2021 11:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsoQY-0003nS-3i for guix-patches@gnu.org; Mon, 14 Jun 2021 11:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH core-updates 00/37] Support cross-compilation with meson Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Jun 2021 15:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162368414214527 (code B ref -1); Mon, 14 Jun 2021 15:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jun 2021 15:22:22 +0000 Received: from localhost ([127.0.0.1]:47467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsoPt-0003mF-Ki for submit@debbugs.gnu.org; Mon, 14 Jun 2021 11:22:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:59914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsoPs-0003m7-8C for submit@debbugs.gnu.org; Mon, 14 Jun 2021 11:22:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsoPr-0000Zc-W1 for guix-patches@gnu.org; Mon, 14 Jun 2021 11:22:20 -0400 Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]:51572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsoPp-0005zM-G3 for guix-patches@gnu.org; Mon, 14 Jun 2021 11:22:19 -0400 Received: from butterfly.local ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id H3NB2500K0mfAB4013NBn4; Mon, 14 Jun 2021 17:22:11 +0200 Message-ID: <419215938396207999184dafa43afaed6d7a0715.camel@telenet.be> From: Maxime Devos Date: Mon, 14 Jun 2021 17:22:11 +0200 User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1623684132; bh=x1eWo3QX4Ry2pHMBqhd/LUaQEMWIsO298q5JjZCWWS8=; h=Subject:From:To:Date; b=saCWJk5VnoAY/rIUH96lYLdSLc+UcABC6a/ciXnmT2yGz232QfnPzAwalYRXAviYW fB33wgsK4omIumykn30aGMsrXNuscexIny2aqcMeLlZwgcJdrYP7iwI0bH8QADjhkZ En2lIHQLLdEg4s3eTJl/aaJ5CHOTwTwQYnOM5F1hYd92p0CEn5oWqQWA7WN0UKTqsl LDnwJfRSGAPuLP/ClvlAuli4/7/mzKod/NVA85Yk7lT6hg/VLkyO2UKNqHmnub9TEk JYFrfEDC1kn4y64llv+l1hbwNpPi33/l3WDJoDDu0rvIlzSz+v+avYQ1O1IlyCl/ne PGHXrH77GKlZA== Received-SPF: pass client-ip=2a02:1800:110:4::f00:19; envelope-from=maximedevos@telenet.be; helo=laurent.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 This patch series adds cross-compilation support to meson-build-system. meson-build-system is used by many gtk applications (sometimes directly, sometimes because a dependency uses meson-build-system). This has been tested with ./pre-inst-env guix build --target=i686-linux-gnu glib on a x86_64-linux system. The build succeeds, and "guix gc --references ..." looked reasonable to me. Meson cross-compilation is implemented by the last patch. The one-before-last patch works-around the brokenness of GCC cross-compilers on current core-updates (see ;). The first two patches define a few utilities target-linux?, target-x86-32? and target-x86-64? which are used by the last patch, but could be useful elsewhere as well. The third patch is used in various cross-compilation fixes. The other 34 patches are cross-compilation fixes for dependencies of glib, and follow-up patches making the package definitions somewhat nicer IMHO (like removing trailing #t from phases, and computing derivation for some architecture-independent packages when cross-compiling and compiling natively). Maxime Devos (37): utils: Define target-linux? predicate. utils: Define a target-x86-32? and target-x86-64? predicate. packages: Define this-package-input and this-package-native-input. net-base: Make #:builder argument a G-expression. net-base: Fix cross-compilation, eliminating %build-inputs & friends net-base: Don't cross-compile. tzdata: Don't bother with cross-compiling. libgpg-error: Remove trailing #f from phases. libgpg-error: Prevent silent miscompilation some systems. libgpgerror: Maybe fix a cross-compilation bug. libgpg-error: Fix cross-compilation error. libgcrypt: Fix cross-compilation build error. wrap-python3: Make #:builder a G-exp instead of a raw S-exp. wrap-python3: Fix cross-compilation. python: Fix reference to input when cross-compiling. openssl: Remove trailing #t from phases. openssl: Make the #:phases argument a G-expression. openssl: Use G-exp machinery for referring to outputs. openssl: Move documentation instead of copying and deleting it. openssl: Move all man pages to separate output, not only man3. openssl: Find bin/env when cross-compiling. openssl: Extract logic for computing CONFIGURE_TARGET_ARCH. readline: Make #:configure-flags a G-expression. readline: Fix build error when cross-compiling. bash: Make #:configure-flags a G-expression. bash: Fix cross-compilation build error. fontconfig: Make the #:configure-flags argument a G-expression. fontconfig: Fix build error when cross-compiling. glib: Use a correct python in scripts when cross-compiling. glib: Verify the cross-compiled python is used in installed scripts. glib: Look up "tzdata" in 'native-inputs', not 'inputs'. tk: Make #:configure-flags a G-expression. tk: Do not use %build-inputs when cross-compiling. libelf: Use the cross-compiler when cross-compiling. opendht: Correct 'nettle' variable name in inputs. cross-base: Fix cross-compiler for i686-linux-gnu. meson: Support cross-compilation. Makefile.am | 1 + gnu/packages/admin.scm | 44 ++++--- gnu/packages/base.scm | 9 ++ gnu/packages/bash.scm | 39 +++--- gnu/packages/cross-base.scm | 63 ++++++++- gnu/packages/elf.scm | 48 ++++--- gnu/packages/fontutils.scm | 8 +- gnu/packages/glib.scm | 34 ++++- gnu/packages/gnupg.scm | 60 ++++++--- gnu/packages/networking.scm | 2 +- gnu/packages/python.scm | 51 ++++---- gnu/packages/readline.scm | 27 ++-- gnu/packages/tcl.scm | 14 +- gnu/packages/tls.scm | 142 ++++++++++---------- guix/build-system/meson.scm | 200 ++++++++++++++++++++++++++--- guix/build/meson-configuration.scm | 71 ++++++++++ guix/packages.scm | 29 +++++ guix/utils.scm | 26 ++++ tests/packages.scm | 34 +++++ tests/utils.scm | 40 ++++++ 20 files changed, 728 insertions(+), 214 deletions(-) create mode 100644 guix/build/meson-configuration.scm base-commit: 92803cbef5affa3dbbf049262e1fcf290d8d8622