Merge branch 'pull-28954' into staging

Update CMake, see #28954.
This commit is contained in:
Thomas Tuegel 2017-09-06 08:02:20 -05:00
commit 78dde570fd
No known key found for this signature in database
GPG Key ID: 22CBF5249D4B4D59
4 changed files with 78 additions and 87 deletions

View File

@ -6,26 +6,30 @@
, useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin) , useSharedLibraries ? (!isBootstrap && !stdenv.isCygwin)
, useNcurses ? false, ncurses , useNcurses ? false, ncurses
, useQt4 ? false, qt4 , useQt4 ? false, qt4
, withQt5 ? false, qtbase
}: }:
assert withQt5 -> useQt4 == false;
assert useQt4 -> withQt5 == false;
with stdenv.lib; with stdenv.lib;
let let
os = stdenv.lib.optionalString; os = stdenv.lib.optionalString;
majorVersion = "3.8"; majorVersion = "3.9";
minorVersion = "2"; minorVersion = "1";
version = "${majorVersion}.${minorVersion}"; version = "${majorVersion}.${minorVersion}";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "cmake-${os isBootstrap "boot-"}${os useNcurses "cursesUI-"}${os useQt4 "qt4UI-"}${version}"; name = "cmake-${os isBootstrap "boot-"}${os useNcurses "cursesUI-"}${os withQt5 "qt5UI-"}${os useQt4 "qt4UI-"}${version}";
inherit majorVersion; inherit majorVersion;
src = fetchurl { src = fetchurl {
url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz"; url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
# from https://cmake.org/files/v3.8/cmake-3.8.2-SHA-256.txt # from https://cmake.org/files/v3.9/cmake-3.9.1-SHA-256.txt
sha256 = "da3072794eb4c09f2d782fcee043847b99bb4cf8d4573978d9b2024214d6e92d"; sha256 = "d768ee83d217f91bb597b3ca2ac663da7a8603c97e1f1a5184bc01e0ad2b12bb";
}; };
prePatch = optionalString (!useSharedLibraries) '' prePatch = optionalString (!useSharedLibraries) ''
@ -34,7 +38,7 @@ stdenv.mkDerivation rec {
''; '';
# Don't search in non-Nix locations such as /usr, but do search in our libc. # Don't search in non-Nix locations such as /usr, but do search in our libc.
patches = [ ./search-path-3.2.patch ] patches = [ ./search-path-3.9.patch ]
++ optional stdenv.isCygwin ./3.2.2-cygwin.patch; ++ optional stdenv.isCygwin ./3.2.2-cygwin.patch;
outputs = [ "out" ]; outputs = [ "out" ];
@ -46,7 +50,8 @@ stdenv.mkDerivation rec {
[ setupHook pkgconfig ] [ setupHook pkgconfig ]
++ optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ] ++ optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ]
++ optional useNcurses ncurses ++ optional useNcurses ncurses
++ optional useQt4 qt4; ++ optional useQt4 qt4
++ optional withQt5 qtbase;
propagatedBuildInputs = optional stdenv.isDarwin ps; propagatedBuildInputs = optional stdenv.isDarwin ps;
@ -63,7 +68,7 @@ stdenv.mkDerivation rec {
configureFlags = [ "--docdir=share/doc/${name}" ] configureFlags = [ "--docdir=share/doc/${name}" ]
++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup ++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
++ optional useQt4 "--qt-gui" ++ optional (useQt4 || withQt5) "--qt-gui"
++ optionals (!useNcurses) [ "--" "-DBUILD_CursesDialog=OFF" ]; ++ optionals (!useNcurses) [ "--" "-DBUILD_CursesDialog=OFF" ];
dontUseCmakeConfigure = true; dontUseCmakeConfigure = true;

View File

@ -1,77 +0,0 @@
diff -ru3 cmake-3.4.3/Modules/Platform/UnixPaths.cmake cmake-3.4.3-new/Modules/Platform/UnixPaths.cmake
--- cmake-3.4.3/Modules/Platform/UnixPaths.cmake 2016-01-25 19:57:19.000000000 +0300
+++ cmake-3.4.3-new/Modules/Platform/UnixPaths.cmake 2016-04-14 00:20:08.963492213 +0300
@@ -32,9 +32,6 @@
# List common installation prefixes. These will be used for all
# search types.
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- # Standard
- /usr/local /usr /
-
# CMake install location
"${_CMAKE_INSTALL_DIR}"
)
@@ -53,44 +50,25 @@
# List common include file locations not under the common prefixes.
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- # Windows API on Cygwin
- /usr/include/w32api
-
- # X11
- /usr/X11R6/include /usr/include/X11
-
- # Other
- /usr/pkg/include
- /opt/csw/include /opt/include
- /usr/openwin/include
+ @libc_dev@/include
)
-
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- # Windows API on Cygwin
- /usr/lib/w32api
-
- # X11
- /usr/X11R6/lib /usr/lib/X11
-
- # Other
- /usr/pkg/lib
- /opt/csw/lib /opt/lib
- /usr/openwin/lib
+ @libc_lib@/lib
)
list(APPEND CMAKE_SYSTEM_PROGRAM_PATH
- /usr/pkg/bin
+ @libc_bin@/bin
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
+ @libc_lib@/lib
)
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @libc_dev@/include
)
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @libc_dev@/include
)
# Enable use of lib64 search path variants by default.
diff -ur cmake-3.7.2-orig/Modules/Platform/WindowsPaths.cmake cmake-3.7.2/Modules/Platform/WindowsPaths.cmake
--- cmake-3.7.2-orig/Modules/Platform/WindowsPaths.cmake 2017-04-26 09:08:39.095674666 -0700
+++ cmake-3.7.2/Modules/Platform/WindowsPaths.cmake 2017-04-28 22:32:10.379015998 -0700
@@ -66,7 +66,7 @@
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
# MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
- list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
+ # list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
endif()
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
diff -ur cmake-3.7.2-orig/Source/cmFindPackageCommand.cxx cmake-3.7.2/Source/cmFindPackageCommand.cxx

View File

@ -0,0 +1,62 @@
diff -ur cmake-3.9.1/Modules/Platform/UnixPaths.cmake cmake-3.9.1-mod/Modules/Platform/UnixPaths.cmake
--- cmake-3.9.1/Modules/Platform/UnixPaths.cmake 2017-08-10 13:36:32.000000000 +0000
+++ cmake-3.9.1-mod/Modules/Platform/UnixPaths.cmake 2017-09-03 01:24:31.901473539 +0000
@@ -22,9 +22,6 @@
# List common installation prefixes. These will be used for all
# search types.
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- # Standard
- /usr/local /usr /
-
# CMake install location
"${_CMAKE_INSTALL_DIR}"
)
@@ -43,31 +40,26 @@
# Non "standard" but common install prefixes
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
- /usr/X11R6
- /usr/pkg
- /opt
)
# List common include file locations not under the common prefixes.
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- # X11
- /usr/include/X11
+ @libc_dev@/include
)
list(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- # X11
- /usr/lib/X11
+ @libc_lib@/lib
)
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
+ @libc_lib@/lib
)
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @libc_dev@/include
)
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+ @libc_dev@/include
)
# Enable use of lib32 and lib64 search path variants by default.
diff -ur cmake-3.9.1/Modules/Platform/WindowsPaths.cmake cmake-3.9.1-mod/Modules/Platform/WindowsPaths.cmake
--- cmake-3.9.1/Modules/Platform/WindowsPaths.cmake 2017-08-10 13:36:32.000000000 +0000
+++ cmake-3.9.1-mod/Modules/Platform/WindowsPaths.cmake 2017-09-03 01:19:32.808355986 +0000
@@ -66,7 +66,7 @@
if(CMAKE_CROSSCOMPILING AND NOT CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
# MinGW (useful when cross compiling from linux with CMAKE_FIND_ROOT_PATH set)
- list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
+ # list(APPEND CMAKE_SYSTEM_PREFIX_PATH /)
endif()
list(APPEND CMAKE_SYSTEM_INCLUDE_PATH

View File

@ -6882,13 +6882,14 @@ with pkgs;
inherit (darwin) ps; inherit (darwin) ps;
}; };
cmake = callPackage ../development/tools/build-managers/cmake { cmake = libsForQt5.callPackage ../development/tools/build-managers/cmake {
inherit (darwin) ps; inherit (darwin) ps;
}; };
cmakeCurses = cmake.override { useNcurses = true; }; cmakeCurses = cmake.override { useNcurses = true; };
cmakeWithGui = cmakeCurses.override { useQt4 = true; }; cmakeWithGui = cmakeCurses.override { withQt5 = true; };
cmakeWithQt4Gui = cmakeCurses.override { useQt4 = true; };
# Does not actually depend on Qt 5 # Does not actually depend on Qt 5
inherit (kdeFrameworks) extra-cmake-modules kapidox kdoctools; inherit (kdeFrameworks) extra-cmake-modules kapidox kdoctools;