7 enableShared ? !stdenv.hostPlatform.isStatic,
10 stdenv.mkDerivation rec {
11 pname = "libexecinfo";
15 url = "http://distcache.freebsd.org/local-distfiles/itetcu/${pname}-${version}.tar.bz2";
16 sha256 = "07wvlpc1jk1sj4k5w53ml6wagh0zm9kv2l1jngv8xb7xww9ik8n9";
21 name = "10-execinfo.patch";
22 url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/10-execinfo.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
23 sha256 = "0lnphrad4vspyljnvmm62dyxj98vgp3wabj4w3vfzfph7j8piw7g";
26 name = "20-define-gnu-source.patch";
27 url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
28 sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302";
30 ./30-linux-makefile.patch
37 hardeningEnable = [ "stackprotector" ];
39 buildFlags = lib.optional enableStatic "static" ++ lib.optional enableShared "dynamic";
41 patchFlags = [ "-p0" ];
45 install -Dm644 execinfo.h stacktraverse.h -t $out/include
47 + lib.optionalString enableShared ''
48 install -Dm755 libexecinfo.so.1 -t $out/lib
49 ln -s $out/lib/libexecinfo.so{.1,}
51 + lib.optionalString enableStatic ''
52 install -Dm755 libexecinfo.a -t $out/lib
56 description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility";
57 license = licenses.bsd2;
58 homepage = "https://www.freshports.org/devel/libexecinfo";