2011-07-21 20:21:38 +02:00
|
|
|
{ fetchurl, stdenv, replace, curl, expat, zlib, bzip2, libarchive
|
2011-03-25 13:55:29 +01:00
|
|
|
, useNcurses ? false, ncurses, useQt4 ? false, qt4
|
2011-07-21 20:21:38 +02:00
|
|
|
, darwinInstallNameToolUtility }:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2007-07-08 00:31:37 +02:00
|
|
|
|
2010-10-02 07:24:39 +02:00
|
|
|
let
|
|
|
|
os = stdenv.lib.optionalString;
|
|
|
|
majorVersion = "2.8";
|
2011-11-07 23:05:46 +01:00
|
|
|
minorVersion = "4";
|
2010-10-02 07:24:39 +02:00
|
|
|
version = "${majorVersion}.${minorVersion}";
|
|
|
|
in
|
2011-07-21 20:21:38 +02:00
|
|
|
|
2008-11-13 22:05:01 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2010-10-02 07:24:39 +02:00
|
|
|
name = "cmake-${os useNcurses "cursesUI-"}${os useQt4 "qt4UI-"}${version}";
|
2009-02-13 15:43:01 +01:00
|
|
|
|
2010-10-02 07:24:39 +02:00
|
|
|
inherit majorVersion;
|
2009-04-17 15:48:22 +02:00
|
|
|
|
2008-11-13 22:05:01 +01:00
|
|
|
src = fetchurl {
|
2010-10-02 07:24:39 +02:00
|
|
|
url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
|
2011-11-07 23:05:46 +01:00
|
|
|
sha256 = "1k2kjaj3vfifb329ff7fr4hcbpbaqb66l97pshq70h7m0zwajznr";
|
2007-07-08 00:31:37 +02:00
|
|
|
};
|
2009-04-17 15:48:22 +02:00
|
|
|
|
2011-07-21 20:21:38 +02: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 22:08:53 +01:00
|
|
|
buildInputs = [ curl expat zlib bzip2 libarchive ]
|
2011-03-25 13:55:29 +01:00
|
|
|
++ optional stdenv.isDarwin darwinInstallNameToolUtility
|
2011-02-09 22:08:53 +01:00
|
|
|
++ optional useNcurses ncurses
|
|
|
|
++ optional useQt4 qt4;
|
2010-09-15 20:37:21 +02:00
|
|
|
|
|
|
|
CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs;
|
2011-07-21 20:21:38 +02:00
|
|
|
|
2010-09-15 20:37:21 +02:00
|
|
|
configureFlags =
|
|
|
|
"--docdir=/share/doc/${name} --mandir=/share/man --system-libs"
|
|
|
|
+ stdenv.lib.optionalString useQt4 " --qt-gui";
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2011-07-21 20:21:38 +02:00
|
|
|
postUnpack =
|
|
|
|
''
|
|
|
|
dontUseCmakeConfigure=1
|
|
|
|
source $setupHook
|
|
|
|
fixCmakeFiles $sourceRoot
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = optionalString (stdenv ? glibc)
|
|
|
|
''
|
|
|
|
substituteInPlace Modules/Platform/UnixPaths.cmake --subst-var-by glibc ${stdenv.glibc}
|
|
|
|
'';
|
2009-04-17 15:48:22 +02:00
|
|
|
|
2010-09-15 20:37:21 +02:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.cmake.org/;
|
|
|
|
description = "Cross-Platform Makefile Generator";
|
2011-03-25 13:55:33 +01:00
|
|
|
platforms = if useQt4 then qt4.meta.platforms else stdenv.lib.platforms.unix;
|
2010-09-15 20:37:21 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.urkud ];
|
|
|
|
};
|
2007-07-08 00:31:37 +02:00
|
|
|
}
|