gnu: Adjust formatting as recommended by 'guix lint'.
[jackhill/guix/guix.git] / gnu / packages / cmake.scm
CommitLineData
b6a64843
CR
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
6212b8e5 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
c824d34f 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
29a7c98a 5;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
477a752e 6;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
b6a64843
CR
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages cmake)
c824d34f 24 #:use-module ((guix licenses) #:select (bsd-3))
b6a64843
CR
25 #:use-module (guix packages)
26 #:use-module (guix download)
29a7c98a 27 #:use-module (guix utils)
b6a64843
CR
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
c824d34f
EB
30 #:use-module (gnu packages backup)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages curl)
6212b8e5 33 #:use-module (gnu packages file)
29a7c98a 34 #:use-module (gnu packages xml))
b6a64843
CR
35
36(define-public cmake
37 (package
38 (name "cmake")
ecd9c37f 39 (version "3.3.2")
b6a64843
CR
40 (source (origin
41 (method url-fetch)
4ebdefc0
LC
42 (uri (string-append "https://www.cmake.org/files/v"
43 (version-major+minor version)
44 "/cmake-" version ".tar.gz"))
b6a64843 45 (sha256
4ebdefc0
LC
46 (base32
47 "08pwy9ip9cgwgynhn5vrjw8drw29gijy1rmziq22n65zds6ifnp7"))
01eafd38 48 (patches (list (search-patch "cmake-fix-tests.patch")))))
b6a64843
CR
49 (build-system gnu-build-system)
50 (arguments
6212b8e5 51 `(#:test-target "test"
c824d34f
EB
52 #:phases (alist-cons-before
53 'configure 'patch-bin-sh
54 (lambda _
55 ;; Replace "/bin/sh" by the right path in... a lot of
56 ;; files.
57 (substitute*
b6a64843
CR
58 '("Modules/CompilerId/Xcode-3.pbxproj.in"
59 "Modules/CompilerId/Xcode-1.pbxproj.in"
60 "Modules/CompilerId/Xcode-2.pbxproj.in"
61 "Modules/CPack.RuntimeScript.in"
62 "Source/cmakexbuild.cxx"
63 "Source/cmGlobalXCodeGenerator.cxx"
64 "Source/CTest/cmCTestBatchTestHandler.cxx"
65 "Source/cmLocalUnixMakefileGenerator3.cxx"
f1886b51 66 "Source/cmExecProgramCommand.cxx"
b6a64843
CR
67 "Utilities/cmbzip2/Makefile-libbz2_so"
68 "Utilities/Release/release_cmake.cmake"
a124bbd2
SB
69 "Utilities/cmlibarchive/libarchive/\
70archive_write_set_format_shar.c"
477a752e
SB
71 "Tests/CMakeLists.txt"
72 "Tests/RunCMake/File_Generate/RunCMakeTest.cmake")
c824d34f
EB
73 (("/bin/sh") (which "sh"))))
74 (alist-cons-before
75 'configure 'set-paths
76 (lambda _
77 ;; Help cmake's bootstrap process to find system libraries
78 (begin
79 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
e32316e6
SB
80 (setenv "CMAKE_INCLUDE_PATH" (getenv "CPATH"))
81 ;; Get verbose output from failed tests
82 (setenv "CTEST_OUTPUT_ON_FAILURE" "TRUE")))
c824d34f
EB
83 (alist-replace
84 'configure
85 (lambda* (#:key outputs #:allow-other-keys)
86 (let ((out (assoc-ref outputs "out")))
87 (zero? (system*
88 "./configure"
89 (string-append "--prefix=" out)
90 "--system-libs"
477a752e 91 "--no-system-jsoncpp" ; not packaged yet
c824d34f
EB
92 ;; By default, the man pages and other docs land
93 ;; in PREFIX/man and PREFIX/doc, but we want them
94 ;; in share/{man,doc}. Note that unlike
95 ;; autoconf-generated configure scripts, cmake's
96 ;; configure prepends "PREFIX/" to what we pass
97 ;; to --mandir and --docdir.
98 "--mandir=share/man"
99 ,(string-append
100 "--docdir=share/doc/cmake-"
29a7c98a 101 (version-major+minor version))))))
c824d34f 102 %standard-phases)))))
b6a64843 103 (inputs
c824d34f
EB
104 `(("file" ,file)
105 ("curl" ,curl)
106 ("zlib" ,zlib)
107 ("expat" ,expat)
108 ("bzip2" ,bzip2)
109 ("libarchive" ,libarchive)))
0d6f9360
AE
110 (native-search-paths
111 (list (search-path-specification
112 (variable "CMAKE_PREFIX_PATH")
113 (files '("")))))
b6a64843 114 (home-page "http://www.cmake.org/")
749b90a5 115 (synopsis "Cross-platform build system")
b6a64843
CR
116 (description
117 "CMake is a family of tools designed to build, test and package software.
118CMake is used to control the software compilation process using simple platform
c824d34f 119and compiler independent configuration files. CMake generates native makefiles
b6a64843
CR
120and workspaces that can be used in the compiler environment of your choice.")
121 (license bsd-3)))