gnu: Add cmake.
[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>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages cmake)
20 #:use-module (guix licenses)
21 #:use-module (guix packages)
22 #:use-module (guix download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages)
25 #:use-module (gnu packages file))
26
27(define-public cmake
28 (package
29 (name "cmake")
30 (version "2.8.10.2")
31 (source (origin
32 (method url-fetch)
33 (uri (string-append
34 "http://www.cmake.org/files/v"
35 (substring version 0
36 (string-index version #\. (+ 1 (string-index version #\.))))
37 "/cmake-" version ".tar.gz"))
38 (sha256
39 (base32 "1c8fj6i2x9sb39wc9av2ighj415mw33cxfrlfpafcvm0knrlylnf"))))
40 (build-system gnu-build-system)
41 (arguments
42 '(#:test-target "test"
43 #:patches (list (assoc-ref %build-inputs "fix-tests"))
44 #:patch-flags '("-p0")
45 #:phases (alist-replace
46 'configure
47 (lambda* (#:key outputs #:allow-other-keys)
48 (let ((out (assoc-ref outputs "out")))
49 ;; Replace "/bin/sh" by the right path in... a lot of
50 ;; files.
51 (substitute*
52 '("Modules/CompilerId/Xcode-3.pbxproj.in"
53 "Modules/CompilerId/Xcode-1.pbxproj.in"
54 "Modules/CompilerId/Xcode-2.pbxproj.in"
55 "Modules/CPack.RuntimeScript.in"
56 "Source/cmakexbuild.cxx"
57 "Source/cmGlobalXCodeGenerator.cxx"
58 "Source/CTest/cmCTestBatchTestHandler.cxx"
59 "Source/cmLocalUnixMakefileGenerator3.cxx"
60 "Utilities/cmbzip2/Makefile-libbz2_so"
61 "Utilities/Release/release_cmake.cmake"
62 "Utilities/cmlibarchive/libarchive/archive_write_set_format_shar.c"
63 "Tests/CMakeLists.txt")
64 (("/bin/sh") (which "sh")))
65 (zero? (system* "./configure"
66 (string-append "--prefix=" out)))))
67 %standard-phases)))
68 (inputs
69 `(("file" ,file)
70 ("fix-tests" ,(search-patch "cmake-fix-tests.patch"))))
71 (home-page "http://www.cmake.org/")
72 (synopsis "A cross-platform, open-source build system")
73 (description
74 "CMake is a family of tools designed to build, test and package software.
75CMake is used to control the software compilation process using simple platform
76and compiler independent configuration files. CMake generates native makefiles
77and workspaces that can be used in the compiler environment of your choice.")
78 (license bsd-3)))