guix-commits
[Top][All Lists]
Advanced

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

329/334: build-system/cmake: Wrap Python executables, too.


From: guix-commits
Subject: 329/334: build-system/cmake: Wrap Python executables, too.
Date: Sat, 15 Aug 2020 16:27:50 -0400 (EDT)

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

commit 5cb203609ad67b3e02cec2bf7f63ba52eabc59fa
Author: Raghav Gururajan <raghavgururajan@disroot.org>
AuthorDate: Fri Aug 14 15:34:08 2020 +0200

    build-system/cmake: Wrap Python executables, too.
    
    * guix/build-system/cmake.scm (%cmake-build-system-modules): Add
    %glib-or-gtk-build-system-modules, %python-build-system-modules.
    Remove %gnu-build-system-modules.
    (lower): Add #:glib-or-gtk? and #:python? to private-keywords.
    (cmake-build): Add #:python? to formal parameters and pass it to...
    * guix/build/cmake-build-system.scm (cmake-build): ...this.
    (install-glib-or-gtk): New procedure.
    (install-python): New procedure.
    (%standard-phases)[install-glib-or-gtk]: New phase.
    [install-python]: New phase.
    
    Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
---
 guix/build-system/cmake.scm       | 13 +++++++++++--
 guix/build/cmake-build-system.scm | 17 ++++++++++++++++-
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index f590b6e..e861756 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -26,6 +26,8 @@
   #:use-module (guix search-paths)
   #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system glib-or-gtk)
+  #:use-module (guix build-system python)
   #:use-module (guix packages)
   #:use-module (ice-9 match)
   #:export (%cmake-build-system-modules
@@ -42,7 +44,10 @@
 (define %cmake-build-system-modules
   ;; Build-side modules imported by default.
   `((guix build cmake-build-system)
-    ,@%gnu-build-system-modules))
+    ;; The modules from glib-or-gtk contains the modules from gnu-build-system,
+    ;; so there is no need to import that too.
+    ,@%glib-or-gtk-build-system-modules
+    ,@%python-build-system-modules))
 
 (define (default-cmake target)
   "Return the default CMake package."
@@ -61,7 +66,7 @@
                 #:rest arguments)
   "Return a bag for NAME."
   (define private-keywords
-    `(#:source #:cmake #:inputs #:native-inputs #:outputs
+    `(#:source #:cmake #:inputs #:native-inputs #:outputs #:glib-or-gtk? 
#:python?
       ,@(if target '() '(#:target))))
 
   (bag
@@ -104,6 +109,8 @@
                       (build-type "RelWithDebInfo")
                       (tests? #t)
                       (test-target "test")
+                      (glib-or-gtk? #f)
+                      (python? #f)
                       (parallel-build? #t) (parallel-tests? #t)
                       (validate-runpath? #t)
                       (patch-shebangs? #t)
@@ -141,6 +148,8 @@ provides a 'CMakeLists.txt' file as its build system."
                     #:out-of-source? ,out-of-source?
                     #: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/cmake-build-system.scm 
b/guix/build/cmake-build-system.scm
index d1ff507..82e272e 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -21,6 +21,8 @@
 
 (define-module (guix build cmake-build-system)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+  #:use-module ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
+  #:use-module ((guix build python-build-system) #:prefix python:)
   #:use-module (guix build utils)
   #:use-module (ice-9 match)
   #:export (%standard-phases
@@ -84,13 +86,26 @@
     (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 %standard-phases
   ;; Everything is as with the GNU Build System except for the `configure'
   ;; and 'check' phases.
   (modify-phases gnu:%standard-phases
     (delete 'bootstrap)
     (replace 'check check)
-    (replace 'configure configure)))
+    (replace 'configure configure)
+    (add-after 'install 'install-glib-or-gtk install-glib-or-gtk)
+    (add-after 'install 'install-python install-python)))
 
 (define* (cmake-build #:key inputs (phases %standard-phases)
                       #:allow-other-keys #:rest args)



reply via email to

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