2020-06-08 23:16:42 +01:00
|
|
|
{ stdenv, fetchurl, fetchpatch, enableStatic ? true, enableShared ? true }:
|
2017-09-08 06:27:26 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "libexecinfo";
|
2017-09-08 06:27:26 +01:00
|
|
|
version = "1.1";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "http://distcache.freebsd.org/local-distfiles/itetcu/${pname}-${version}.tar.bz2";
|
2017-09-08 06:27:26 +01:00
|
|
|
sha256 = "07wvlpc1jk1sj4k5w53ml6wagh0zm9kv2l1jngv8xb7xww9ik8n9";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2018-02-13 17:03:07 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "10-execinfo.patch";
|
2020-05-15 16:58:27 +01:00
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/10-execinfo.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
|
2018-02-13 17:03:07 +00:00
|
|
|
sha256 = "0lnphrad4vspyljnvmm62dyxj98vgp3wabj4w3vfzfph7j8piw7g";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "20-define-gnu-source.patch";
|
2020-05-15 16:58:27 +01:00
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
|
2018-02-13 17:03:07 +00:00
|
|
|
sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "30-linux-makefile.patch";
|
2020-05-15 16:58:27 +01:00
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/30-linux-makefile.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
|
2018-02-13 17:03:07 +00:00
|
|
|
sha256 = "1jwjz22z5cjy5h2bfghn62yl9ar8jiqhdvbwrcfavv17ihbhwcaf";
|
|
|
|
})
|
2017-09-08 06:27:26 +01:00
|
|
|
];
|
|
|
|
|
2018-02-13 17:05:49 +00:00
|
|
|
makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
|
|
|
|
|
2020-06-08 23:16:42 +01:00
|
|
|
buildFlags =
|
|
|
|
stdenv.lib.optional enableStatic "static"
|
|
|
|
++ stdenv.lib.optional enableShared "dynamic";
|
|
|
|
|
2019-10-27 13:03:25 +00:00
|
|
|
patchFlags = [ "-p0" ];
|
2017-09-08 06:27:26 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm644 execinfo.h stacktraverse.h -t $out/include
|
2020-06-08 23:16:42 +01:00
|
|
|
'' + stdenv.lib.optionalString enableShared ''
|
|
|
|
install -Dm755 libexecinfo.so.1 -t $out/lib
|
2017-09-08 06:27:26 +01:00
|
|
|
ln -s $out/lib/libexecinfo.so{.1,}
|
2020-06-08 23:16:42 +01:00
|
|
|
'' + stdenv.lib.optionalString enableStatic ''
|
|
|
|
install -Dm755 libexecinfo.a -t $out/lib
|
2017-09-08 06:27:26 +01:00
|
|
|
'';
|
2018-02-13 17:03:07 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2018-02-13 17:05:49 +00:00
|
|
|
description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility";
|
2018-02-13 17:03:07 +00:00
|
|
|
license = licenses.bsd2;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://www.freshports.org/devel/libexecinfo";
|
2018-02-13 17:03:07 +00:00
|
|
|
maintainers = with maintainers; [ dtzWill ];
|
|
|
|
};
|
2017-09-08 06:27:26 +01:00
|
|
|
}
|