[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
325/402: build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper.
From: |
guix-commits |
Subject: |
325/402: build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper. |
Date: |
Tue, 18 Aug 2020 16:48:15 -0400 (EDT) |
dannym pushed a commit to branch wip-desktop
in repository guix.
commit c855ee058d1e8277190d8c09c1e0bc74d5229662
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)
- 306/402: gnu: Add latex2html., (continued)
- 306/402: gnu: Add latex2html., guix-commits, 2020/08/18
- 310/402: gnu: gst-editing-services: Update package definition., guix-commits, 2020/08/18
- 315/402: gnu: totem: Update package definition., guix-commits, 2020/08/18
- 313/402: gnu: libmusicbrainz: Propagate inputs., guix-commits, 2020/08/18
- 316/402: gnu: wayland: Update package definition., guix-commits, 2020/08/18
- 324/402: gnu: gnome-shell: Update package definition., guix-commits, 2020/08/18
- 320/402: gnu: Add mozjs-68., guix-commits, 2020/08/18
- 312/402: gnu: simple-scan: Update package definition., guix-commits, 2020/08/18
- 319/402: gnu: Add egl-wayland., guix-commits, 2020/08/18
- 317/402: gnu: wayland-protocols: Update package definition., guix-commits, 2020/08/18
- 325/402: build-system/glib-or-gtk: Include GI_TYPELIB_PATH in wrapper.,
guix-commits <=
- 327/402: build-system/python: Also wrap executables that are in "libexec"., guix-commits, 2020/08/18
- 330/402: gnu: gnome: Revise package definition., guix-commits, 2020/08/18
- 331/402: gnu: Add gnome-minimal., guix-commits, 2020/08/18
- 334/402: build-system/cmake: Only include phases that are enabled., guix-commits, 2020/08/18
- 335/402: gnu: gdm: Fix elogind., guix-commits, 2020/08/18
- 336/402: gnu: flatpak: Fix build., guix-commits, 2020/08/18
- 337/402: gnu: at-spi2-core: Include python phases., guix-commits, 2020/08/18
- 338/402: gnu: dconf: Include python phases., guix-commits, 2020/08/18
- 339/402: gnu: fcitx: Include glib-or-gtk and python phases., guix-commits, 2020/08/18
- 340/402: gnu: gcr: Include python phases., guix-commits, 2020/08/18