Merge pull request #178206 from AndersonTorres/cmake
cmake: 3.22.3 -> 3.23.2
This commit is contained in:
commit
2de812cd21
@ -1,62 +1,91 @@
|
||||
{ stdenv, lib, fetchurl, pkg-config
|
||||
, bzip2, curlMinimal, expat, libarchive, xz, zlib, libuv, rhash
|
||||
{ lib
|
||||
, stdenv
|
||||
, buildPackages
|
||||
# darwin attributes
|
||||
, bzip2
|
||||
, curlMinimal
|
||||
, expat
|
||||
, fetchurl
|
||||
, libarchive
|
||||
, libuv
|
||||
, ncurses
|
||||
, openssl
|
||||
, pkg-config
|
||||
, qtbase
|
||||
, rhash
|
||||
, sphinx
|
||||
, texinfo
|
||||
, wrapQtAppsHook
|
||||
, xz
|
||||
, zlib
|
||||
, SystemConfiguration
|
||||
, ps
|
||||
, isBootstrap ? false
|
||||
, useOpenSSL ? !isBootstrap
|
||||
, useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin)
|
||||
, useOpenSSL ? !isBootstrap, openssl
|
||||
, useNcurses ? false, ncurses
|
||||
, withQt5 ? false, qtbase, wrapQtAppsHook
|
||||
, buildDocs ? (!isBootstrap && (useNcurses || withQt5)), sphinx, texinfo
|
||||
, uiToolkits ? [] # can contain "ncurses" and/or "qt5"
|
||||
, buildDocs ? !(isBootstrap || (uiToolkits == []))
|
||||
}:
|
||||
|
||||
let
|
||||
cursesUI = lib.elem "ncurses" uiToolkits;
|
||||
qt5UI = lib.elem "qt5" uiToolkits;
|
||||
in
|
||||
# Accepts only "ncurses" and "qt5" as possible uiToolkits
|
||||
assert lib.subtractLists [ "ncurses" "qt5" ] uiToolkits == [];
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cmake"
|
||||
+ lib.optionalString isBootstrap "-boot"
|
||||
+ lib.optionalString useNcurses "-cursesUI"
|
||||
+ lib.optionalString withQt5 "-qt5UI";
|
||||
version = "3.22.3";
|
||||
+ lib.optionalString cursesUI "-cursesUI"
|
||||
+ lib.optionalString qt5UI "-qt5UI";
|
||||
version = "3.23.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://cmake.org/files/v${lib.versions.majorMinor version}/cmake-${version}.tar.gz";
|
||||
sha256 = "sha256-n4RpFm+UVTtpeKFu4pIn7Emi61zrYIJ13sQNiuDRtaA=";
|
||||
sha256 = "sha256-8xa0AFNGb5pBat+YHv2kGxYMqFnpf2pIS0R+opn/Jqo=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Don't search in non-Nix locations such as /usr, but do search in our libc.
|
||||
./search-path.patch
|
||||
|
||||
./001-search-path.diff
|
||||
# Don't depend on frameworks.
|
||||
./application-services.patch
|
||||
|
||||
./002-application-services.diff
|
||||
# Derived from https://github.com/libuv/libuv/commit/1a5d4f08238dd532c3718e210078de1186a5920d
|
||||
./libuv-application-services.patch
|
||||
|
||||
] ++ lib.optional stdenv.isCygwin ./3.2.2-cygwin.patch
|
||||
./003-libuv-application-services.diff
|
||||
]
|
||||
++ lib.optional stdenv.isCygwin ./004-cygwin.diff
|
||||
# Derived from https://github.com/curl/curl/commit/31f631a142d855f069242f3e0c643beec25d1b51
|
||||
++ lib.optional (stdenv.isDarwin && isBootstrap) ./remove-systemconfiguration-dep.patch
|
||||
++ lib.optional (stdenv.isDarwin && isBootstrap) ./005-remove-systemconfiguration-dep.diff
|
||||
# On Darwin, always set CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG.
|
||||
++ lib.optional stdenv.isDarwin ./darwin-always-set-runtime-c-flag.patch;
|
||||
++ lib.optional stdenv.isDarwin ./006-darwin-always-set-runtime-c-flag.diff;
|
||||
|
||||
outputs = [ "out" ]
|
||||
++ lib.optionals buildDocs [ "man" "info" ];
|
||||
outputs = [ "out" ] ++ lib.optionals buildDocs [ "man" "info" ];
|
||||
setOutputFlags = false;
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
|
||||
nativeBuildInputs = [ setupHook pkg-config ]
|
||||
++ lib.optionals buildDocs [ texinfo ]
|
||||
++ lib.optionals withQt5 [ wrapQtAppsHook ];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
setupHook
|
||||
]
|
||||
++ lib.optionals buildDocs [ texinfo ]
|
||||
++ lib.optionals qt5UI [ wrapQtAppsHook ];
|
||||
|
||||
buildInputs = lib.optionals useSharedLibraries [ bzip2 curlMinimal expat libarchive xz zlib libuv rhash ]
|
||||
++ lib.optional useOpenSSL openssl
|
||||
++ lib.optional useNcurses ncurses
|
||||
++ lib.optional withQt5 qtbase
|
||||
++ lib.optional (stdenv.isDarwin && !isBootstrap) SystemConfiguration;
|
||||
buildInputs = lib.optionals useSharedLibraries [
|
||||
bzip2
|
||||
curlMinimal
|
||||
expat
|
||||
libarchive
|
||||
xz
|
||||
zlib
|
||||
libuv
|
||||
rhash
|
||||
]
|
||||
++ lib.optional useOpenSSL openssl
|
||||
++ lib.optional cursesUI ncurses
|
||||
++ lib.optional qt5UI qtbase
|
||||
++ lib.optional (stdenv.isDarwin && !isBootstrap) SystemConfiguration;
|
||||
|
||||
propagatedBuildInputs = lib.optional stdenv.isDarwin ps;
|
||||
|
||||
@ -73,18 +102,21 @@ stdenv.mkDerivation rec {
|
||||
configureFlags = [
|
||||
"CXXFLAGS=-Wno-elaborated-enum-base"
|
||||
"--docdir=share/doc/${pname}${version}"
|
||||
] ++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
|
||||
++ lib.optional withQt5 "--qt-gui"
|
||||
] ++ (if useSharedLibraries
|
||||
then [ "--no-system-jsoncpp" "--system-libs" ]
|
||||
else [ "--no-system-libs" ]) # FIXME: cleanup
|
||||
++ lib.optional qt5UI "--qt-gui"
|
||||
++ lib.optionals buildDocs [
|
||||
"--sphinx-build=${sphinx}/bin/sphinx-build"
|
||||
"--sphinx-man"
|
||||
"--sphinx-info"
|
||||
"--sphinx-man"
|
||||
]
|
||||
# Workaround https://gitlab.kitware.com/cmake/cmake/-/issues/20568
|
||||
++ lib.optionals stdenv.hostPlatform.is32bit [
|
||||
"CFLAGS=-D_FILE_OFFSET_BITS=64"
|
||||
"CXXFLAGS=-D_FILE_OFFSET_BITS=64"
|
||||
] ++ [
|
||||
]
|
||||
++ [
|
||||
"--"
|
||||
# We should set the proper `CMAKE_SYSTEM_NAME`.
|
||||
# http://www.cmake.org/Wiki/CMake_Cross_Compiling
|
||||
@ -100,7 +132,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
"-DCMAKE_USE_OPENSSL=${if useOpenSSL then "ON" else "OFF"}"
|
||||
# Avoid depending on frameworks.
|
||||
"-DBUILD_CursesDialog=${if useNcurses then "ON" else "OFF"}"
|
||||
"-DBUILD_CursesDialog=${if cursesUI then "ON" else "OFF"}"
|
||||
];
|
||||
|
||||
# make install attempts to use the just-built cmake
|
||||
@ -118,19 +150,19 @@ stdenv.mkDerivation rec {
|
||||
doCheck = false; # fails
|
||||
|
||||
meta = with lib; {
|
||||
broken = (withQt5 && stdenv.isDarwin);
|
||||
homepage = "https://cmake.org/";
|
||||
changelog = "https://cmake.org/cmake/help/v${lib.versions.majorMinor version}/release/${lib.versions.majorMinor version}.html";
|
||||
description = "Cross-Platform Makefile Generator";
|
||||
description = "Cross-platform, open-source build system generator";
|
||||
longDescription = ''
|
||||
CMake is an open-source, cross-platform family of tools designed to
|
||||
build, test and package software. CMake is used to control the software
|
||||
CMake is an open-source, cross-platform family of tools designed to build,
|
||||
test and package software. CMake is used to control the software
|
||||
compilation process using simple platform and compiler independent
|
||||
configuration files, and generate native makefiles and workspaces that
|
||||
can be used in the compiler environment of your choice.
|
||||
configuration files, and generate native makefiles and workspaces that can
|
||||
be used in the compiler environment of your choice.
|
||||
'';
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ ttuegel lnl7 ];
|
||||
changelog = "https://cmake.org/cmake/help/v${lib.versions.majorMinor version}/release/${lib.versions.majorMinor version}.html";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ ttuegel lnl7 AndersonTorres ];
|
||||
platforms = platforms.all;
|
||||
broken = (qt5UI && stdenv.isDarwin);
|
||||
};
|
||||
}
|
||||
|
@ -15383,20 +15383,27 @@ with pkgs;
|
||||
|
||||
ctmg = callPackage ../tools/security/ctmg { };
|
||||
|
||||
cmake = libsForQt5.callPackage ../development/tools/build-managers/cmake {
|
||||
cmake = callPackage ../development/tools/build-managers/cmake {
|
||||
inherit (darwin.apple_sdk.frameworks) SystemConfiguration;
|
||||
inherit (libsForQt5) qtbase wrapQtAppsHook;
|
||||
};
|
||||
|
||||
cmakeMinimal = libsForQt5.callPackage ../development/tools/build-managers/cmake {
|
||||
cmakeMinimal = callPackage ../development/tools/build-managers/cmake {
|
||||
isBootstrap = true;
|
||||
qtbase = null;
|
||||
wrapQtAppsHook = null;
|
||||
# There is no SystemConfiguration in bootstrapTools, so this version gets
|
||||
# patched to remove that dependency.
|
||||
SystemConfiguration = null;
|
||||
};
|
||||
|
||||
cmakeCurses = cmake.override { useNcurses = true; };
|
||||
cmakeCurses = cmake.override {
|
||||
uiToolkits = [ "ncurses" ];
|
||||
};
|
||||
|
||||
cmakeWithGui = cmakeCurses.override { withQt5 = true; };
|
||||
cmakeWithGui = cmake.override {
|
||||
uiToolkits = [ "ncurses" "qt5" ];
|
||||
};
|
||||
|
||||
cmake-format = python3Packages.callPackage ../development/tools/cmake-format { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user