1 { stdenv, lib, fetchurl, autoreconfHook, xz, coreutils }:
3 stdenv.mkDerivation rec {
8 url = "mirror://savannah/libunwind/${pname}-${version}.tar.gz";
9 sha256 = "0dc46flppifrv2z0mrdqi60165ghxm1wk0g47vcbyzjdplqwjnfz";
12 patches = [ ./backtrace-only-with-glibc.patch ];
14 postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
15 substituteInPlace configure.ac --replace "-lgcc_s" "-lgcc_eh"
18 nativeBuildInputs = [ autoreconfHook ];
20 outputs = [ "out" "dev" "devman" ];
22 # Without latex2man, no man pages are installed despite being
23 # prebuilt in the source tarball.
24 configureFlags = [ "LATEX2MAN=${coreutils}/bin/true" ];
26 propagatedBuildInputs = [ xz ];
29 find $out -name \*.la | while read file; do
30 sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file
34 doCheck = false; # fails
37 homepage = "https://www.nongnu.org/libunwind";
38 description = "A portable and efficient API to determine the call-chain of a program";
39 maintainers = with maintainers; [ orivej ];
40 platforms = platforms.linux;
41 license = licenses.mit;
44 passthru.supportsHost = !stdenv.hostPlatform.isRiscV;