nixpkgs-suyu/pkgs/development/libraries/libdwarf/default.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, libelf, zlib }:
2017-02-07 07:51:32 +01:00
let
version = "20181024";
src = fetchurl {
url = "https://www.prevanders.net/libdwarf-${version}.tar.gz";
# Upstream displays this hash broken into three parts:
sha512 = "02f8024bb9959c91a1fe322459f7587a589d096595"
+ "6d643921a173e6f9e0a184db7aef66f0fd2548d669"
+ "5be7f9ee368f1cc8940cea4ddda01ff99d28bbf1fe58";
};
2017-02-07 07:51:32 +01:00
meta = {
homepage = https://www.prevanders.net/dwarf.html;
platforms = stdenv.lib.platforms.linux;
2018-08-08 21:25:24 +02:00
license = stdenv.lib.licenses.lgpl21Plus;
2017-02-07 07:51:32 +01:00
};
2017-02-07 07:51:32 +01:00
in rec {
libdwarf = stdenv.mkDerivation rec {
name = "libdwarf-${version}";
2017-02-07 07:51:32 +01:00
configureFlags = [ "--enable-shared" "--disable-nonshared" ];
2017-02-07 07:51:32 +01:00
preConfigure = ''
cd libdwarf
'';
buildInputs = [ libelf zlib ];
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;
};
}