Update cmake

Use system libraries, make curses optional, add optional qt4 gui etc.

svn path=/nixpkgs/trunk/; revision=23810
This commit is contained in:
Yury G. Kudryashov 2010-09-15 18:37:21 +00:00
parent 10376e7ba1
commit 48c13f4096
3 changed files with 27 additions and 17 deletions

View File

@ -1,31 +1,37 @@
{fetchurl, stdenv, replace, ncurses}:
{fetchurl, stdenv, replace, curl, expat, zlib
, useNcurses ? false, ncurses, useQt4 ? false, qt4}:
stdenv.mkDerivation rec {
name = "cmake-2.8.1";
name = "cmake-${majorVersion}.1";
# We look for cmake modules in .../share/cmake-${majorVersion}/Modules.
majorVersion = "2.8";
setupHook = ./setup-hook.sh;
meta = {
homepage = http://www.cmake.org/;
description = "Cross-Platform Makefile Generator";
};
src = fetchurl {
url = "http://www.cmake.org/files/v${majorVersion}/${name}.tar.gz";
sha256 = "0hi28blqxvir0dkhln90sgr0m3ri9n2i3hlmwdl4m5vkfsmp9bky";
};
buildInputs = [ curl expat zlib ]
++ stdenv.lib.optional useNcurses ncurses
++ stdenv.lib.optional useQt4 qt4;
CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs;
configureFlags =
"--docdir=/share/doc/${name} --mandir=/share/man --system-libs"
+ stdenv.lib.optionalString useQt4 " --qt-gui";
setupHook = ./setup-hook.sh;
postUnpack = ''
dontUseCmakeConfigure=1
source $setupHook
fixCmakeFiles $sourceRoot
echo 'SET (CMAKE_SYSTEM_PREFIX_PATH "'${ncurses}'" CACHE FILEPATH "Root for libs for cmake" FORCE)' > $sourceRoot/cmakeInit.txt
'';
configureFlags= [ " --init=cmakeInit.txt " ];
postInstall = "fixCmakeFiles $out/share";
meta = {
homepage = http://www.cmake.org/;
description = "Cross-Platform Makefile Generator";
platforms = stdenv.lib.platforms.all;
maintainers = [ stdenv.lib.maintainers.urkud ];
};
}

View File

@ -1,15 +1,15 @@
addCMakeParams()
{
addToSearchPath CMAKE_PREFIX_PATH $1
addToSearchPath CMAKE_MODULE_PATH $1/share/cmake-@majorVersion@/Modules
}
fixCmakeFiles()
{
local replaceArgs
echo "fixing cmake files"
replaceArgs="-e -f -L -T /usr /FOO"
find $1 -type f -name "*.cmake" -print0 | xargs -0 replace-literal ${replaceArgs}
replaceArgs="-e -f -L -T /usr /var/empty -a /opt /var/empty"
find $1 -type f -name "*.cmake" -o -name "*.cmake.in" -o -name CMakeLists.txt -print0 |
xargs -0 replace-literal ${replaceArgs}
}
cmakeConfigurePhase()

View File

@ -2284,6 +2284,10 @@ let
cmake = callPackage ../development/tools/build-managers/cmake { };
cmakeCurses = cmake.override { useNcurses = true; };
cmakeWithGui = cmakeCurses.override { useQt4 = true; };
coccinelle = callPackage ../development/tools/misc/coccinelle { };
cppi = callPackage ../development/tools/misc/cppi { };