llvmPackages_7.libunwind: simplify expressions

* Use LLVM_PATH instead of llvm-config
* Pass less unnecessary options to cmake
This commit is contained in:
sternenseemann 2021-04-26 21:47:02 +02:00 committed by John Ericson
parent 1f520667be
commit 53adcfb798

View File

@ -1,4 +1,4 @@
{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm, libcxx
{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm
, enableShared ? !stdenv.hostPlatform.isStatic
}:
@ -8,6 +8,11 @@ stdenv.mkDerivation {
src = fetch "libunwind" "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp";
postUnpack = ''
unpackFile ${llvm.src}
cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*))
'';
patches = [
./gnu-install-dirs.patch
] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
@ -24,12 +29,11 @@ stdenv.mkDerivation {
})
];
nativeBuildInputs = [ cmake llvm.dev ];
nativeBuildInputs = [ cmake ];
cmakeFlags = lib.optionals (!enableShared) [
"-DLIBUNWIND_ENABLE_SHARED=OFF"
] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
"-DLIBUNWIND_HAS_NOSTDINCXX_FLAG=ON"
"-DLLVM_ENABLE_LIBCXX=ON"
];
}