linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / libraries / libunwind / default.nix
blobb2b5db2309c1802ccaa4c109d5a1c11e4edf61b2
1 { stdenv, lib, fetchurl, autoreconfHook, xz, coreutils }:
3 stdenv.mkDerivation rec {
4   pname = "libunwind";
5   version = "1.4.0";
7   src = fetchurl {
8     url = "mirror://savannah/libunwind/${pname}-${version}.tar.gz";
9     sha256 = "0dc46flppifrv2z0mrdqi60165ghxm1wk0g47vcbyzjdplqwjnfz";
10   };
12   patches = [ ./backtrace-only-with-glibc.patch ];
14   postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
15     substituteInPlace configure.ac --replace "-lgcc_s" "-lgcc_eh"
16   '';
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 ];
28   postInstall = ''
29     find $out -name \*.la | while read file; do
30       sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file
31     done
32   '';
34   doCheck = false; # fails
36   meta = with lib; {
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;
42   };
44   passthru.supportsHost = !stdenv.hostPlatform.isRiscV;