2022-03-29 13:27:13 +00:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, autoreconfHook, xz, buildPackages }:
|
2008-11-12 15:59:38 +00:00
|
|
|
|
2008-01-28 19:45:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libunwind";
|
2021-11-28 07:04:03 +00:00
|
|
|
version = "1.6.2";
|
2015-09-01 18:33:27 +00:00
|
|
|
|
2008-11-12 15:59:38 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://savannah/libunwind/${pname}-${version}.tar.gz";
|
2021-11-28 07:04:03 +00:00
|
|
|
sha256 = "sha256-SmrsZmmR+0XQiJxErt6K1usQgHHDVU/N/2cfnJR5SXY=";
|
2008-11-12 15:59:38 +00:00
|
|
|
};
|
2013-12-20 22:55:49 +00:00
|
|
|
|
2022-03-29 13:27:13 +00:00
|
|
|
patches = [
|
|
|
|
# Fix for aarch64 and non-4K pages. Remove once upgraded past 1.6.2.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/libunwind/libunwind/commit/e85b65cec757ef589f28957d0c6c21c498a03bdf.patch";
|
|
|
|
sha256 = "1lnlygvhqrdrjgw303pg2k2k4ms4gaghpjsgmhk47q83vy1yjwfg";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-06-16 21:30:57 +00:00
|
|
|
postPatch = if (stdenv.cc.isClang || stdenv.hostPlatform.isStatic) then ''
|
2021-12-06 18:40:56 +00:00
|
|
|
substituteInPlace configure.ac --replace "-lgcc_s" ""
|
|
|
|
'' else lib.optionalString stdenv.hostPlatform.isMusl ''
|
2020-03-29 08:55:17 +00:00
|
|
|
substituteInPlace configure.ac --replace "-lgcc_s" "-lgcc_eh"
|
|
|
|
'';
|
|
|
|
|
2017-06-27 01:28:59 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2015-03-29 21:17:35 +00:00
|
|
|
|
2020-11-09 21:22:21 +00:00
|
|
|
outputs = [ "out" "dev" "devman" ];
|
|
|
|
|
|
|
|
# Without latex2man, no man pages are installed despite being
|
|
|
|
# prebuilt in the source tarball.
|
2021-12-06 18:38:34 +00:00
|
|
|
configureFlags = [ "LATEX2MAN=${buildPackages.coreutils}/bin/true" ];
|
2015-10-28 11:43:35 +00:00
|
|
|
|
2013-12-21 08:48:53 +00:00
|
|
|
propagatedBuildInputs = [ xz ];
|
2013-12-20 22:55:49 +00:00
|
|
|
|
2015-05-20 04:34:51 +00:00
|
|
|
postInstall = ''
|
|
|
|
find $out -name \*.la | while read file; do
|
2015-10-28 11:43:35 +00:00
|
|
|
sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file
|
2015-05-20 04:34:51 +00:00
|
|
|
done
|
|
|
|
'';
|
2015-09-01 18:33:27 +00:00
|
|
|
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # fails
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.nongnu.org/libunwind";
|
2008-11-12 15:59:38 +00:00
|
|
|
description = "A portable and efficient API to determine the call-chain of a program";
|
2017-06-27 01:28:59 +00:00
|
|
|
maintainers = with maintainers; [ orivej ];
|
2023-01-12 19:41:28 +00:00
|
|
|
# https://github.com/libunwind/libunwind#libunwind
|
|
|
|
platforms = [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-freebsd13" "i686-linux" "mips64el-linux" "mipsel-linux" "powerpc64-linux" "powerpc64le-linux" "riscv64-linux" "x86_64-freebsd13" "x86_64-linux" "x86_64-solaris" ];
|
2017-06-27 01:28:59 +00:00
|
|
|
license = licenses.mit;
|
2008-11-12 15:59:38 +00:00
|
|
|
};
|
2008-01-28 19:45:30 +00:00
|
|
|
}
|