guix-commits
[Top][All Lists]
Advanced

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

334/402: build-system/cmake: Only include phases that are enabled.


From: guix-commits
Subject: 334/402: build-system/cmake: 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 993fd144467599e64cdb2bdb27b8fef2ae906bdd
Author: Danny Milosavljevic <dannym@scratchpost.org>
AuthorDate: Sat Aug 15 22:13:24 2020 +0200

    build-system/cmake: Only include phases that are enabled.
    
    Follow-up to 5cb203609ad67b3e02cec2bf7f63ba52eabc59fa.
    
    * guix/build-system/cmake.scm (lower): Remove #:glib-or-gtk? and #:python?
    from private-keywords.
    (cmake-build): Only include phases that are enabled.
    Remove #:glib-or-gtk? and #:python? from build-side call.
    * guix/build/cmake-build-system.scm (install-glib-or-gtk): Make it
    unconditional.
    (install-python): Make it unconditional.
---
 guix/build-system/cmake.scm       | 34 +++++++++++++++++++++++++++++++---
 guix/build/cmake-build-system.scm | 15 +++++----------
 2 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index e861756..7daa88a 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -62,11 +62,13 @@
 (define* (lower name
                 #:key source inputs native-inputs outputs system target
                 (cmake (default-cmake target))
+                glib-or-gtk?
+                python?
                 #:allow-other-keys
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    `(#:source #:cmake #:inputs #:native-inputs #:outputs #:glib-or-gtk? 
#:python?
+    `(#:source #:cmake #:inputs #:native-inputs #:outputs
       ,@(if target '() '(#:target))))
 
   (bag
@@ -142,7 +144,19 @@ provides a 'CMakeLists.txt' file as its build system."
                     #:inputs %build-inputs
                     #:search-paths ',(map search-path-specification->sexp
                                           search-paths)
-                    #:phases ,phases
+                    #: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))))
                     #:configure-flags ,configure-flags
                     #:make-flags ,make-flags
                     #:out-of-source? ,out-of-source?
@@ -194,6 +208,8 @@ provides a 'CMakeLists.txt' file as its build system."
                             (build-type "RelWithDebInfo")
                             (tests? #f) ; nothing can be done
                             (test-target "test")
+                            (glib-or-gtk? #f)
+                            (python? #f)
                             (parallel-build? #t) (parallel-tests? #t)
                             (validate-runpath? #t)
                             (patch-shebangs? #t)
@@ -255,7 +271,19 @@ build system."
                       #:native-search-paths ',(map
                                                search-path-specification->sexp
                                                native-search-paths)
-                      #:phases ,phases
+                      #: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))))
                       #:configure-flags ,configure-flags
                       #:make-flags ,make-flags
                       #:out-of-source? ,out-of-source?
diff --git a/guix/build/cmake-build-system.scm 
b/guix/build/cmake-build-system.scm
index 82e272e..1a53556 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -86,16 +86,11 @@
     (gnu-check #:tests? tests? #:test-target test-target
               #:parallel-tests? parallel-tests?)))
 
-(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-python #:key python? #:allow-other-keys #:rest rest)
-  (if python?
-      (apply (assoc-ref python:%standard-phases '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 #:rest rest)
+  (apply (assoc-ref python:%standard-phases 'wrap) rest))
 
 (define %standard-phases
   ;; Everything is as with the GNU Build System except for the `configure'



reply via email to

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