diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2026-01-18 10:29:24 +0100 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-03-06 14:52:03 +0100 |
| commit | 0c15434630c581fdc3e6e7d409f69d31a2ae0846 (patch) | |
| tree | 9df6e37a21c16afc66ed5878bcc2ab6e8c560e1e /gnu/packages/glib.scm | |
| parent | 87135e7d91f9039e2c368cda7bea6a516993317e (diff) | |
gnu: gobject-introspection: Wrap necessary binaries.
Python@3.12 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 <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu/packages/glib.scm')
| -rw-r--r-- | gnu/packages/glib.scm | 56 |
1 files changed, 47 insertions, 9 deletions
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index f33ae548b4d..e96239db384 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm | |||
| @@ -76,6 +76,7 @@ | |||
| 76 | #:use-module (gnu packages pkg-config) | 76 | #:use-module (gnu packages pkg-config) |
| 77 | #:use-module (gnu packages pretty-print) | 77 | #:use-module (gnu packages pretty-print) |
| 78 | #:use-module (gnu packages python) | 78 | #:use-module (gnu packages python) |
| 79 | #:use-module (gnu packages python-build) | ||
| 79 | #:use-module (gnu packages python-xyz) | 80 | #:use-module (gnu packages python-xyz) |
| 80 | #:use-module (gnu packages sqlite) | 81 | #:use-module (gnu packages sqlite) |
| 81 | #:use-module (gnu packages web) | 82 | #:use-module (gnu packages web) |
| @@ -639,6 +640,12 @@ be used when cross-compiling." | |||
| 639 | ;; as discussed here: https://issues.guix.gnu.org/50201#60. | 640 | ;; as discussed here: https://issues.guix.gnu.org/50201#60. |
| 640 | "-Dbuild_introspection_data=false")) | 641 | "-Dbuild_introspection_data=false")) |
| 641 | '()) | 642 | '()) |
| 643 | #:modules | ||
| 644 | ((guix build meson-build-system) | ||
| 645 | (guix build utils) | ||
| 646 | (ice-9 match) | ||
| 647 | (srfi srfi-1) | ||
| 648 | (srfi srfi-26)) | ||
| 642 | #:phases | 649 | #:phases |
| 643 | ,#~ | 650 | ,#~ |
| 644 | (modify-phases %standard-phases | 651 | (modify-phases %standard-phases |
| @@ -655,6 +662,33 @@ be used when cross-compiling." | |||
| 655 | (substitute* "tools/g-ir-tool-template.in" | 662 | (substitute* "tools/g-ir-tool-template.in" |
| 656 | (("#!@PYTHON_CMD@") | 663 | (("#!@PYTHON_CMD@") |
| 657 | (string-append "#!" (which "python3")))))) | 664 | (string-append "#!" (which "python3")))))) |
| 665 | ;; Copy the site-packages procedure rather than importing them to | ||
| 666 | ;; maintain pyproject/glib-or-gtk build-systems'independence. | ||
| 667 | (add-after 'install 'wrap | ||
| 668 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 669 | (define (search-input-directories pred dir) | ||
| 670 | (filter pred | ||
| 671 | (map (match-lambda | ||
| 672 | ((name . directory) | ||
| 673 | (string-append directory "/" dir))) | ||
| 674 | inputs))) | ||
| 675 | (let* ((version #$(version-major+minor | ||
| 676 | (package-version | ||
| 677 | (this-package-input "python")))) | ||
| 678 | (site-path (string-append "lib/python" version | ||
| 679 | "/site-packages")) | ||
| 680 | ;; Remove meson, but keep the rest. | ||
| 681 | (pred (lambda (dir) | ||
| 682 | (and (directory-exists? dir) | ||
| 683 | (string-contains dir "python-")))) | ||
| 684 | (paths (search-input-directories pred site-path))) | ||
| 685 | (for-each | ||
| 686 | (cute wrap-program <> | ||
| 687 | `("GUIX_PYTHONPATH" ":" prefix | ||
| 688 | (,(string-join paths ":")))) | ||
| 689 | ;; These require access to python-setuptools site-packages. | ||
| 690 | (list (search-input-file outputs "/bin/g-ir-annotation-tool") | ||
| 691 | (search-input-file outputs "/bin/g-ir-scanner")))))) | ||
| 658 | #$@(if (%current-target-system) | 692 | #$@(if (%current-target-system) |
| 659 | ;; Meson gives python extensions an incorrect name, see | 693 | ;; Meson gives python extensions an incorrect name, see |
| 660 | ;; <https://github.com/mesonbuild/meson/issues/7049>. | 694 | ;; <https://github.com/mesonbuild/meson/issues/7049>. |
| @@ -666,20 +700,22 @@ be used when cross-compiling." | |||
| 666 | "/_giscanner")))) | 700 | "/_giscanner")))) |
| 667 | #~())))) | 701 | #~())))) |
| 668 | (native-inputs | 702 | (native-inputs |
| 669 | `(,@(if (%current-target-system) | 703 | (cons* |
| 670 | `(("python" ,python)) | 704 | bison |
| 671 | '()) | 705 | flex |
| 672 | ("glib" ,glib-minimal "bin") | 706 | (list glib-minimal "bin") |
| 673 | ("pkg-config" ,pkg-config) | 707 | pkg-config |
| 674 | ("bison" ,bison) | 708 | (if (%current-target-system) |
| 675 | ("flex" ,flex))) | 709 | (list python) |
| 710 | (list)))) | ||
| 676 | (inputs | 711 | (inputs |
| 677 | (list python zlib)) | 712 | (list python zlib)) |
| 678 | (propagated-inputs | 713 | (propagated-inputs |
| 679 | (list glib-minimal | 714 | (list glib-minimal |
| 680 | ;; In practice, GIR users will need libffi when using | 715 | ;; In practice, GIR users will need libffi when using |
| 681 | ;; gobject-introspection. | 716 | ;; gobject-introspection. |
| 682 | libffi)) | 717 | libffi |
| 718 | python-setuptools-bootstrap)) | ||
| 683 | (native-search-paths | 719 | (native-search-paths |
| 684 | (list | 720 | (list |
| 685 | (search-path-specification | 721 | (search-path-specification |
| @@ -708,7 +744,9 @@ provide bindings to call into the C library.") | |||
| 708 | (replace "glib" glib))) | 744 | (replace "glib" glib))) |
| 709 | (propagated-inputs | 745 | (propagated-inputs |
| 710 | (modify-inputs (package-propagated-inputs base) | 746 | (modify-inputs (package-propagated-inputs base) |
| 711 | (replace "glib" glib)))))) | 747 | (replace "glib" glib) |
| 748 | ;; Note: The label stays the same despite the name change. | ||
| 749 | (replace "python-setuptools-bootstrap" python-setuptools)))))) | ||
| 712 | 750 | ||
| 713 | (define intltool | 751 | (define intltool |
| 714 | (package | 752 | (package |
