1{ stdenv, fetchurl, fetchpatch }:
2
3stdenv.mkDerivation rec {
4 name = "libexecinfo-${version}";
5 version = "1.1";
6
7 src = fetchurl {
8 url = "http://distcache.freebsd.org/local-distfiles/itetcu/${name}.tar.bz2";
9 sha256 = "07wvlpc1jk1sj4k5w53ml6wagh0zm9kv2l1jngv8xb7xww9ik8n9";
10 };
11
12 patches = [
13 (fetchpatch {
14 name = "10-execinfo.patch";
15 url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/10-execinfo.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
16 sha256 = "0lnphrad4vspyljnvmm62dyxj98vgp3wabj4w3vfzfph7j8piw7g";
17 })
18 (fetchpatch {
19 name = "20-define-gnu-source.patch";
20 url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
21 sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302";
22 })
23 (fetchpatch {
24 name = "30-linux-makefile.patch";
25 url = https://git.alpinelinux.org/cgit/aports/plain/main/libexecinfo/30-linux-makefile.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1;
26 sha256 = "1jwjz22z5cjy5h2bfghn62yl9ar8jiqhdvbwrcfavv17ihbhwcaf";
27 })
28 ];
29
30 makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
31
32 patchFlags = "-p0";
33
34 installPhase = ''
35 install -Dm644 execinfo.h stacktraverse.h -t $out/include
36 install -Dm755 libexecinfo.{a,so.1} -t $out/lib
37 ln -s $out/lib/libexecinfo.so{.1,}
38 '';
39
40 meta = with stdenv.lib; {
41 description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility";
42 license = licenses.bsd2;
43 homepage = https://www.freshports.org/devel/libexecinfo;
44 maintainers = with maintainers; [ dtzWill ];
45 };
46}