2012-12-01 21:28:32 +01:00
|
|
|
{ stdenv, fetchurl, libelf }:
|
|
|
|
|
2017-02-07 07:51:32 +01:00
|
|
|
let
|
2017-11-02 19:47:12 +01:00
|
|
|
version = "20170709";
|
2012-12-01 21:28:32 +01:00
|
|
|
src = fetchurl {
|
2017-02-07 07:51:32 +01:00
|
|
|
url = "http://www.prevanders.net/libdwarf-${version}.tar.gz";
|
2017-11-02 19:47:12 +01:00
|
|
|
sha512 = "afff6716ef1af5d8aae2b887f36b9a6547fb576770bc6f630b82725ed1e59cbd"
|
|
|
|
+ "387779aa729bbd1a5ae026a25ac76aacf64b038cd898b2419a8676f9aa8c59f1";
|
2012-12-01 21:28:32 +01:00
|
|
|
};
|
2017-02-07 07:51:32 +01:00
|
|
|
meta = {
|
|
|
|
homepage = https://www.prevanders.net/dwarf.html;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
2012-12-01 21:28:32 +01:00
|
|
|
|
2017-02-07 07:51:32 +01:00
|
|
|
in rec {
|
|
|
|
libdwarf = stdenv.mkDerivation rec {
|
|
|
|
name = "libdwarf-${version}";
|
2012-12-01 21:28:32 +01:00
|
|
|
|
2017-02-07 07:51:32 +01:00
|
|
|
configureFlags = [ "--enable-shared" "--disable-nonshared" ];
|
2012-12-01 21:28:32 +01:00
|
|
|
|
2017-02-07 07:51:32 +01:00
|
|
|
preConfigure = ''
|
|
|
|
cd libdwarf
|
|
|
|
'';
|
|
|
|
buildInputs = [ libelf ];
|
2012-12-01 21:28:32 +01:00
|
|
|
|
2017-02-07 07:51:32 +01: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;
|
|
|
|
};
|
|
|
|
|
|
|
|
dwarfdump = stdenv.mkDerivation rec {
|
|
|
|
name = "dwarfdump-${version}";
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd dwarfdump
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libelf libdwarf ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -m755 -D dwarfdump $out/bin/dwarfdump
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit meta src;
|
2012-12-01 21:28:32 +01:00
|
|
|
};
|
|
|
|
}
|