cmake: When there is no stdenv.glibc, still fix search paths.
Apply all of the fixups from preConfigure as well! For testing purposes I added the following assert: assert (stdenv ? glibc) -> (stdenv.glibc == stdenv.cc.libc); To ensure behavior in the case there is a 'stdenv.glibc' (linux-only?) wasn't changed, which passes in the configurations I could think of. Not including that since it seems like a bad requirement moving forward.
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
with stdenv.lib;
|
||||
|
||||
assert wantPS -> (ps != null);
|
||||
assert stdenv ? cc;
|
||||
assert stdenv.cc ? libc;
|
||||
|
||||
let
|
||||
os = stdenv.lib.optionalString;
|
||||
@@ -31,9 +33,8 @@ stdenv.mkDerivation rec {
|
||||
url = "http://www.cmake.org/Bug/file_download.php?file_id=4660&type=bug";
|
||||
sha256 = "136z63ff83hnwd247cq4m8m8164pklzyl5i2csf5h6wd8p01pdkj";
|
||||
})] ++
|
||||
# Don't search in non-Nix locations such as /usr, but do search in
|
||||
# Nixpkgs' Glibc.
|
||||
optional (stdenv ? glibc) ./search-path.patch ++
|
||||
# Don't search in non-Nix locations such as /usr, but do search in our libc.
|
||||
[ ./search-path.patch ] ++
|
||||
optional (stdenv ? cross) (fetchurl {
|
||||
name = "fix-darwin-cross-compile.patch";
|
||||
url = "http://public.kitware.com/Bug/file_download.php?"
|
||||
@@ -50,22 +51,24 @@ stdenv.mkDerivation rec {
|
||||
CMAKE_PREFIX_PATH = concatStringsSep ":"
|
||||
(concatMap (p: [ (p.dev or p) (p.out or p) ]) buildInputs);
|
||||
|
||||
configureFlags =
|
||||
"--docdir=/share/doc/${name} --mandir=/share/man --system-libs --no-system-libarchive"
|
||||
+ stdenv.lib.optionalString useQt4 " --qt-gui";
|
||||
configureFlags = [
|
||||
"--docdir=/share/doc/${name}"
|
||||
"--mandir=/share/man"
|
||||
"--system-libs"
|
||||
"--no-system-libarchive"
|
||||
] ++ stdenv.lib.optional useQt4 "--qt-gui";
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
|
||||
preConfigure = with stdenv; optionalString (stdenv ? glibc)
|
||||
''
|
||||
preConfigure = with stdenv; ''
|
||||
source $setupHook
|
||||
fixCmakeFiles .
|
||||
substituteInPlace Modules/Platform/UnixPaths.cmake \
|
||||
--subst-var-by glibc_bin ${getBin glibc} \
|
||||
--subst-var-by glibc_dev ${getDev glibc} \
|
||||
--subst-var-by glibc_lib ${getLib glibc}
|
||||
--subst-var-by libc_bin ${getBin cc.libc} \
|
||||
--subst-var-by libc_dev ${getDev cc.libc} \
|
||||
--subst-var-by libc_lib ${getLib cc.libc}
|
||||
'';
|
||||
|
||||
meta = {
|
||||
|
||||
Reference in New Issue
Block a user