cmake: Tighten deps

- OpenSSL is evidentally an optional dep. I guess pkg-config found it
   before because it was a transitive dep?

 - `zstd` and cross-built CMake can get by with a `cmakeMinimal that we
   use during bootstrapping, so let's restrict to that.
This commit is contained in:
John Ericson 2020-10-02 15:52:11 +00:00
parent 046c6a7038
commit e6294cfb7e
2 changed files with 10 additions and 6 deletions

View File

@ -5,6 +5,7 @@
, ps
, isBootstrap ? false
, useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin)
, useOpenSSL ? !isBootstrap, openssl
, useNcurses ? false, ncurses
, useQt4 ? false, qt4
, withQt5 ? false, qtbase
@ -47,6 +48,7 @@ stdenv.mkDerivation rec {
buildInputs =
[ setupHook pkgconfig ]
++ lib.optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ]
++ lib.optional useOpenSSL openssl
++ lib.optional useNcurses ncurses
++ lib.optional useQt4 qt4
++ lib.optional withQt5 qtbase;
@ -91,13 +93,15 @@ stdenv.mkDerivation rec {
"-DCMAKE_AR=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
"-DCMAKE_RANLIB=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
"-DCMAKE_STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
]
"-DCMAKE_USE_OPENSSL=${if useOpenSSL then "ON" else "OFF"}"
# Avoid depending on frameworks.
++ lib.optional (!useNcurses) "-DBUILD_CursesDialog=OFF";
"-DBUILD_CursesDialog=${if useNcurses then "ON" else "OFF"}"
];
# make install attempts to use the just-built cmake
preInstall = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i 's|bin/cmake|${buildPackages.cmake}/bin/cmake|g' Makefile
sed -i 's|bin/cmake|${buildPackages.cmakeMinimal}/bin/cmake|g' Makefile
'';
dontUseCmakeConfigure = true;

View File

@ -8331,9 +8331,7 @@ in
zssh = callPackage ../tools/networking/zssh { };
zstd = callPackage ../tools/compression/zstd {
cmake = buildPackages.cmake.override {
libarchive = buildPackages.libarchive.override { zstd = null; };
};
cmake = buildPackages.cmakeMinimal;
};
zsync = callPackage ../tools/compression/zsync { };
@ -10825,6 +10823,8 @@ in
cmake = libsForQt5.callPackage ../development/tools/build-managers/cmake { };
cmakeMinimal = cmake.override { isBootstrap = true; };
cmakeCurses = cmake.override { useNcurses = true; };
cmakeWithGui = cmakeCurses.override { withQt5 = true; };