guix_mirror_bot pushed a commit to branch gnome-team
in repository guix.

commit 67b4f3c718b013781997d380639f9f26b546743e
Author: Nicolas Graves <[email protected]>
AuthorDate: Sun Jan 18 10:29:24 2026 +0100

    gnu: gobject-introspection: Wrap necessary binaries.
    
    [email protected] removes the distutils module, which now has to be provided
    through python-setuptools.
    
    * gnu/packages/glib.scm (goject-introspection-minimal)
    [arguments]<#:phases>: Add phase 'wrap.
    <#:modules>: Adjust them accordingly.
    [native-inputs]: Improve style.
    [propagated-inputs]: Add python-setuptools-bootstrap.
    (gobject-introspection)[propagated-inputs]: Replace
    python-setuptools-bootstrap by python-setuptools.
    
    Signed-off-by: Liliana Marie Prikler <[email protected]>
---
 gnu/packages/glib.scm | 44 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 35 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index a86c5da038..17af7a3909 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -76,6 +76,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages web)
@@ -637,6 +638,10 @@ be used when cross-compiling."
                  ;; as discussed here: https://issues.guix.gnu.org/50201#60.
                  "-Dbuild_introspection_data=false"))
              '())
+       #:modules
+       ((guix build meson-build-system)
+        (guix build utils)
+        (srfi srfi-26))
        #:phases
        ,#~
        (modify-phases %standard-phases
@@ -653,6 +658,23 @@ be used when cross-compiling."
              (substitute* "tools/g-ir-tool-template.in"
                (("#!@PYTHON_CMD@")
                 (string-append "#!" (which "python3"))))))
+         ;; Copy the site-packages procedure rather than importing them to
+         ;; maintain pyproject/glib-or-gtk build-systems'independence.
+         (add-after 'install 'wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (cute wrap-program <>
+                    `("GUIX_PYTHONPATH" ":" prefix
+                      (,(string-append
+                         (assoc-ref inputs "python-setuptools-bootstrap")
+                         "/lib/python"
+                         #$(version-major+minor
+                            (package-version
+                             (this-package-input "python")))
+                         "/site-packages"))))
+              ;; Require access to python-setuptools site-packages.
+              (list (search-input-file outputs "/bin/g-ir-annotation-tool")
+                    (search-input-file outputs "/bin/g-ir-scanner")))))
          #$@(if (%current-target-system)
                ;; Meson gives python extensions an incorrect name, see
                ;; <https://github.com/mesonbuild/meson/issues/7049>.
@@ -664,20 +686,22 @@ be used when cross-compiling."
                                           "/_giscanner"))))
                 #~()))))
     (native-inputs
-     `(,@(if (%current-target-system)
-           `(("python" ,python))
-           '())
-       ("glib" ,glib-minimal "bin")
-       ("pkg-config" ,pkg-config)
-       ("bison" ,bison)
-       ("flex" ,flex)))
+     (cons*
+      bison
+      flex
+      (list glib-minimal "bin")
+      pkg-config
+      (if (%current-target-system)
+          (list python)
+          (list))))
     (inputs
      (list python zlib))
     (propagated-inputs
      (list glib-minimal
            ;; In practice, GIR users will need libffi when using
            ;; gobject-introspection.
-           libffi))
+           libffi
+           python-setuptools-bootstrap))
     (native-search-paths
      (list
       (search-path-specification
@@ -706,7 +730,9 @@ provide bindings to call into the C library.")
          (replace "glib" glib)))
       (propagated-inputs
        (modify-inputs (package-propagated-inputs base)
-         (replace "glib" glib))))))
+         (replace "glib" glib)
+         ;; Note: The label stays the same despite the name change.
+         (replace "python-setuptools-bootstrap" python-setuptools))))))
 
 (define intltool
   (package

Reply via email to