2011-07-21 18:21:38 +00:00
|
|
|
{ fetchurl, stdenv, replace, curl, expat, zlib, bzip2, libarchive
|
2011-03-25 12:55:29 +00:00
|
|
|
, useNcurses ? false, ncurses, useQt4 ? false, qt4
|
2011-07-21 18:21:38 +00:00
|
|
|
, darwinInstallNameToolUtility }:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2007-07-07 22:31:37 +00:00
|
|
|
|
2010-10-02 05:24:39 +00:00
|
|
|
let
|
|
|
|
os = stdenv.lib.optionalString;
|
|
|
|
majorVersion = "2.8";
|
2012-01-03 16:38:53 +00:00
|
|
|
minorVersion = "7";
|
2010-10-02 05:24:39 +00:00
|
|
|
version = "${majorVersion}.${minorVersion}";
|
|
|
|
in
|
2011-07-21 18:21:38 +00:00
|
|
|
|
2008-11-13 21:05:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2010-10-02 05:24:39 +00:00
|
|
|
name = "cmake-${os useNcurses "cursesUI-"}${os useQt4 "qt4UI-"}${version}";
|
2009-02-13 14:43:01 +00:00
|
|
|
|
2010-10-02 05:24:39 +00:00
|
|
|
inherit majorVersion;
|
2009-04-17 13:48:22 +00:00
|
|
|
|
2008-11-13 21:05:01 +00:00
|
|
|
src = fetchurl {
|
2010-10-02 05:24:39 +00:00
|
|
|
url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
|
2012-01-03 16:38:53 +00:00
|
|
|
sha256 = "17zmxh0gyis6w05d2km0swlvy94h3w10jgra0fpa5qcg7l2j628k";
|
2007-07-07 22:31:37 +00:00
|
|
|
};
|
2009-04-17 13:48:22 +00:00
|
|
|
|
2011-07-21 18:21:38 +00:00
|
|
|
patches =
|
|
|
|
# Don't search in non-Nix locations such as /usr, but do search in
|
|
|
|
# Nixpkgs' Glibc.
|
|
|
|
optional (stdenv ? glibc) ./search-path.patch;
|
|
|
|
|
2011-02-09 21:08:53 +00:00
|
|
|
buildInputs = [ curl expat zlib bzip2 libarchive ]
|
2011-03-25 12:55:29 +00:00
|
|
|
++ optional stdenv.isDarwin darwinInstallNameToolUtility
|
2011-02-09 21:08:53 +00:00
|
|
|
++ optional useNcurses ncurses
|
|
|
|
++ optional useQt4 qt4;
|
2010-09-15 18:37:21 +00:00
|
|
|
|
|
|
|
CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs;
|
2011-07-21 18:21:38 +00:00
|
|
|
|
2010-09-15 18:37:21 +00:00
|
|
|
configureFlags =
|
|
|
|
"--docdir=/share/doc/${name} --mandir=/share/man --system-libs"
|
|
|
|
+ stdenv.lib.optionalString useQt4 " --qt-gui";
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2012-01-20 15:10:28 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
2011-07-21 18:21:38 +00:00
|
|
|
|
|
|
|
preConfigure = optionalString (stdenv ? glibc)
|
|
|
|
''
|
2012-01-20 15:10:28 +00:00
|
|
|
source $setupHook
|
|
|
|
fixCmakeFiles .
|
2011-07-21 18:21:38 +00:00
|
|
|
substituteInPlace Modules/Platform/UnixPaths.cmake --subst-var-by glibc ${stdenv.glibc}
|
|
|
|
'';
|
2009-04-17 13:48:22 +00:00
|
|
|
|
2010-09-15 18:37:21 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.cmake.org/;
|
|
|
|
description = "Cross-Platform Makefile Generator";
|
2012-01-28 14:39:56 +00:00
|
|
|
platforms = if useQt4 then qt4.meta.platforms else stdenv.lib.platforms.all;
|
2010-09-15 18:37:21 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.urkud ];
|
|
|
|
};
|
2007-07-07 22:31:37 +00:00
|
|
|
}
|