cmake: fix with multiple outputs, split help, refactor

The removed configureFlags seemed to have no effect.
This commit is contained in:
Vladimír Čunát 2015-04-18 22:30:26 +02:00
parent e36dd5acf8
commit a8813a3db0
2 changed files with 26 additions and 23 deletions

View file

@ -25,8 +25,6 @@ stdenv.mkDerivation rec {
sha256 = "0b2hy4p0aa9zshlxyw9nmlh5q8q1lmnwmb594rvh6sx2n7v1r7vm";
};
enableParallelBuilding = true;
patches =
# Don't search in non-Nix locations such as /usr, but do search in
# Nixpkgs' Glibc.
@ -38,41 +36,46 @@ stdenv.mkDerivation rec {
sha256 = "16acmdr27adma7gs9rs0dxdiqppm15vl3vv3agy7y8s94wyh4ybv";
});
outputs = [ "out" "doc" ];
setOutputFlags = false;
setupHook = ./setup-hook.sh;
buildInputs =
[ pkgconfig bzip2 curl expat libarchive xz zlib ]
[ setupHook pkgconfig bzip2 curl expat libarchive xz zlib ]
++ optional (jsoncpp != null) jsoncpp
++ optional useNcurses ncurses
++ optional useQt4 qt4;
propagatedBuildInputs = optional wantPS ps;
CMAKE_PREFIX_PATH = stdenv.lib.concatStringsSep ":" buildInputs;
preConfigure = with stdenv; optionalString (stdenv ? glibc)
''
fixCmakeFiles .
substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by glibc_bin ${glibc.bin or glibc} \
--subst-var-by glibc_dev ${glibc.dev or glibc} \
--subst-var-by glibc_lib ${glibc.out or glibc}
'';
configureFlags =
[
"--docdir=/share/doc/${name}"
"--mandir=/share/man"
"--system-libs"
]
++ optional (jsoncpp == null) "--no-system-jsoncpp"
++ optional useQt4 "--qt-gui";
setupHook = ./setup-hook.sh;
dontUseCmakeConfigure = true;
preConfigure = optionalString (stdenv ? glibc)
''
source $setupHook
fixCmakeFiles .
substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by glibc ${stdenv.glibc}
'';
enableParallelBuilding = true;
meta = {
preInstall = ''mkdir "$doc" '';
postInstall = ''_moveToOutput "share/cmake-*/Help" "$doc" '';
meta = with stdenv.lib; {
homepage = http://www.cmake.org/;
description = "Cross-Platform Makefile Generator";
platforms = if useQt4 then qt4.meta.platforms else stdenv.lib.platforms.all;
maintainers = with stdenv.lib.maintainers; [ urkud mornfall ttuegel ];
platforms = if useQt4 then qt4.meta.platforms else platforms.all;
maintainers = with maintainers; [ urkud mornfall ttuegel ];
};
}

View file

@ -53,21 +53,21 @@ index 20ee1d1..39834e6 100644
-
-list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
- /usr/pkg/bin
+ "@glibc@"
+ "@glibc_bin@"
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
+ "@glibc@/lib"
+ "@glibc_lib@/lib"
)
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ "@glibc@/include"
+ "@glibc_dev@/include"
)
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ "@glibc@/include"
+ "@glibc_dev@/include"
)
# Enable use of lib64 search path variants by default.