nixpkgs/pkgs/development/tools/analysis/radare2/default.nix

62 lines
1.7 KiB
Nix
Raw Normal View History

{stdenv, fetchFromGitHub, pkgconfig, libusb, readline, libewf, perl, zlib, openssl
, gtk2 ? null, vte ? null, gtkdialog ? null
, python ? null
, ruby ? null
, lua ? null
, useX11, rubyBindings, pythonBindings, luaBindings
}:
2014-09-03 21:01:39 +02:00
assert useX11 -> (gtk2 != null && vte != null && gtkdialog != null);
2014-09-03 21:01:39 +02:00
assert rubyBindings -> ruby != null;
assert pythonBindings -> python != null;
2016-05-06 16:30:50 +02:00
let
2017-08-18 03:53:24 +02:00
inherit (stdenv.lib) optional;
2014-09-03 21:01:39 +02:00
in
stdenv.mkDerivation rec {
2018-04-12 23:22:24 +02:00
version = "2.5.0";
2014-09-03 21:01:39 +02:00
name = "radare2-${version}";
2017-08-18 03:53:24 +02:00
src = fetchFromGitHub {
owner = "radare";
repo = "radare2";
rev = version;
2018-04-12 23:22:24 +02:00
sha256 = "07x94chkhpn3wgw4pypn35psxq370j6xwmhf1mh5z27cqkq7c2yd";
2014-09-03 21:01:39 +02:00
};
# do not try to update capstone
WITHOUT_PULL=1;
2017-08-18 03:53:24 +02:00
postPatch = let
2018-03-07 01:35:29 +01:00
cs_tip = "4a1b580d069c82d60070d0869a87000db7cdabe2"; # version from $sourceRoot/shlr/Makefile
capstone = fetchFromGitHub {
owner = "aquynh";
repo = "capstone";
rev = cs_tip;
sha256 = "0v6rxfpxjq0hf40qn1n5m5wsv1dv6p1j8vm94a708lhvcbk9nkv8";
2017-08-18 03:53:24 +02:00
};
in ''
if ! grep -F "CS_TIP=${cs_tip}" shlr/Makefile; then echo "CS_TIP mismatch"; exit 1; fi
cp -r ${capstone} shlr/capstone
chmod -R u+rw shlr/capstone
2017-08-18 03:53:24 +02:00
'';
2014-09-03 21:01:39 +02:00
2017-12-30 01:55:20 +01:00
enableParallelBuilding = true;
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ readline libusb libewf perl zlib openssl]
++ optional useX11 [gtkdialog vte gtk2]
2014-09-03 21:01:39 +02:00
++ optional rubyBindings [ruby]
++ optional pythonBindings [python]
++ optional luaBindings [lua];
meta = {
2017-03-13 17:53:12 +01:00
description = "unix-like reverse engineering framework and commandline tools";
2014-09-03 21:01:39 +02:00
homepage = http://radare.org/;
license = stdenv.lib.licenses.gpl2Plus;
2018-05-23 11:22:49 +02:00
maintainers = with stdenv.lib.maintainers; [raskin makefu mic92];
2014-09-03 21:01:39 +02:00
platforms = with stdenv.lib.platforms; linux;
inherit version;
};
}