guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

333/402: build-system/meson: Only include phases that are enabled.


From: guix-commits
Subject: 333/402: build-system/meson: Only include phases that are enabled.
Date: Tue, 18 Aug 2020 16:48:17 -0400 (EDT)

dannym pushed a commit to branch wip-desktop
in repository guix.

commit ccaa81eb4b7692d29aea7ef4daef78387ee5b60b
Author: Raghav Gururajan <raghavgururajan@disroot.org>
AuthorDate: Sat Aug 15 13:06:33 2020 +0200

    build-system/meson: Only include phases that are enabled.
    
    Follow-up to 2b6a10273f2cc7b3bcefd92894f0018d99396077.
    
    * guix/build-system/meson.scm (lower): Remove #:glib-or-gtk? and #:python?
    from private-keywords.
    (meson-build): Only include phases that are enabled.
    Remove #:glib-or-gtk? and #:python? from build-side call.
    * guix/build/meson-build-system.scm (install-glib-or-gtk): Make it
    unconditional.
    (install-python): Make it unconditional.
    
    Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 guix/build-system/meson.scm       | 20 ++++++++++++++++----
 guix/build/meson-build-system.scm | 15 +++++----------
 2 files changed, 21 insertions(+), 14 deletions(-)

diff --git a/guix/build-system/meson.scm b/guix/build-system/meson.scm
index 9a38cdb..db99c45 100644
--- a/guix/build-system/meson.scm
+++ b/guix/build-system/meson.scm
@@ -63,11 +63,13 @@
                 #:key source inputs native-inputs outputs system target
                 (meson (default-meson))
                 (ninja (default-ninja))
+                glib-or-gtk?
+                python?
                 #:allow-other-keys
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    `(#:source #:meson #:ninja #:inputs #:native-inputs #:outputs #:target 
#:glib-or-gtk? #:python?))
+    `(#:source #:meson #:ninja #:inputs #:native-inputs #:outputs #:target))
 
   (and (not target) ;; TODO: add support for cross-compilation.
        (bag
@@ -131,7 +133,19 @@ has a 'meson.build' file."
       output)))
 
   (define builder
-    `(let ((build-phases ,phases))
+    `(let ((build-phases ,(cond
+                           ((and glib-or-gtk? python?)
+                            phases)
+                           ((and glib-or-gtk? (not python?))
+                            `(modify-phases ,phases
+                               (delete 'install-python)))
+                           ((and (not glib-or-gtk?) python?)
+                            `(modify-phases ,phases
+                               (delete 'install-glib-or-gtk)))
+                           ((and (not glib-or-gtk?) (not python?))
+                            `(modify-phases ,phases
+                               (delete 'install-python)
+                               (delete 'install-glib-or-gtk))))))
        (use-modules ,@modules)
        (meson-build #:source ,(match (assoc-ref inputs "source")
                                 (((? derivation? source))
@@ -149,8 +163,6 @@ has a 'meson.build' file."
                     #:configure-flags ,configure-flags
                     #:build-type ,build-type
                     #:tests? ,tests?
-                    #:glib-or-gtk? ,glib-or-gtk?
-                    #:python? ,python?
                     #:test-target ,test-target
                     #:parallel-build? ,parallel-build?
                     #:parallel-tests? ,parallel-tests?
diff --git a/guix/build/meson-build-system.scm 
b/guix/build/meson-build-system.scm
index 01e0b47..4c325ab 100644
--- a/guix/build/meson-build-system.scm
+++ b/guix/build/meson-build-system.scm
@@ -78,17 +78,12 @@
 (define* (install #:rest args)
   (invoke "ninja" "install"))
 
-(define* (install-glib-or-gtk #:key glib-or-gtk? #:allow-other-keys #:rest 
rest)
-  (if glib-or-gtk?
-      (and
-       (apply (assoc-ref glib-or-gtk:%standard-phases 
'glib-or-gtk-compile-schemas) rest)
-       (apply (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap) rest))
-      #t))
+(define* (install-glib-or-gtk #:rest rest)
+  (and (apply (assoc-ref glib-or-gtk:%standard-phases 
'glib-or-gtk-compile-schemas) rest)
+       (apply (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap) 
rest)))
 
-(define* (install-python #:key python? #:allow-other-keys #:rest rest)
-  (if python?
-      (apply (assoc-ref python:%standard-phases 'wrap) rest)
-      #t))
+(define* (install-python #:rest rest)
+  (apply (assoc-ref python:%standard-phases 'wrap) rest))
 
 (define* (shrink-runpath #:key (elf-directories '("lib" "lib64" "libexec"
                                                   "bin" "sbin"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]