unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Vivien Kraus via Guix-patches via <guix-patches@gnu.org>
To: 51948@debbugs.gnu.org
Subject: [bug#51948] Acknowledgement ([PATCH] Meson needs proper wrapping)
Date: Thu, 18 Nov 2021 17:00:25 +0100	[thread overview]
Message-ID: <87mtm1a1wx.fsf@planete-kraus.eu> (raw)
In-Reply-To: <handler.51948.B.16372454395205.ack@debbugs.gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 87 bytes --]


If I put the code in a new variable, we avoid a world rebuild, is it
better?

Vivien


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: New meson-wrapped package --]
[-- Type: text/x-patch, Size: 2089 bytes --]

From f25082c0a695734aaada2d286ef1770de5f99c2b 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 | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/build-tools.scm b/gnu/packages/build-tools.scm
index 849101c2a4..646e28e0c6 100644
--- a/gnu/packages/build-tools.scm
+++ b/gnu/packages/build-tools.scm
@@ -297,6 +297,31 @@ (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 #:allow-other-keys)
+                      (let ((path (string-split (getenv "GUIX_PYTHONPATH") #\:)))
+                        (substitute* (string-append (assoc-ref outputs "out") "/bin/meson")
+                          (("# EASY-INSTALL-ENTRY-SCRIPT")
+                           (format #f "\
+import sys
+~a
+# EASY-INSTALL-ENTRY-SCRIPT"
+                                   (string-join
+                                    (map (lambda (path)
+                                           (format #f "sys.path.insert(0, '~a')"
+                                                   path))
+                                         (reverse path))
+                                    "\n"))))))))))))
+
 ;;; 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 --]

  parent reply	other threads:[~2021-11-18 16:02 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   ` Vivien Kraus via Guix-patches via [this message]
2021-11-19 13:12 ` 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
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=87mtm1a1wx.fsf@planete-kraus.eu \
    --to=guix-patches@gnu.org \
    --cc=51948@debbugs.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).