cmake: 3.13.4 -> 3.14.5

This commit is contained in:
Tobias Mayer 2019-06-23 23:44:26 +02:00 committed by Frederik Rietdijk
parent e62b771433
commit 2608669904
3 changed files with 44 additions and 63 deletions

View File

@ -13,24 +13,20 @@
assert withQt5 -> useQt4 == false; assert withQt5 -> useQt4 == false;
assert useQt4 -> withQt5 == false; assert useQt4 -> withQt5 == false;
with stdenv.lib;
let let
os = stdenv.lib.optionalString; lib = stdenv.lib;
majorVersion = "3.13"; os = lib.optionalString;
minorVersion = "4"; version = "3.14.5";
# from https://cmake.org/files/v3.13/cmake-3.13.4-SHA-256.txt for cmake-3.13.4.tar.gz # compare with https://cmake.org/files/v${lib.versions.majorMinor version}/cmake-${version}-SHA-256.txt
sha256 = "fdd928fee35f472920071d1c7f1a6a2b72c9b25e04f7a37b409349aef3f20e9b"; sha256 = "505ae49ebe3c63c595fa5f814975d8b72848447ee13b6613b0f8b96ebda18c06";
version = "${majorVersion}.${minorVersion}";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "cmake-${os isBootstrap "boot-"}${os useNcurses "cursesUI-"}${os withQt5 "qt5UI-"}${os useQt4 "qt4UI-"}${version}"; pname = "cmake${os isBootstrap "-boot"}${os useNcurses "-cursesUI"}${os withQt5 "-qt5UI"}${os useQt4 "-qt4UI"}";
inherit version;
inherit majorVersion;
src = fetchurl { src = fetchurl {
url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz"; url = "${meta.homepage}files/v${lib.versions.majorMinor version}/cmake-${version}.tar.gz";
inherit sha256; inherit sha256;
}; };
@ -43,7 +39,7 @@ stdenv.mkDerivation rec {
# Derived from https://github.com/libuv/libuv/commit/1a5d4f08238dd532c3718e210078de1186a5920d # Derived from https://github.com/libuv/libuv/commit/1a5d4f08238dd532c3718e210078de1186a5920d
./libuv-application-services.patch ./libuv-application-services.patch
] ++ optional stdenv.isCygwin ./3.2.2-cygwin.patch; ] ++ lib.optional stdenv.isCygwin ./3.2.2-cygwin.patch;
outputs = [ "out" ]; outputs = [ "out" ];
setOutputFlags = false; setOutputFlags = false;
@ -52,21 +48,21 @@ stdenv.mkDerivation rec {
buildInputs = buildInputs =
[ setupHook pkgconfig ] [ setupHook pkgconfig ]
++ optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ] ++ lib.optionals useSharedLibraries [ bzip2 curl expat libarchive xz zlib libuv rhash ]
++ optional useNcurses ncurses ++ lib.optional useNcurses ncurses
++ optional useQt4 qt4 ++ lib.optional useQt4 qt4
++ optional withQt5 qtbase; ++ lib.optional withQt5 qtbase;
depsBuildBuild = [ buildPackages.stdenv.cc ]; depsBuildBuild = [ buildPackages.stdenv.cc ];
propagatedBuildInputs = optional stdenv.isDarwin ps; propagatedBuildInputs = lib.optional stdenv.isDarwin ps;
preConfigure = '' preConfigure = ''
fixCmakeFiles . fixCmakeFiles .
substituteInPlace Modules/Platform/UnixPaths.cmake \ substituteInPlace Modules/Platform/UnixPaths.cmake \
--subst-var-by libc_bin ${getBin stdenv.cc.libc} \ --subst-var-by libc_bin ${lib.getBin stdenv.cc.libc} \
--subst-var-by libc_dev ${getDev stdenv.cc.libc} \ --subst-var-by libc_dev ${lib.getDev stdenv.cc.libc} \
--subst-var-by libc_lib ${getLib stdenv.cc.libc} --subst-var-by libc_lib ${lib.getLib stdenv.cc.libc}
substituteInPlace Modules/FindCxxTest.cmake \ substituteInPlace Modules/FindCxxTest.cmake \
--replace "$""{PYTHON_EXECUTABLE}" ${stdenv.shell} --replace "$""{PYTHON_EXECUTABLE}" ${stdenv.shell}
# BUILD_CC and BUILD_CXX are used to bootstrap cmake # BUILD_CC and BUILD_CXX are used to bootstrap cmake
@ -74,9 +70,9 @@ stdenv.mkDerivation rec {
''; '';
configureFlags = [ configureFlags = [
"--docdir=share/doc/${name}" "--docdir=share/doc/${pname}${version}"
] ++ (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 || withQt5) "--qt-gui" ++ lib.optional (useQt4 || withQt5) "--qt-gui"
++ [ ++ [
"--" "--"
# We should set the proper `CMAKE_SYSTEM_NAME`. # We should set the proper `CMAKE_SYSTEM_NAME`.
@ -87,15 +83,15 @@ stdenv.mkDerivation rec {
# package being built. # package being built.
"-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++" "-DCMAKE_CXX_COMPILER=${stdenv.cc.targetPrefix}c++"
"-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc" "-DCMAKE_C_COMPILER=${stdenv.cc.targetPrefix}cc"
"-DCMAKE_AR=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar" "-DCMAKE_AR=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
"-DCMAKE_RANLIB=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib" "-DCMAKE_RANLIB=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
"-DCMAKE_STRIP=${getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip" "-DCMAKE_STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
] ]
# Avoid depending on frameworks. # Avoid depending on frameworks.
++ optional (!useNcurses) "-DBUILD_CursesDialog=OFF"; ++ lib.optional (!useNcurses) "-DBUILD_CursesDialog=OFF";
# make install attempts to use the just-built cmake # make install attempts to use the just-built cmake
preInstall = optional (stdenv.hostPlatform != stdenv.buildPlatform) '' preInstall = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ''
sed -i 's|bin/cmake|${buildPackages.cmake}/bin/cmake|g' Makefile sed -i 's|bin/cmake|${buildPackages.cmake}/bin/cmake|g' Makefile
''; '';
@ -108,7 +104,7 @@ stdenv.mkDerivation rec {
doCheck = false; # fails doCheck = false; # fails
meta = with stdenv.lib; { meta = with lib; {
homepage = http://www.cmake.org/; homepage = http://www.cmake.org/;
description = "Cross-Platform Makefile Generator"; description = "Cross-Platform Makefile Generator";
platforms = if useQt4 then qt4.meta.platforms else platforms.all; platforms = if useQt4 then qt4.meta.platforms else platforms.all;

View File

@ -24,36 +24,6 @@ diff -ur cmake-3.12.1/Utilities/cmlibuv/CMakeLists.txt cmake-3.12.1-patched/Util
endif() endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
diff -ur cmake-3.12.1/Utilities/cmlibuv/src/unix/darwin-proctitle.c cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/darwin-proctitle.c
--- cmake-3.12.1/Utilities/cmlibuv/src/unix/darwin-proctitle.c 2018-08-09 21:14:08.000000000 +0900
+++ cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/darwin-proctitle.c 2018-08-13 10:01:29.000000000 +0900
@@ -26,9 +26,7 @@
#include <stdlib.h>
#include <string.h>
-#include <TargetConditionals.h>
-
-#if !TARGET_OS_IPHONE
+#if HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H
# include <CoreFoundation/CoreFoundation.h>
# include <ApplicationServices/ApplicationServices.h>
#endif
@@ -58,7 +56,7 @@
int uv__set_process_title(const char* title) {
-#if TARGET_OS_IPHONE
+#if !HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H
return uv__pthread_setname_np(title);
#else
CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef,
@@ -205,5 +203,5 @@
dlclose(application_services_handle);
return err;
-#endif /* !TARGET_OS_IPHONE */
+#endif /* HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H */
}
diff -ur cmake-3.12.1/Utilities/cmlibuv/src/unix/fsevents.c cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/fsevents.c diff -ur cmake-3.12.1/Utilities/cmlibuv/src/unix/fsevents.c cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/fsevents.c
--- cmake-3.12.1/Utilities/cmlibuv/src/unix/fsevents.c 2018-08-09 21:14:08.000000000 +0900 --- cmake-3.12.1/Utilities/cmlibuv/src/unix/fsevents.c 2018-08-09 21:14:08.000000000 +0900
+++ cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/fsevents.c 2018-08-13 10:01:29.000000000 +0900 +++ cmake-3.12.1-patched/Utilities/cmlibuv/src/unix/fsevents.c 2018-08-13 10:01:29.000000000 +0900

View File

@ -38,12 +38,27 @@ diff -ur cmake-3.9.1/Modules/Platform/UnixPaths.cmake cmake-3.9.1-mod/Modules/Pl
+ @libc_lib@/lib + @libc_lib@/lib
) )
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES if(CMAKE_SYSROOT_COMPILE)
- /usr/include set(_cmake_sysroot_compile "${CMAKE_SYSROOT_COMPILE}")
else()
set(_cmake_sysroot_compile "${CMAKE_SYSROOT}")
endif()
# Default per-language values. These may be later replaced after
# parsing the implicit directory information from compiler output.
set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ @libc_dev@/include + @libc_dev@/include
) )
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES set(_CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES_INIT
- /usr/include ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ @libc_dev@/include
)
set(_CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES_INIT
${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES}
- "${_cmake_sysroot_compile}/usr/include"
+ @libc_dev@/include + @libc_dev@/include
) )