From patchwork Fri Nov 19 22:34:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 34652 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 7199227BBE3; Fri, 19 Nov 2021 22:41:14 +0000 (GMT) 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, 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 D26FA27BBE1 for ; Fri, 19 Nov 2021 22:41:13 +0000 (GMT) Received: from localhost ([::1]:58320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moCZE-0006C0-Sf for patchwork@mira.cbaines.net; Fri, 19 Nov 2021 17:41:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moCZ4-0006BY-Rl for guix-patches@gnu.org; Fri, 19 Nov 2021 17:41:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:57428) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moCZ4-0003pm-K6 for guix-patches@gnu.org; Fri, 19 Nov 2021 17:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moCZ4-0006B3-FO for guix-patches@gnu.org; Fri, 19 Nov 2021 17:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51948] [PATCH] Meson needs proper wrapping Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 19 Nov 2021 22:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51948 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?utf-8?q?Court=C3=A8s?= Cc: 51948@debbugs.gnu.org Received: via spool by 51948-submit@debbugs.gnu.org id=B51948.163736164323709 (code B ref 51948); Fri, 19 Nov 2021 22:41:02 +0000 Received: (at 51948) by debbugs.gnu.org; 19 Nov 2021 22:40:43 +0000 Received: from localhost ([127.0.0.1]:40741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moCYl-0006AL-E1 for submit@debbugs.gnu.org; Fri, 19 Nov 2021 17:40:43 -0500 Received: from planete-kraus.eu ([89.234.140.182]:57540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moCYj-0006A9-EN for 51948@debbugs.gnu.org; Fri, 19 Nov 2021 17:40:42 -0500 Received: from planete-kraus.eu (localhost.lan [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 080a6269; Fri, 19 Nov 2021 22:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= references:from:to:cc:subject:date:in-reply-to:message-id :mime-version:content-type; s=dkim; bh=zL7QAf8jEX9TBGbHUwk2n7kqA a0=; b=tCHIMn9jex08MZptH0x1HVDZ5mFDJoXixmyZB96WhaNxyvO1fqlkol1F0 SGE05Ryq151PArAaGN2t1V01kDNaOwy9HwMUb1ic3FetJtpqMelp7xnt2fmfWPFo uhbo1HGCEOC+NVbYYkTyaXj+xULpvlmk2PsqXR7fS+RdMrSpLQ= Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id e86cd1ee (TLSv1.3:AEAD-CHACHA20-POLY1305-SHA256:256:NO); Fri, 19 Nov 2021 22:40:36 +0000 (UTC) References: <87r1bda6ff.fsf@planete-kraus.eu> <8735nsmgqc.fsf@gnu.org> <877dd49rnn.fsf@planete-kraus.eu> <87zgpzhjta.fsf@gnu.org> User-agent: mu4e 1.6.10; emacs 27.2 Date: Fri, 19 Nov 2021 23:34:19 +0100 In-reply-to: <87zgpzhjta.fsf@gnu.org> Message-ID: <8735nrahwc.fsf@planete-kraus.eu> MIME-Version: 1.0 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" Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches X-Patchwork-Original-From: Vivien Kraus via Guix-patches via From: Vivien Kraus X-getmail-retrieved-from-mailbox: Patches Ludovic Courtès writes: >> I pushed an update that does precisely that. Is the name "meson-wrapped" >> OK? Also, how can I influence guix to rather install the wrapped version >> when the user invokes "guix install meson"? > > I you just add another meson@0.60 package like this patch does, the UI > will complain that “meson@0.60” is ambiguous, that there are two of them. > > To work around it, I’d mark the unwrapped meson@0.60 as hidden (using > the ‘properties’ field) while keeping the other one visible. > > That way “guix install meson” will install the wrapped one. I think that’s good: I build it with guix shell meson or guix build meson, and I can run its absolute file name in a guix shell --pure gcc. However, it does not seem to cause a world rebuild. Vivien From 3f77d8d5c652725411a21434443cbf2a2d135575 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Thu, 18 Nov 2021 15:17:52 +0100 Subject: [PATCH] gnu: meson: Extend the python path in the installed program. * gnu/packages/build-tools.scm (meson-wrapped): New variable. --- gnu/packages/build-tools.scm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm index 849101c2a4..6a8a9c6f66 100644 --- a/gnu/packages/build-tools.scm +++ b/gnu/packages/build-tools.scm @@ -287,6 +287,7 @@ (define-public meson (inputs `(("ninja" ,ninja))) (propagated-inputs `(("python" ,python))) (home-page "https://mesonbuild.com/") + (properties '((hidden? . #t))) (synopsis "Build system designed to be fast and user-friendly") (description "The Meson build system is focused on user-friendliness and speed. @@ -297,6 +298,29 @@ (define-public meson resembles Python.") (license license:asl2.0))) +(define-public meson-wrapped + (package/inherit meson + (arguments + `(;; FIXME: Tests require many additional inputs and patching many + ;; hard-coded file system locations in "run_unittests.py". + #:tests? #f + #:phases (modify-phases %standard-phases + ;; Meson calls the various executables in out/bin through the + ;; Python interpreter, so we cannot use the shell wrapper. + (replace 'wrap + (lambda* (#:key outputs inputs #:allow-other-keys) + (let ((python-version + (python-version (assoc-ref inputs "python"))) + (output (assoc-ref outputs "out"))) + (substitute* (string-append output "/bin/meson") + (("# EASY-INSTALL-ENTRY-SCRIPT") + (format #f "\ +import sys +sys.path.insert(0, '~a/lib/python~a/site-packages') +# EASY-INSTALL-ENTRY-SCRIPT" + output python-version))))))))) + (properties '()))) + ;;; This older Meson variant is kept for now for gtkmm and others that may ;;; have problems with 0.60. (define-public meson-0.59 -- 2.34.0