From: Vivien Kraus via Guix-patches via <guix-patches@gnu.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 51948@debbugs.gnu.org
Subject: [bug#51948] [PATCH] Meson needs proper wrapping
Date: Fri, 19 Nov 2021 23:34:19 +0100 [thread overview]
Message-ID: <8735nrahwc.fsf@planete-kraus.eu> (raw)
In-Reply-To: <87zgpzhjta.fsf@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 830 bytes --]
Ludovic Courtès <ludo@gnu.org> 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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Meson is now hidden, the wrapped version is not --]
[-- Type: text/x-patch, Size: 2327 bytes --]
From 3f77d8d5c652725411a21434443cbf2a2d135575 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 658 bytes --]
next prev parent reply other threads:[~2021-11-19 22:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 14:23 [bug#51948] [PATCH] Meson needs proper wrapping Vivien Kraus via Guix-patches via
[not found] ` <handler.51948.B.16372454395205.ack@debbugs.gnu.org>
2021-11-18 16:00 ` [bug#51948] Acknowledgement ([PATCH] Meson needs proper wrapping) Vivien Kraus via Guix-patches via
2021-11-19 13:12 ` [bug#51948] [PATCH] Meson needs proper wrapping Ludovic Courtès
2021-11-19 13:20 ` Vivien Kraus via Guix-patches via
2021-11-19 22:17 ` Ludovic Courtès
2021-11-19 22:34 ` Vivien Kraus via Guix-patches via [this message]
2021-11-22 21:44 ` bug#51948: [PATCH] [core-updates-frozen] Wrap meson with python code Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8735nrahwc.fsf@planete-kraus.eu \
--to=guix-patches@gnu.org \
--cc=51948@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=vivien@planete-kraus.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).