gnu: r-qtl2: Move to (gnu packages cran).
[jackhill/guix/guix.git] / guix / build-system / glib-or-gtk.scm
index 8091311..fb1f8fb 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
 ;;;
   #:use-module (guix store)
   #:use-module (guix utils)
   #:use-module (guix derivations)
+  #:use-module (guix search-paths)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
   #:use-module (guix packages)
   #:use-module (ice-9 match)
-  #:export (glib-or-gtk-build
+  #:export (%glib-or-gtk-build-system-modules
+            glib-or-gtk-build
             glib-or-gtk-build-system))
 
 ;; Commentary:
 ;;
 ;; 'glib-or-gtk-wrap' phase:
 ;;
-;; a) This phase looks for GSettings schemas by verifying the existence of
-;; path "datadir/glib-2.0/schemas" in all input packages.  If the path is
-;; found in any package, then all programs in "out/bin" are wrapped in scripts
-;; where the environment variable "XDG_DATA_DIRS" is set and points to the
-;; list of found schemas directories.
+;; a) This phase looks for GSettings schemas, GIO modules and theming data.
+;; If any of these is found in any input package, then all programs in
+;; "out/bin" are wrapped in scripts defining the nedessary environment
+;; variables.
 ;;
 ;; b) Looks for the existence of "libdir/gtk-3.0" directories in all input
 ;; packages.  If any is found, then the environment variable "GTK_PATH" is
   '((guix build glib-or-gtk-build-system)
     (guix build utils)))
 
-(define %default-imported-modules
+(define %glib-or-gtk-build-system-modules
   ;; Build-side modules imported and used by default.
-  '((guix build gnu-build-system)
-    (guix build glib-or-gtk-build-system)
-    (guix build utils)))
+  `((guix build glib-or-gtk-build-system)
+    ,@%gnu-build-system-modules))
 
 (define (default-glib)
   "Return the default glib package from which we use
@@ -78,7 +78,8 @@
 
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
-                (glib (default-glib)) (implicit-inputs? #t)
+                (glib (default-glib))
+                (implicit-inputs? #t)
                 (strip-binaries? #t)
                 #:allow-other-keys
                 #:rest arguments)
        (bag
          (name name)
          (system system)
-         (host-inputs `(,@(if source
-                              `(("source" ,source))
-                              '())
-                        ,@inputs))
-         (build-inputs `(("glib:bin" ,glib)
+         (host-inputs (if source
+                          `(("source" ,source))
+                          '()))
+         (build-inputs `(,@native-inputs
+                         ,@inputs
+                         ("glib:bin" ,glib "bin") ; to compile schemas
                          ,@(if implicit-inputs?
                                (standard-packages)
-                               '())
-                         ,@native-inputs))
+                               '())))
          (outputs outputs)
          (build glib-or-gtk-build)
          (arguments (strip-keyword-arguments private-keywords arguments)))))
                             (outputs '("out"))
                             (search-paths '())
                             (configure-flags ''())
-                            (make-flags ''())
-                            (out-of-source? #t)
+                            ;; Disable icon theme cache generation.
+                            (make-flags ''("gtk_update_icon_cache=true"))
+                            (out-of-source? #f)
                             (tests? #t)
                             (test-target "check")
                             (parallel-build? #t)
                             (parallel-tests? #t)
+                            (validate-runpath? #t)
                             (patch-shebangs? #t)
                             (strip-binaries? #t)
                             (strip-flags ''("--strip-debug"))
                                         %standard-phases))
                             (glib-or-gtk-wrap-excluded-outputs ''())
                             (system (%current-system))
-                            (imported-modules %default-imported-modules)
+                            (imported-modules %glib-or-gtk-build-system-modules)
                             (modules %default-modules)
-                            allowed-references)
+                            allowed-references
+                            disallowed-references)
   "Build SOURCE with INPUTS.  See GNU-BUILD for more details."
   (define canonicalize-reference
     (match-lambda
                           #:test-target ,test-target
                           #:parallel-build? ,parallel-build?
                           #:parallel-tests? ,parallel-tests?
+                          #:validate-runpath? ,validate-runpath?
                           #:patch-shebangs? ,patch-shebangs?
                           #:strip-binaries? ,strip-binaries?
                           #:strip-flags ,strip-flags
                                 (and allowed-references
                                      (map canonicalize-reference
                                           allowed-references))
+                                #:disallowed-references
+                                (and disallowed-references
+                                     (map canonicalize-reference
+                                          disallowed-references))
                                 #:guile-for-build guile-for-build))
 
 (define glib-or-gtk-build-system