nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, fetchurl, autoreconfHook, xz }:
2
3stdenv.mkDerivation rec {
4 pname = "libunwind";
5 version = "1.4.0";
6
7 src = fetchurl {
8 url = "mirror://savannah/libunwind/${pname}-${version}.tar.gz";
9 sha256 = "0dc46flppifrv2z0mrdqi60165ghxm1wk0g47vcbyzjdplqwjnfz";
10 };
11
12 patches = [ ./backtrace-only-with-glibc.patch ];
13
14 postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
15 substituteInPlace configure.ac --replace "-lgcc_s" "-lgcc_eh"
16 '';
17
18 nativeBuildInputs = [ autoreconfHook ];
19
20 outputs = [ "out" "dev" ];
21
22 propagatedBuildInputs = [ xz ];
23
24 postInstall = ''
25 find $out -name \*.la | while read file; do
26 sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file
27 done
28 '';
29
30 doCheck = false; # fails
31
32 meta = with stdenv.lib; {
33 homepage = "https://www.nongnu.org/libunwind";
34 description = "A portable and efficient API to determine the call-chain of a program";
35 maintainers = with maintainers; [ orivej ];
36 platforms = platforms.linux;
37 license = licenses.mit;
38 };
39
40 passthru.supportsHost = !stdenv.hostPlatform.isRiscV;
41}