[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
325/401: build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper.
From: |
guix-commits |
Subject: |
325/401: build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper. |
Date: |
Tue, 18 Aug 2020 16:22:09 -0400 (EDT) |
dannym pushed a commit to branch wip-desktop
in repository guix.
commit 3eb5e9472cbd0d39d055ca565080f10dc32d9494
Author: Raghav Gururajan <raghavgururajan@disroot.org>
AuthorDate: Wed Aug 12 05:54:54 2020 -0400
build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper.
* guix/build/glib-or-gtk-build-system.scm (gi-typelib-directories): New
variable.
(wrap-all-programs): Include GI_TYPELIB_PATH in wrapper.
Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
guix/build/glib-or-gtk-build-system.scm | 64 ++++++++++++++++-----------------
1 file changed, 30 insertions(+), 34 deletions(-)
diff --git a/guix/build/glib-or-gtk-build-system.scm
b/guix/build/glib-or-gtk-build-system.scm
index ba680fd..d69fe66 100644
--- a/guix/build/glib-or-gtk-build-system.scm
+++ b/guix/build/glib-or-gtk-build-system.scm
@@ -125,6 +125,21 @@ returns a list with all found directories."
(fold gio-module-directory '() inputs))
+;; For wrapping GI_TYPELIB_PATH.
+(define (gi-typelib-directories inputs)
+ "Check for the existence of \"$libdir/girepository-1.0\" in the INPUTS and
+returns a list with all found directories."
+ (define (gi-typelib-directory input previous)
+ (let* ((in (match input
+ ((_ . dir) dir)
+ (_ "")))
+ (gi-typelib-dir (string-append in "/lib/girepository-1.0")))
+ (if (and (directory-exists? gi-typelib-dir)
+ (not (directory-included? gi-typelib-dir previous)))
+ (cons gi-typelib-dir previous)
+ previous)))
+ (fold gi-typelib-directory '() inputs))
+
(define* (wrap-all-programs #:key inputs outputs
(glib-or-gtk-wrap-excluded-outputs '())
#:allow-other-keys)
@@ -150,6 +165,8 @@ add a dependency of that output on GLib and GTK+."
(alist-cons output directory inputs)))
(gio-mod-dirs (gio-module-directories
(alist-cons output directory inputs)))
+ (gi-typelib-dirs (gi-typelib-directories
+ (alist-cons output directory inputs)))
(data-env-var
(if (not (null? datadirs))
`("XDG_DATA_DIRS" ":" prefix ,datadirs)
@@ -161,41 +178,20 @@ add a dependency of that output on GLib and GTK+."
(gio-mod-env-var
(if (not (null? gio-mod-dirs))
`("GIO_EXTRA_MODULES" ":" prefix ,gio-mod-dirs)
+ #f))
+ (gi-typelib-env-var
+ (if (not (null? gi-typelib-dirs))
+ `("GI_TYPELIB_PATH" ":" prefix ,gi-typelib-dirs)
#f)))
- (cond
- ((and data-env-var gtk-mod-env-var gio-mod-env-var)
- (for-each (cut wrap-program <>
- data-env-var
- gtk-mod-env-var
- gio-mod-env-var)
- bin-list))
- ((and data-env-var gtk-mod-env-var (not gio-mod-env-var))
- (for-each (cut wrap-program <>
- data-env-var
- gtk-mod-env-var)
- bin-list))
- ((and data-env-var (not gtk-mod-env-var) gio-mod-env-var)
- (for-each (cut wrap-program <>
- data-env-var
- gio-mod-env-var)
- bin-list))
- ((and (not data-env-var) gtk-mod-env-var gio-mod-env-var)
- (for-each (cut wrap-program <>
- gio-mod-env-var
- gtk-mod-env-var)
- bin-list))
- ((and data-env-var (not gtk-mod-env-var) (not gio-mod-env-var))
- (for-each (cut wrap-program <>
- data-env-var)
- bin-list))
- ((and (not data-env-var) gtk-mod-env-var (not gio-mod-env-var))
- (for-each (cut wrap-program <>
- gtk-mod-env-var)
- bin-list))
- ((and (not data-env-var) (not gtk-mod-env-var) gio-mod-env-var)
- (for-each (cut wrap-program <>
- gio-mod-env-var)
- bin-list))))))))
+ (let ((specifications
+ (filter identity
+ (list data-env-var gtk-mod-env-var gio-mod-env-var
+ gi-typelib-env-var))))
+ (if specifications
+ (for-each (lambda (original)
+ (apply wrap-program original specifications))
+ bin-list)
+ (error "refusing to wrap when not given environment variables
to set"))))))))
(for-each handle-output outputs)
#t)
- 369/401: gnu: gnome-boxes: Include python phases., (continued)
- 369/401: gnu: gnome-boxes: Include python phases., guix-commits, 2020/08/18
- 377/401: gnu: ccextractor: Include python phases., guix-commits, 2020/08/18
- 383/401: gnu: eog: Remove custom typelib wrap., guix-commits, 2020/08/18
- 398/401: Revert "gnu: libpeas: Include python phases.", guix-commits, 2020/08/18
- 399/401: Revert "gnu: gexiv2: Include python phases.", guix-commits, 2020/08/18
- 401/401: gnu: Add gnome desktop services., guix-commits, 2020/08/18
- 236/401: gnu: opencv: Disable structured_light test., guix-commits, 2020/08/18
- 316/401: gnu: wayland: Update package definition., guix-commits, 2020/08/18
- 318/401: gnu: Add eglexternalplatform., guix-commits, 2020/08/18
- 320/401: gnu: Add mozjs-68., guix-commits, 2020/08/18
- 325/401: build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper.,
guix-commits <=
- 329/401: build-system/cmake: Wrap Python executables, too., guix-commits, 2020/08/18
- 333/401: build-system/meson: Only include phases that are enabled., guix-commits, 2020/08/18
- 343/401: gnu: graphene: Include python phases., guix-commits, 2020/08/18
- 361/401: gnu: gom: Include python phases., guix-commits, 2020/08/18
- 364/401: gnu: libchamplain: Include python phases., guix-commits, 2020/08/18
- 365/401: gnu: libpeas: Include python phases., guix-commits, 2020/08/18
- 378/401: gnu: mediasdk: Include python phases., guix-commits, 2020/08/18
- 389/401: gnu: gedit: Replace custom typelib and python wraps., guix-commits, 2020/08/18
- 394/401: gnu: seed: Disable tests., guix-commits, 2020/08/18
- 298/401: gnu: gnome-terminal: Update package definition., guix-commits, 2020/08/18