2019-03-03 22:10:50 +00:00
|
|
|
{ stdenv, fetchurl, libelf, zlib }:
|
2012-12-01 20:28:32 +00:00
|
|
|
|
2017-02-07 06:51:32 +00:00
|
|
|
let
|
2018-11-09 19:15:49 +00:00
|
|
|
version = "20181024";
|
2012-12-01 20:28:32 +00:00
|
|
|
src = fetchurl {
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://www.prevanders.net/libdwarf-${version}.tar.gz";
|
2018-03-14 20:42:45 +00:00
|
|
|
# Upstream displays this hash broken into three parts:
|
|
|
|
sha512 = "02f8024bb9959c91a1fe322459f7587a589d096595"
|
|
|
|
+ "6d643921a173e6f9e0a184db7aef66f0fd2548d669"
|
|
|
|
+ "5be7f9ee368f1cc8940cea4ddda01ff99d28bbf1fe58";
|
2012-12-01 20:28:32 +00:00
|
|
|
};
|
2017-02-07 06:51:32 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.prevanders.net/dwarf.html";
|
2017-02-07 06:51:32 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2018-08-08 19:25:24 +00:00
|
|
|
license = stdenv.lib.licenses.lgpl21Plus;
|
2017-02-07 06:51:32 +00:00
|
|
|
};
|
2012-12-01 20:28:32 +00:00
|
|
|
|
2017-02-07 06:51:32 +00:00
|
|
|
in rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
libdwarf = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "libdwarf";
|
|
|
|
inherit version;
|
2012-12-01 20:28:32 +00:00
|
|
|
|
2017-02-07 06:51:32 +00:00
|
|
|
configureFlags = [ "--enable-shared" "--disable-nonshared" ];
|
2012-12-01 20:28:32 +00:00
|
|
|
|
2017-02-07 06:51:32 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd libdwarf
|
|
|
|
'';
|
2019-03-03 22:10:50 +00:00
|
|
|
buildInputs = [ libelf zlib ];
|
2012-12-01 20:28:32 +00:00
|
|
|
|
2017-02-07 06:51:32 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib $out/include
|
|
|
|
cp libdwarf.so.1 $out/lib
|
|
|
|
ln -s libdwarf.so.1 $out/lib/libdwarf.so
|
|
|
|
cp libdwarf.h dwarf.h $out/include
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit meta src;
|
|
|
|
};
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
dwarfdump = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "dwarfdump";
|
|
|
|
inherit version;
|
2017-02-07 06:51:32 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd dwarfdump
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libelf libdwarf ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -m755 -D dwarfdump $out/bin/dwarfdump
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit meta src;
|
2012-12-01 20:28:32 +00:00
|
|
|
};
|
|
|
|
}
|