diff options
author | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2010-09-15 18:37:21 +0000 |
---|---|---|
committer | Yury G. Kudryashov <urkud.urkud@gmail.com> | 2010-09-15 18:37:21 +0000 |
commit | 48c13f4096df5d0e76bbe5c235c39df820ac060d (patch) | |
tree | 43befde2e8e942d7950871bff4f3b5e525025ec1 /pkgs/development/tools/build-managers | |
parent | 10376e7ba1b3d55c539ac15e5ceb59b4912f4039 (diff) |
Update cmake
Use system libraries, make curses optional, add optional qt4 gui etc. svn path=/nixpkgs/trunk/; revision=23810
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r-- | pkgs/development/tools/build-managers/cmake/default.nix | 34 | ||||
-rwxr-xr-x | pkgs/development/tools/build-managers/cmake/setup-hook.sh | 6 |
2 files changed, 23 insertions, 17 deletions
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix index d6cbcccc517c4..587b7dce22048 100644 --- a/pkgs/development/tools/build-managers/cmake/default.nix +++ b/pkgs/development/tools/build-managers/cmake/default.nix @@ -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 ]; + }; } diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh index 71afcefe3cb6f..21d71628c077e 100755 --- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -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() |