Revert "cmake: use supplied RPATH instead of guessing"

This reverts commit 8ec5adc953d6bbabbe62d7f7229f146202704e53.

This broke stdenv on Darwin, see #15881. A Darwin user will need to fix
the problem and un-revert. This commit causes CMake to use the same
RPATH settings as the compiler, so it is obviously correct.

+3 -10
+3 -10
pkgs/development/tools/build-managers/cmake/setup-hook.sh
··· 47 47 cmakeFlags="-DCMAKE_INSTALL_LIBDIR=${!outputLib}/lib $cmakeFlags" 48 48 cmakeFlags="-DCMAKE_INSTALL_INCLUDEDIR=${!outputDev}/include $cmakeFlags" 49 49 50 - # Always build Release, to ensure optimisation flags. 51 - cmakeFlags="-DCMAKE_BUILD_TYPE=Release $cmakeFlags" 52 - # Do not change the RPATH between build and install, simply 53 - # build with the correct RPATH in the first place. 54 - cmakeFlags="-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE $cmakeFlags" 55 - # Do not try to guess the correct RPATH based on linker flags. 56 - cmakeFlags="-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=FALSE $cmakeFlags" 57 - # Just use exactly our RPATH. 58 - cmakeFlags="-DCMAKE_INSTALL_RPATH=$CMAKE_INSTALL_RPATH $cmakeFlags" 50 + # Avoid cmake resetting the rpath of binaries, on make install 51 + # And build always Release, to ensure optimisation flags 52 + cmakeFlags="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON $cmakeFlags" 59 53 60 54 echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}" 61 55 ··· 83 77 ;; 84 78 -L*) 85 79 export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}" 86 - export CMAKE_INSTALL_RPATH="$CMAKE_INSTALL_RPATH${CMAKE_INSTALL_RPATH:+:}${flag:2}" 87 80 ;; 88 81 esac 89 82 done