build-system/glib-or-gtk: Correctly handle multiple-output packages.
* guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): Move body to 'handle-output' inner procedure, and parametrize it by output name and directory. Call it for each element of OUTPUTS. (compile-glib-schemas): Likewise.
This commit is contained in:
parent
4efdabb810
commit
c8b7569558
|
@ -83,15 +83,19 @@ a list with all found directories."
|
||||||
"Implement phase \"glib-or-gtk-wrap\": look for GSettings schemas and
|
"Implement phase \"glib-or-gtk-wrap\": look for GSettings schemas and
|
||||||
gtk+-v.0 libraries and create wrappers with suitably set environment variables
|
gtk+-v.0 libraries and create wrappers with suitably set environment variables
|
||||||
if found."
|
if found."
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(define handle-output
|
||||||
(bindir (string-append out "/bin"))
|
(match-lambda
|
||||||
|
((output . directory)
|
||||||
|
(let* ((bindir (string-append directory "/bin"))
|
||||||
(bin-list (find-files bindir ".*"))
|
(bin-list (find-files bindir ".*"))
|
||||||
(schemas (schemas-directories (acons "out" out inputs)))
|
(schemas (schemas-directories
|
||||||
|
(alist-cons output directory inputs)))
|
||||||
|
(gtk-mod-dirs (gtk-module-directories
|
||||||
|
(alist-cons output directory inputs)))
|
||||||
(schemas-env-var
|
(schemas-env-var
|
||||||
(if (not (null? schemas))
|
(if (not (null? schemas))
|
||||||
`("XDG_DATA_DIRS" ":" prefix ,schemas)
|
`("XDG_DATA_DIRS" ":" prefix ,schemas)
|
||||||
#f))
|
#f))
|
||||||
(gtk-mod-dirs (gtk-module-directories (acons "out" out inputs)))
|
|
||||||
(gtk-mod-env-var
|
(gtk-mod-env-var
|
||||||
(if (not (null? gtk-mod-dirs))
|
(if (not (null? gtk-mod-dirs))
|
||||||
`("GTK_PATH" ":" prefix ,gtk-mod-dirs)
|
`("GTK_PATH" ":" prefix ,gtk-mod-dirs)
|
||||||
|
@ -105,19 +109,24 @@ if found."
|
||||||
bin-list))
|
bin-list))
|
||||||
(gtk-mod-env-var
|
(gtk-mod-env-var
|
||||||
(for-each (cut wrap-program <> gtk-mod-env-var)
|
(for-each (cut wrap-program <> gtk-mod-env-var)
|
||||||
bin-list)))
|
bin-list)))))))
|
||||||
#t))
|
|
||||||
|
|
||||||
(define* (compile-glib-schemas #:key inputs outputs #:allow-other-keys)
|
(for-each handle-output outputs)
|
||||||
|
#t)
|
||||||
|
|
||||||
|
(define* (compile-glib-schemas #:key outputs #:allow-other-keys)
|
||||||
"Implement phase \"glib-or-gtk-compile-schemas\": compile \"glib\" schemas
|
"Implement phase \"glib-or-gtk-compile-schemas\": compile \"glib\" schemas
|
||||||
if needed."
|
if needed."
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(every (match-lambda
|
||||||
(schemasdir (string-append out "/share/glib-2.0/schemas")))
|
((output . directory)
|
||||||
|
(let ((schemasdir (string-append directory
|
||||||
|
"/share/glib-2.0/schemas")))
|
||||||
(if (and (directory-exists? schemasdir)
|
(if (and (directory-exists? schemasdir)
|
||||||
(not (file-exists?
|
(not (file-exists?
|
||||||
(string-append schemasdir "/gschemas.compiled"))))
|
(string-append schemasdir "/gschemas.compiled"))))
|
||||||
(system* "glib-compile-schemas" schemasdir)
|
(zero? (system* "glib-compile-schemas" schemasdir))
|
||||||
#t)))
|
#t))))
|
||||||
|
outputs))
|
||||||
|
|
||||||
(define %standard-phases
|
(define %standard-phases
|
||||||
(alist-cons-after
|
(alist-cons-after
|
||||||
|
|
Loading…
Reference in New Issue