1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2014 Ian Denhardt <ian@zenhack.net>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages cmake)
23 #:use-module ((guix licenses) #:select (bsd-3))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages backup)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages curl)
32 #:use-module (gnu packages file)
33 #:use-module (gnu packages xml))
42 "http://www.cmake.org/files/v"
43 (version-major+minor version)
44 "/cmake-" version ".tar.gz"))
46 (base32 "11q21vyrr6c6smyjy81k2k07zmn96ggjia9im9cxwvj0n88bm1fq"))
47 (patches (list (search-patch "cmake-fix-tests.patch")))))
48 (build-system gnu-build-system)
50 `(#:test-target "test"
51 #:phases (alist-cons-before
52 'configure 'patch-bin-sh
54 ;; Replace "/bin/sh" by the right path in... a lot of
57 '("Modules/CompilerId/Xcode-3.pbxproj.in"
58 "Modules/CompilerId/Xcode-1.pbxproj.in"
59 "Modules/CompilerId/Xcode-2.pbxproj.in"
60 "Modules/CPack.RuntimeScript.in"
61 "Source/cmakexbuild.cxx"
62 "Source/cmGlobalXCodeGenerator.cxx"
63 "Source/CTest/cmCTestBatchTestHandler.cxx"
64 "Source/cmLocalUnixMakefileGenerator3.cxx"
65 "Utilities/cmbzip2/Makefile-libbz2_so"
66 "Utilities/Release/release_cmake.cmake"
67 "Utilities/cmlibarchive/libarchive/archive_write_set_format_shar.c"
68 "Tests/CMakeLists.txt")
69 (("/bin/sh") (which "sh"))))
73 ;; Help cmake's bootstrap process to find system libraries
75 (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH"))
76 (setenv "CMAKE_INCLUDE_PATH" (getenv "CPATH"))))
79 (lambda* (#:key outputs #:allow-other-keys)
80 (let ((out (assoc-ref outputs "out")))
83 (string-append "--prefix=" out)
85 ;; By default, the man pages and other docs land
86 ;; in PREFIX/man and PREFIX/doc, but we want them
87 ;; in share/{man,doc}. Note that unlike
88 ;; autoconf-generated configure scripts, cmake's
89 ;; configure prepends "PREFIX/" to what we pass
90 ;; to --mandir and --docdir.
93 "--docdir=share/doc/cmake-"
94 (version-major+minor version))))))
102 ("libarchive" ,libarchive)))
103 (home-page "http://www.cmake.org/")
104 (synopsis "Cross-platform build system")
106 "CMake is a family of tools designed to build, test and package software.
107 CMake is used to control the software compilation process using simple platform
108 and compiler independent configuration files. CMake generates native makefiles
109 and workspaces that can be used in the compiler environment of your choice.")