gnu: CMake: Use G-expressions.
* gnu/packages/cmake.scm (%common-build-phases): Remove trailing #t's. (cmake-bootstrap, cmake-minimal, cmake, emacs-cmake-mode)[arguments]: Use G-expressions.
This commit is contained in:
		
							parent
							
								
									6cd8814011
								
							
						
					
					
						commit
						b1fa242cb1
					
				
					 1 changed files with 109 additions and 116 deletions
				
			
		| 
						 | 
					@ -31,6 +31,7 @@
 | 
				
			||||||
(define-module (gnu packages cmake)
 | 
					(define-module (gnu packages cmake)
 | 
				
			||||||
  #:use-module ((guix licenses) #:prefix license:)
 | 
					  #:use-module ((guix licenses) #:prefix license:)
 | 
				
			||||||
  #:use-module (guix packages)
 | 
					  #:use-module (guix packages)
 | 
				
			||||||
 | 
					  #:use-module (guix gexp)
 | 
				
			||||||
  #:use-module (guix download)
 | 
					  #:use-module (guix download)
 | 
				
			||||||
  #:use-module (guix git-download)
 | 
					  #:use-module (guix git-download)
 | 
				
			||||||
  #:use-module (guix utils)
 | 
					  #:use-module (guix utils)
 | 
				
			||||||
| 
						 | 
					@ -99,8 +100,7 @@ using the CMake build system.")
 | 
				
			||||||
      (lambda _
 | 
					      (lambda _
 | 
				
			||||||
        (delete-file "Auxiliary/cmake-mode.el")
 | 
					        (delete-file "Auxiliary/cmake-mode.el")
 | 
				
			||||||
        (substitute* "Auxiliary/CMakeLists.txt"
 | 
					        (substitute* "Auxiliary/CMakeLists.txt"
 | 
				
			||||||
          ((".*cmake-mode.el.*") ""))
 | 
					          ((".*cmake-mode.el.*") ""))))
 | 
				
			||||||
        #t))
 | 
					 | 
				
			||||||
    ,@(if (target-x86-32?)
 | 
					    ,@(if (target-x86-32?)
 | 
				
			||||||
          '((add-after 'unpack 'skip-cpack-txz-test
 | 
					          '((add-after 'unpack 'skip-cpack-txz-test
 | 
				
			||||||
              (lambda _
 | 
					              (lambda _
 | 
				
			||||||
| 
						 | 
					@ -124,8 +124,7 @@ using the CMake build system.")
 | 
				
			||||||
              "Source/cmExecProgramCommand.cxx"
 | 
					              "Source/cmExecProgramCommand.cxx"
 | 
				
			||||||
              "Tests/CMakeLists.txt"
 | 
					              "Tests/CMakeLists.txt"
 | 
				
			||||||
              "Tests/RunCMake/File_Generate/RunCMakeTest.cmake")
 | 
					              "Tests/RunCMake/File_Generate/RunCMakeTest.cmake")
 | 
				
			||||||
          (("/bin/sh") (which "sh")))
 | 
					          (("/bin/sh") (which "sh")))))))
 | 
				
			||||||
        #t))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define %common-disabled-tests
 | 
					(define %common-disabled-tests
 | 
				
			||||||
  '(;; This test copies libgcc_s.so.1 from GCC and tries to modify its RPATH,
 | 
					  '(;; This test copies libgcc_s.so.1 from GCC and tries to modify its RPATH,
 | 
				
			||||||
| 
						 | 
					@ -163,13 +162,13 @@ using the CMake build system.")
 | 
				
			||||||
              (patches (search-patches "cmake-curl-certificates.patch"))))
 | 
					              (patches (search-patches "cmake-curl-certificates.patch"))))
 | 
				
			||||||
    (build-system gnu-build-system)
 | 
					    (build-system gnu-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:test-target "test"
 | 
					     (list
 | 
				
			||||||
 | 
					      #:test-target "test"
 | 
				
			||||||
      #:configure-flags
 | 
					      #:configure-flags
 | 
				
			||||||
       (let ((out (assoc-ref %outputs "out"))
 | 
					      #~(let ((parallel-job-count (number->string (parallel-job-count))))
 | 
				
			||||||
             (parallel-job-count (number->string (parallel-job-count))))
 | 
					 | 
				
			||||||
          (list "--verbose"
 | 
					          (list "--verbose"
 | 
				
			||||||
                (string-append "--parallel=" parallel-job-count)
 | 
					                (string-append "--parallel=" parallel-job-count)
 | 
				
			||||||
               (string-append "--prefix=" out)
 | 
					                (string-append "--prefix=" #$output)
 | 
				
			||||||
                "--system-libs"
 | 
					                "--system-libs"
 | 
				
			||||||
                ;; By default, the man pages and other docs land
 | 
					                ;; By default, the man pages and other docs land
 | 
				
			||||||
                ;; in PREFIX/man and PREFIX/doc, but we want them
 | 
					                ;; in PREFIX/man and PREFIX/doc, but we want them
 | 
				
			||||||
| 
						 | 
					@ -178,15 +177,15 @@ using the CMake build system.")
 | 
				
			||||||
                ;; configure prepends "PREFIX/" to what we pass
 | 
					                ;; configure prepends "PREFIX/" to what we pass
 | 
				
			||||||
                ;; to --mandir and --docdir.
 | 
					                ;; to --mandir and --docdir.
 | 
				
			||||||
                "--mandir=share/man"
 | 
					                "--mandir=share/man"
 | 
				
			||||||
               ,(string-append "--docdir=share/doc/cmake-"
 | 
					                (string-append "--docdir=share/doc/cmake-"
 | 
				
			||||||
                               (version-major+minor version))
 | 
					                               #$(version-major+minor version))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                ;; By default CMake is built without any optimizations.  Use
 | 
					                ;; By default CMake is built without any optimizations.  Use
 | 
				
			||||||
                ;; the recommended Release target for a ~2.5x speedup.
 | 
					                ;; the recommended Release target for a ~2.5x speedup.
 | 
				
			||||||
                "--" "-DCMAKE_BUILD_TYPE=Release"))
 | 
					                "--" "-DCMAKE_BUILD_TYPE=Release"))
 | 
				
			||||||
      #:make-flags
 | 
					      #:make-flags
 | 
				
			||||||
       (let ((skipped-tests
 | 
					      #~(let ((skipped-tests
 | 
				
			||||||
              (list ,@%common-disabled-tests
 | 
					               (list #$@%common-disabled-tests
 | 
				
			||||||
                     "CTestTestSubdir" ; This test fails to build 2 of the 3 tests.
 | 
					                     "CTestTestSubdir" ; This test fails to build 2 of the 3 tests.
 | 
				
			||||||
                     ;; This test fails when ARGS (below) is in use, see
 | 
					                     ;; This test fails when ARGS (below) is in use, see
 | 
				
			||||||
                     ;; <https://gitlab.kitware.com/cmake/cmake/issues/17165>.
 | 
					                     ;; <https://gitlab.kitware.com/cmake/cmake/issues/17165>.
 | 
				
			||||||
| 
						 | 
					@ -198,16 +197,15 @@ using the CMake build system.")
 | 
				
			||||||
            " --output-on-failure"
 | 
					            " --output-on-failure"
 | 
				
			||||||
            " --exclude-regex ^\\(" (string-join skipped-tests "\\|") "\\)$")))
 | 
					            " --exclude-regex ^\\(" (string-join skipped-tests "\\|") "\\)$")))
 | 
				
			||||||
      #:phases
 | 
					      #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
         ,@(%common-build-phases)
 | 
					          #$@(%common-build-phases)
 | 
				
			||||||
          (add-before 'configure 'set-paths
 | 
					          (add-before 'configure 'set-paths
 | 
				
			||||||
            (lambda _
 | 
					            (lambda _
 | 
				
			||||||
              ;; Help cmake's bootstrap process to find system libraries
 | 
					              ;; Help cmake's bootstrap process to find system libraries
 | 
				
			||||||
              (begin
 | 
					              (begin
 | 
				
			||||||
                (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
 | 
					                (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
 | 
				
			||||||
                (setenv "CMAKE_INCLUDE_PATH" (or (getenv "CPATH")
 | 
					                (setenv "CMAKE_INCLUDE_PATH" (or (getenv "CPATH")
 | 
				
			||||||
                                                (getenv "C_INCLUDE_PATH")))
 | 
					                                                 (getenv "C_INCLUDE_PATH"))))))
 | 
				
			||||||
               #t)))
 | 
					 | 
				
			||||||
          ;; CMake uses its own configure script.
 | 
					          ;; CMake uses its own configure script.
 | 
				
			||||||
          (replace 'configure
 | 
					          (replace 'configure
 | 
				
			||||||
            (lambda* (#:key (configure-flags '()) #:allow-other-keys)
 | 
					            (lambda* (#:key (configure-flags '()) #:allow-other-keys)
 | 
				
			||||||
| 
						 | 
					@ -287,30 +285,30 @@ and workspaces that can be used in the compiler environment of your choice.")
 | 
				
			||||||
                  #t))))
 | 
					                  #t))))
 | 
				
			||||||
    (build-system cmake-build-system)
 | 
					    (build-system cmake-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:configure-flags
 | 
					     (list
 | 
				
			||||||
       (list "-DCMAKE_USE_SYSTEM_LIBRARIES=ON"
 | 
					      #:configure-flags
 | 
				
			||||||
 | 
					      #~(list "-DCMAKE_USE_SYSTEM_LIBRARIES=ON"
 | 
				
			||||||
              (string-append "-DCMAKE_DOC_DIR=share/doc/cmake-"
 | 
					              (string-append "-DCMAKE_DOC_DIR=share/doc/cmake-"
 | 
				
			||||||
                            ,(version-major+minor (package-version
 | 
					                             #$(version-major+minor (package-version
 | 
				
			||||||
                                                     cmake-bootstrap))))
 | 
					                                                     cmake-bootstrap))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      ;; This is the CMake used in cmake-build-system.  Ensure compiler
 | 
					      ;; This is the CMake used in cmake-build-system.  Ensure compiler
 | 
				
			||||||
      ;; optimizations are enabled to save size and CPU cycles.
 | 
					      ;; optimizations are enabled to save size and CPU cycles.
 | 
				
			||||||
      #:build-type "Release"
 | 
					      #:build-type "Release"
 | 
				
			||||||
      #:phases
 | 
					      #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
         ,@(%common-build-phases)
 | 
					          #$@(%common-build-phases)
 | 
				
			||||||
          (add-after 'install 'delete-help-documentation
 | 
					          (add-after 'install 'delete-help-documentation
 | 
				
			||||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
					            (lambda _
 | 
				
			||||||
              (delete-file-recursively
 | 
					              (delete-file-recursively
 | 
				
			||||||
               (string-append (assoc-ref outputs "out")
 | 
					               (string-append #$output
 | 
				
			||||||
                              "/share/cmake-"
 | 
					                              "/share/cmake-"
 | 
				
			||||||
                              ,(version-major+minor
 | 
					                              #$(version-major+minor
 | 
				
			||||||
                                 (package-version cmake-bootstrap))
 | 
					                                 (package-version cmake-bootstrap))
 | 
				
			||||||
                              "/Help"))
 | 
					                              "/Help"))))
 | 
				
			||||||
             #t))
 | 
					 | 
				
			||||||
          (replace 'check
 | 
					          (replace 'check
 | 
				
			||||||
            (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
 | 
					            (lambda* (#:key tests? parallel-tests? #:allow-other-keys)
 | 
				
			||||||
             (let ((skipped-tests (list ,@%common-disabled-tests
 | 
					              (let ((skipped-tests (list #$@%common-disabled-tests
 | 
				
			||||||
                                         ;; This test requires the bundled libuv.
 | 
					                                         ;; This test requires the bundled libuv.
 | 
				
			||||||
                                         "BootstrapTest")))
 | 
					                                         "BootstrapTest")))
 | 
				
			||||||
                (if tests?
 | 
					                (if tests?
 | 
				
			||||||
| 
						 | 
					@ -320,11 +318,10 @@ and workspaces that can be used in the compiler environment of your choice.")
 | 
				
			||||||
                                               "1")
 | 
					                                               "1")
 | 
				
			||||||
                              "--exclude-regex"
 | 
					                              "--exclude-regex"
 | 
				
			||||||
                              (string-append "^(" (string-join skipped-tests "|") ")$")))
 | 
					                              (string-append "^(" (string-join skipped-tests "|") ")$")))
 | 
				
			||||||
                   (format #t "test suite not run~%"))
 | 
					                    (format #t "test suite not run~%"))))))
 | 
				
			||||||
               #t))))
 | 
					      #:cmake (if (%current-target-system)
 | 
				
			||||||
        ,@(if (%current-target-system)
 | 
					                  cmake-minimal-cross
 | 
				
			||||||
              '()
 | 
					                  cmake-bootstrap)))))
 | 
				
			||||||
              `(#:cmake ,cmake-bootstrap))))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;; The "user-facing" CMake, now with manuals and HTML documentation.
 | 
					;;; The "user-facing" CMake, now with manuals and HTML documentation.
 | 
				
			||||||
(define-public cmake
 | 
					(define-public cmake
 | 
				
			||||||
| 
						 | 
					@ -343,31 +340,28 @@ and workspaces that can be used in the compiler environment of your choice.")
 | 
				
			||||||
       ((#:build-type _ #f) "RelWithDebInfo")
 | 
					       ((#:build-type _ #f) "RelWithDebInfo")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
       ((#:configure-flags flags ''())
 | 
					       ((#:configure-flags flags ''())
 | 
				
			||||||
        `(append (list "-DSPHINX_INFO=ON" "-DSPHINX_MAN=ON" "-DSPHINX_HTML=ON"
 | 
					        #~(append (list "-DSPHINX_INFO=ON" "-DSPHINX_MAN=ON" "-DSPHINX_HTML=ON"
 | 
				
			||||||
                        (string-append "-DCMAKE_DOC_DIR=share/doc/cmake-"
 | 
					                        (string-append "-DCMAKE_DOC_DIR=share/doc/cmake-"
 | 
				
			||||||
                                      ,(version-major+minor (package-version
 | 
					                                       #$(version-major+minor (package-version
 | 
				
			||||||
                                                               cmake-minimal)))
 | 
					                                                               cmake-minimal)))
 | 
				
			||||||
                        "-DCMAKE_INFO_DIR=share/info"
 | 
					                        "-DCMAKE_INFO_DIR=share/info"
 | 
				
			||||||
                        "-DCMAKE_MAN_DIR=share/man")
 | 
					                        "-DCMAKE_MAN_DIR=share/man")
 | 
				
			||||||
                 ,flags))
 | 
					                  #$flags))
 | 
				
			||||||
       ((#:phases phases)
 | 
					       ((#:phases phases)
 | 
				
			||||||
        `(modify-phases ,phases
 | 
					        #~(modify-phases #$phases
 | 
				
			||||||
            (delete 'delete-help-documentation)
 | 
					            (delete 'delete-help-documentation)
 | 
				
			||||||
            (add-after 'install 'move-html-doc
 | 
					            (add-after 'install 'move-html-doc
 | 
				
			||||||
             (lambda* (#:key outputs #:allow-other-keys)
 | 
					              (lambda _
 | 
				
			||||||
               (let ((out (assoc-ref outputs "out"))
 | 
					                (let ((html (string-append "/share/doc/cmake-"
 | 
				
			||||||
                     (doc (assoc-ref outputs "doc"))
 | 
					                                           #$(version-major+minor
 | 
				
			||||||
                     (html (string-append "/share/doc/cmake-"
 | 
					 | 
				
			||||||
                                          ,(version-major+minor
 | 
					 | 
				
			||||||
                                              (package-version cmake-minimal))
 | 
					                                              (package-version cmake-minimal))
 | 
				
			||||||
                                           "/html")))
 | 
					                                           "/html")))
 | 
				
			||||||
                 (copy-recursively (string-append out html)
 | 
					                  (copy-recursively (string-append #$output html)
 | 
				
			||||||
                                   (string-append doc html))
 | 
					                                    (string-append #$output:doc html))
 | 
				
			||||||
                 (delete-file-recursively (string-append out html)))))))))
 | 
					                  (delete-file-recursively (string-append #$output html)))))))))
 | 
				
			||||||
    (inputs
 | 
					    (inputs
 | 
				
			||||||
     (modify-inputs (package-inputs cmake-minimal)
 | 
					     (modify-inputs (package-inputs cmake-minimal)
 | 
				
			||||||
       (prepend ncurses ;required for ccmake
 | 
					       (prepend ncurses)))              ;required for ccmake
 | 
				
			||||||
                )))
 | 
					 | 
				
			||||||
    ;; Extra inputs required to build the documentation.
 | 
					    ;; Extra inputs required to build the documentation.
 | 
				
			||||||
    (native-inputs
 | 
					    (native-inputs
 | 
				
			||||||
     (modify-inputs (package-native-inputs cmake-minimal)
 | 
					     (modify-inputs (package-native-inputs cmake-minimal)
 | 
				
			||||||
| 
						 | 
					@ -392,13 +386,12 @@ and workspaces that can be used in the compiler environment of your choice.")
 | 
				
			||||||
    (outputs '("out"))
 | 
					    (outputs '("out"))
 | 
				
			||||||
    (build-system emacs-build-system)
 | 
					    (build-system emacs-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:phases
 | 
					     (list #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					           #~(modify-phases %standard-phases
 | 
				
			||||||
               (add-after 'unpack 'chdir-elisp
 | 
					               (add-after 'unpack 'chdir-elisp
 | 
				
			||||||
                 ;; Elisp directory is not in root of the source.
 | 
					                 ;; Elisp directory is not in root of the source.
 | 
				
			||||||
                 (lambda _
 | 
					                 (lambda _
 | 
				
			||||||
             (chdir "Auxiliary")
 | 
					                   (chdir "Auxiliary"))))))
 | 
				
			||||||
             #t)))))
 | 
					 | 
				
			||||||
    (synopsis "Emacs major mode for editing Cmake expressions")
 | 
					    (synopsis "Emacs major mode for editing Cmake expressions")
 | 
				
			||||||
    (description "@code{cmakeos-mode} provides an Emacs major mode for editing
 | 
					    (description "@code{cmakeos-mode} provides an Emacs major mode for editing
 | 
				
			||||||
Cmake files.  It supports syntax highlighting, indenting and refilling of
 | 
					Cmake files.  It supports syntax highlighting, indenting and refilling of
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue