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