nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, llvm_meta, version, fetch, cmake, fetchpatch
2, enableShared ? !stdenv.hostPlatform.isStatic
3}:
4
5stdenv.mkDerivation rec {
6 pname = "libunwind";
7 inherit version;
8
9 src = fetch pname "0vhgcgzsb33l83qaikrkj87ypqb48mi607rccczccwiiv8ficw0q";
10
11 patches = [
12 (fetchpatch {
13 url = "https://github.com/llvm-mirror/libunwind/commit/34a45c630d4c79af403661d267db42fbe7de1178.patch";
14 sha256 = "0n0pv6jvcky8pn3srhrf9x5kbnd0d2kia9xlx2g590f5q0bgwfhv";
15 })
16 (fetchpatch {
17 url = "https://github.com/llvm-mirror/libunwind/commit/e050272d2eb57eb4e56a37b429a61df2ebb8aa3e.patch";
18 sha256 = "1sxyx5xnax8k713jjcxgq3jq3cpnxygs2rcdf5vfja0f2k9jzldl";
19 })
20 ./gnu-install-dirs.patch
21 ];
22
23 outputs = [ "out" "dev" ];
24
25 nativeBuildInputs = [ cmake ];
26
27 cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
28
29 meta = llvm_meta // {
30 # Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
31 homepage = "https://clang.llvm.org/docs/Toolchain.html#unwind-library";
32 description = "LLVM's unwinder library";
33 longDescription = ''
34 The unwind library provides a family of _Unwind_* functions implementing
35 the language-neutral stack unwinding portion of the Itanium C++ ABI (Level
36 I). It is a dependency of the C++ ABI library, and sometimes is a
37 dependency of other runtimes.
38 '';
39 };
40}