From 753058baef591f68767de08984a463f50ccd8bf2 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sun, 19 Feb 2017 13:18:01 -0600 Subject: [PATCH] libc++-4.0rc2: Use substituteInPlace instead of the Darwin patch. On 3.9 the substituteInPlace is equivalent to the patch, hopefully this is a slightly more robust way to make the same substitution for the 4.0 version. Apply this change unconditionally for consistency across versions, even if the changed strings are unused on other platforms. Discussion: https://github.com/NixOS/nixpkgs/pull/22970#discussion_r101926144 --- .../compilers/llvm/4.0/libc++/darwin.patch | 39 ------------------- .../compilers/llvm/4.0/libc++/default.nix | 4 +- 2 files changed, 3 insertions(+), 40 deletions(-) delete mode 100644 pkgs/development/compilers/llvm/4.0/libc++/darwin.patch diff --git a/pkgs/development/compilers/llvm/4.0/libc++/darwin.patch b/pkgs/development/compilers/llvm/4.0/libc++/darwin.patch deleted file mode 100644 index 6dd756f01cc2..000000000000 --- a/pkgs/development/compilers/llvm/4.0/libc++/darwin.patch +++ /dev/null @@ -1,39 +0,0 @@ ---- libcxx-3.8.0.src.org/lib/CMakeLists.txt 2015-12-16 15:41:05.000000000 -0800 -+++ libcxx-3.8.0.src/lib/CMakeLists.txt 2016-06-17 19:40:00.293394500 -0700 -@@ -94,30 +94,30 @@ - add_definitions(-D__STRICT_ANSI__) - add_link_flags( - "-compatibility_version 1" - "-current_version 1" -- "-install_name /usr/lib/libc++.1.dylib" -- "-Wl,-reexport_library,/usr/lib/libc++abi.dylib" -+ "-install_name ${LIBCXX_LIBCXXABI_LIB_PATH}/libc++.1.dylib" -+ "-Wl,-reexport_library,${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib" - "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp" - "/usr/lib/libSystem.B.dylib") - else() - if ( ${CMAKE_OSX_SYSROOT} ) - list(FIND ${CMAKE_OSX_ARCHITECTURES} "armv7" OSX_HAS_ARMV7) - if (OSX_HAS_ARMV7) - set(OSX_RE_EXPORT_LINE -- "${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib" -+ "${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib" - "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp") - else() - set(OSX_RE_EXPORT_LINE -- "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib") -+ "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib") - endif() - else() -- set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") -+ set(OSX_RE_EXPORT_LINE "${LIBCXX_LIBCXXABI_LIB_PATH}/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") - endif() - - add_link_flags( - "-compatibility_version 1" -- "-install_name /usr/lib/libc++.1.dylib" -+ "-install_name ${LIBCXX_LIBCXXABI_LIB_PATH}/libc++.1.dylib" - "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp" - "${OSX_RE_EXPORT_LINE}" - "-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/notweak.exp" - "-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/weak.exp") diff --git a/pkgs/development/compilers/llvm/4.0/libc++/default.nix b/pkgs/development/compilers/llvm/4.0/libc++/default.nix index 76ca05333231..9f950e601b21 100644 --- a/pkgs/development/compilers/llvm/4.0/libc++/default.nix +++ b/pkgs/development/compilers/llvm/4.0/libc++/default.nix @@ -15,7 +15,9 @@ stdenv.mkDerivation rec { cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR") ''; - patches = lib.optional stdenv.isDarwin ./darwin.patch; + patchPhase = '' + substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++" + ''; buildInputs = [ cmake llvm libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;