summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/llvm/7/libunwind/default.nix
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
committerRobin Gloster <mail@glob.in>2021-05-24 09:55:24 -0500
commit4bc5fbef9d159e143fb7e2c3231932e6e76f667c (patch)
treee2198f5c552e0667d838b8ec764ddb3a4d8f6dec /pkgs/development/compilers/llvm/7/libunwind/default.nix
parentjq: fix build with structured-attrs on darwin (diff)
parentMerge pull request #123802 from superherointj/package-virtmanager-bugfix (diff)
downloadnixpkgs-origin/structured-attrs.tar.gz
Merge remote-tracking branch 'upstream/master' into structured-attrsorigin/structured-attrs
Diffstat (limited to 'pkgs/development/compilers/llvm/7/libunwind/default.nix')
-rw-r--r--pkgs/development/compilers/llvm/7/libunwind/default.nix35
1 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/compilers/llvm/7/libunwind/default.nix b/pkgs/development/compilers/llvm/7/libunwind/default.nix
new file mode 100644
index 000000000000..14c0abc5153f
--- /dev/null
+++ b/pkgs/development/compilers/llvm/7/libunwind/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, version, fetch, fetchpatch, cmake, llvm, libcxx
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation {
+ pname = "libunwind";
+ inherit version;
+
+ src = fetch "libunwind" "035dsxs10nyiqd00q07yycvmkjl01yz4jdlrjvmch8klxg4pyjhp";
+
+ patches = [
+ ./gnu-install-dirs.patch
+ ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
+ # removes use of `new` that require libc++
+ (fetchpatch {
+ url = "https://github.com/llvm-mirror/libunwind/commit/34a45c630d4c79af403661d267db42fbe7de1178.patch";
+ sha256 = "0n0pv6jvcky8pn3srhrf9x5kbnd0d2kia9xlx2g590f5q0bgwfhv";
+ })
+ # cleans up remaining libc++ dependencies (mostly header inclusions)
+ (fetchpatch {
+ url = "https://github.com/llvm-mirror/libunwind/commit/e050272d2eb57eb4e56a37b429a61df2ebb8aa3e.patch";
+ sha256 = "170mwmj0wf40iyk1kzdpaiy36rz9n8dpl881h4h7s5da0rh51xya";
+ includes = [ "src/libunwind.cpp" "src/UnwindCursor.hpp" ];
+ })
+ ];
+
+ nativeBuildInputs = [ cmake llvm.dev ];
+
+ cmakeFlags = lib.optionals (!enableShared) [
+ "-DLIBUNWIND_ENABLE_SHARED=OFF"
+ ] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
+ "-DLIBUNWIND_HAS_NOSTDINCXX_FLAG=ON"
+ "-DLLVM_ENABLE_LIBCXX=ON"
+ ];
+}