2017-11-08 20:49:40 +00:00
|
|
|
{stdenv, fetchFromGitHub, fetchurl, fetchpatch, pkgconfig, libusb, readline, libewf, perl, zlib, openssl,
|
2016-09-13 18:42:55 +01:00
|
|
|
gtk2 ? null, vte ? null, gtkdialog ? null,
|
2014-09-03 20:01:39 +01:00
|
|
|
python ? null,
|
|
|
|
ruby ? null,
|
|
|
|
lua ? null,
|
|
|
|
useX11, rubyBindings, pythonBindings, luaBindings}:
|
|
|
|
|
2016-09-13 18:42:55 +01:00
|
|
|
assert useX11 -> (gtk2 != null && vte != null && gtkdialog != null);
|
2014-09-03 20:01:39 +01:00
|
|
|
assert rubyBindings -> ruby != null;
|
|
|
|
assert pythonBindings -> python != null;
|
|
|
|
|
2016-05-06 15:30:50 +01:00
|
|
|
let
|
2017-08-18 02:53:24 +01:00
|
|
|
inherit (stdenv.lib) optional;
|
2014-09-03 20:01:39 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2017-12-30 00:54:01 +00:00
|
|
|
version = "2.2.0";
|
2014-09-03 20:01:39 +01:00
|
|
|
name = "radare2-${version}";
|
|
|
|
|
2017-08-18 02:53:24 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "radare";
|
|
|
|
repo = "radare2";
|
|
|
|
rev = version;
|
2017-12-30 00:54:01 +00:00
|
|
|
sha256 = "0rd1dfgwdpn3x1pzi67sw040vxywbg5h6yw0mj317p0p1cvlyihl";
|
2014-09-03 20:01:39 +01:00
|
|
|
};
|
|
|
|
|
2017-08-18 02:53:24 +01:00
|
|
|
postPatch = let
|
|
|
|
cs_ver = "3.0.4"; # version from $sourceRoot/shlr/Makefile
|
|
|
|
capstone = fetchurl {
|
|
|
|
url = "https://github.com/aquynh/capstone/archive/${cs_ver}.tar.gz";
|
|
|
|
sha256 = "1whl5c8j6vqvz2j6ay2pyszx0jg8d3x8hq66cvgghmjchvsssvax";
|
|
|
|
};
|
|
|
|
in ''
|
|
|
|
if ! grep -F "CS_VER=${cs_ver}" shlr/Makefile; then echo "CS_VER mismatch"; exit 1; fi
|
|
|
|
substituteInPlace shlr/Makefile --replace CS_RELEASE=0 CS_RELEASE=1
|
|
|
|
cp ${capstone} shlr/capstone-${cs_ver}.tar.gz
|
|
|
|
|
|
|
|
'';
|
2014-09-03 20:01:39 +01:00
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ readline libusb libewf perl zlib openssl]
|
2016-09-13 18:42:55 +01:00
|
|
|
++ optional useX11 [gtkdialog vte gtk2]
|
2014-09-03 20:01:39 +01:00
|
|
|
++ optional rubyBindings [ruby]
|
|
|
|
++ optional pythonBindings [python]
|
|
|
|
++ optional luaBindings [lua];
|
|
|
|
|
|
|
|
meta = {
|
2017-03-13 16:53:12 +00:00
|
|
|
description = "unix-like reverse engineering framework and commandline tools";
|
2014-09-03 20:01:39 +01:00
|
|
|
homepage = http://radare.org/;
|
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2017-03-13 16:53:12 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [raskin makefu];
|
2014-09-03 20:01:39 +01:00
|
|
|
platforms = with stdenv.lib.platforms; linux;
|
|
|
|
inherit version;
|
|
|
|
};
|
|
|
|
}
|