Revert "Merge pull request #567 from MarcWeber/submit/cmake-improvement"

This reverts commit abc7591aaf3912d819401241d7d2339fb96441f3, reversing changes
made to 6b1ebeccf2c9d9e8f68d7e21a1e55b5d91577683, because they broke half the
packages in stdenv-updates: http://hydra.nixos.org/eval/927013 has further
details.
This commit is contained in:
Peter Simons 2013-06-17 10:19:15 +02:00
parent 12b29fadcb
commit b08e12b37a
4 changed files with 37 additions and 62 deletions

View File

@ -7,7 +7,7 @@ with stdenv.lib;
let let
os = stdenv.lib.optionalString; os = stdenv.lib.optionalString;
majorVersion = "2.8"; majorVersion = "2.8";
minorVersion = "11"; minorVersion = "9";
version = "${majorVersion}.${minorVersion}"; version = "${majorVersion}.${minorVersion}";
in in
@ -18,11 +18,9 @@ stdenv.mkDerivation rec {
src = fetchurl { src = fetchurl {
url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz"; url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
sha256 = "1rgfgzigmc0b2z5330r3ncf003k4bhqwfxbskv0q5ylp2xkd7l10"; sha256 = "1yg68ng732cfm5c0h91chqwhg06zdh45bybm353kd1myk5rwqgfw";
}; };
enableParallelBuilding = true;
patches = patches =
# Don't search in non-Nix locations such as /usr, but do search in # Don't search in non-Nix locations such as /usr, but do search in
# Nixpkgs' Glibc. # Nixpkgs' Glibc.

View File

@ -1,43 +1,41 @@
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/Linux.cmake cmake-2.8.5/Modules/Platform/Linux.cmake
index fe8e003..378512c 100644 --- cmake-2.8.5-orig/Modules/Platform/Linux.cmake 2011-07-08 14:21:44.000000000 +0200
--- a/Modules/Platform/Linux.cmake +++ cmake-2.8.5/Modules/Platform/Linux.cmake 2011-07-21 19:45:00.000000000 +0200
+++ b/Modules/Platform/Linux.cmake @@ -36,13 +36,13 @@
@@ -36,13 +36,13 @@ else()
# checking the platform every time. This option is advanced enough # checking the platform every time. This option is advanced enough
# that only package maintainers should need to adjust it. They are # that only package maintainers should need to adjust it. They are
# capable of providing a setting on the command line. # capable of providing a setting on the command line.
- if(EXISTS "/etc/debian_version") - IF(EXISTS "/etc/debian_version")
- set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL - SET(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
- "Install .so files without execute permission.") - "Install .so files without execute permission.")
- else() - ELSE(EXISTS "/etc/debian_version")
+ # if(EXISTS "/etc/debian_version") + #IF(EXISTS "/etc/debian_version")
+ # set(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL + # SET(CMAKE_INSTALL_SO_NO_EXE 1 CACHE INTERNAL
+ # "Install .so files without execute permission.") + # "Install .so files without execute permission.")
+ # else() + #ELSE(EXISTS "/etc/debian_version")
set(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL SET(CMAKE_INSTALL_SO_NO_EXE 0 CACHE INTERNAL
"Install .so files without execute permission.") "Install .so files without execute permission.")
- endif() - ENDIF(EXISTS "/etc/debian_version")
+ # endif() + #ENDIF(EXISTS "/etc/debian_version")
endif() ENDIF(DEFINED CMAKE_INSTALL_SO_NO_EXE)
# Match multiarch library directory names. # Match multiarch library directory names.
@@ -52,6 +52,6 @@ include(Platform/UnixPaths) @@ -52,6 +52,6 @@
# Debian has lib64 paths only for compatibility so they should not be # Debian has lib64 paths only for compatibility so they should not be
# searched. # searched.
-if(EXISTS "/etc/debian_version") -IF(EXISTS "/etc/debian_version")
- set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE) - SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
-endif() -ENDIF(EXISTS "/etc/debian_version")
+# if(EXISTS "/etc/debian_version") +#IF(EXISTS "/etc/debian_version")
+# set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE) +# SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE)
+#endif() +#ENDIF(EXISTS "/etc/debian_version")
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake diff -ru -x '*~' cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake cmake-2.8.5/Modules/Platform/UnixPaths.cmake
index ccb2663..39834e6 100644 --- cmake-2.8.5-orig/Modules/Platform/UnixPaths.cmake 2011-07-08 14:21:44.000000000 +0200
--- a/Modules/Platform/UnixPaths.cmake +++ cmake-2.8.5/Modules/Platform/UnixPaths.cmake 2011-07-21 19:50:52.000000000 +0200
+++ b/Modules/Platform/UnixPaths.cmake @@ -33,55 +33,18 @@
@@ -33,55 +33,18 @@ get_filename_component(_CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" PATH)
# search types. # search types.
list(APPEND CMAKE_SYSTEM_PREFIX_PATH LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
# Standard # Standard
- /usr/local /usr / - /usr/local /usr /
- -
@ -49,7 +47,7 @@ index ccb2663..39834e6 100644
- ) - )
- -
-# List common include file locations not under the common prefixes. -# List common include file locations not under the common prefixes.
-list(APPEND CMAKE_SYSTEM_INCLUDE_PATH -LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
- # Windows API on Cygwin - # Windows API on Cygwin
- /usr/include/w32api - /usr/include/w32api
- -
@ -58,11 +56,11 @@ index ccb2663..39834e6 100644
- -
- # Other - # Other
- /usr/pkg/include - /usr/pkg/include
- /opt/csw/include /opt/include - /opt/csw/include /opt/include
- /usr/openwin/include - /usr/openwin/include
- ) - )
- -
-list(APPEND CMAKE_SYSTEM_LIBRARY_PATH -LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
- # Windows API on Cygwin - # Windows API on Cygwin
- /usr/lib/w32api - /usr/lib/w32api
- -
@ -71,25 +69,25 @@ index ccb2663..39834e6 100644
- -
- # Other - # Other
- /usr/pkg/lib - /usr/pkg/lib
- /opt/csw/lib /opt/lib - /opt/csw/lib /opt/lib
- /usr/openwin/lib - /usr/openwin/lib
- ) - )
- -
-list(APPEND CMAKE_SYSTEM_PROGRAM_PATH -LIST(APPEND CMAKE_SYSTEM_PROGRAM_PATH
- /usr/pkg/bin - /usr/pkg/bin
+ "@glibc@" + "@glibc@"
) )
list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
- /lib /usr/lib /usr/lib32 /usr/lib64 - /lib /usr/lib /usr/lib32 /usr/lib64
+ "@glibc@/lib" + "@glibc@/lib"
) )
list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include - /usr/include
+ "@glibc@/include" + "@glibc@/include"
) )
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include - /usr/include
+ "@glibc@/include" + "@glibc@/include"
) )

View File

@ -56,20 +56,3 @@ if [ -n "$crossConfig" ]; then
else else
envHooks+=(addCMakeParams) envHooks+=(addCMakeParams)
fi fi
make_cmake_find_libs(){
for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do
case $flag in
-I*)
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}"
;;
-L*)
export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}"
;;
esac
done
}
# not using setupHook, because it could be a setupHook adding additional
# include flags to NIX_CFLAGS_COMPILE
postHooks+=(make_cmake_find_libs)

View File

@ -862,10 +862,6 @@ genericBuild() {
stopNest stopNest
} }
for i in "${postHooks[@]}"; do
$i
done
# Execute the post-hook. # Execute the post-hook.
runHook postHook runHook postHook