2021-04-08 16:26:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPackages
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2021-04-08 16:26:57 +00:00
|
|
|
, libusb-compat-0_1
|
|
|
|
, readline
|
|
|
|
, libewf
|
|
|
|
, perl
|
|
|
|
, zlib
|
|
|
|
, openssl
|
|
|
|
, libuv
|
|
|
|
, file
|
|
|
|
, libzip
|
|
|
|
, xxHash
|
|
|
|
, gtk2
|
|
|
|
, vte
|
|
|
|
, gtkdialog
|
|
|
|
, python3
|
|
|
|
, ruby
|
|
|
|
, lua
|
2021-04-22 02:08:21 +00:00
|
|
|
, capstone
|
2020-04-24 23:36:52 +00:00
|
|
|
, useX11 ? false
|
|
|
|
, rubyBindings ? false
|
|
|
|
, pythonBindings ? false
|
|
|
|
, luaBindings ? false
|
|
|
|
}:
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-04-08 16:26:57 +00:00
|
|
|
pname = "radare2";
|
2021-04-25 03:57:28 +00:00
|
|
|
version = "5.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "radare";
|
|
|
|
repo = "radare2";
|
2021-04-25 03:57:28 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "0n3k190qjhdlj10fjqijx6ismz0g7fk28i83j0480cxdqgmmlbxc";
|
2021-04-08 16:26:57 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -D -m755 $src/binr/r2pm/r2pm $out/bin/r2pm
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
WITHOUT_PULL = "1";
|
|
|
|
makeFlags = [
|
2021-04-25 03:57:28 +00:00
|
|
|
"GITTAP=${version}"
|
2021-04-08 16:26:57 +00:00
|
|
|
"RANLIB=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.bintools.targetPrefix}ranlib"
|
|
|
|
];
|
|
|
|
configureFlags = [
|
|
|
|
"--with-sysmagic"
|
|
|
|
"--with-syszip"
|
|
|
|
"--with-sysxxhash"
|
2021-04-22 02:08:21 +00:00
|
|
|
"--with-syscapstone"
|
2021-04-08 16:26:57 +00:00
|
|
|
"--with-openssl"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-04-22 02:08:21 +00:00
|
|
|
buildInputs = [
|
|
|
|
capstone
|
|
|
|
file
|
|
|
|
readline
|
|
|
|
libusb-compat-0_1
|
|
|
|
libewf
|
|
|
|
perl
|
|
|
|
zlib
|
|
|
|
openssl
|
|
|
|
libuv
|
2021-04-25 03:57:28 +00:00
|
|
|
] ++ lib.optional useX11 [ gtkdialog vte gtk2 ]
|
|
|
|
++ lib.optional rubyBindings [ ruby ]
|
|
|
|
++ lib.optional pythonBindings [ python3 ]
|
|
|
|
++ lib.optional luaBindings [ lua ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
# radare2 exposes r_lib which depends on these libraries
|
|
|
|
file # for its list of magic numbers (`libmagic`)
|
|
|
|
libzip
|
|
|
|
xxHash
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
meta = {
|
|
|
|
description = "unix-like reverse engineering framework and commandline tools";
|
|
|
|
homepage = "http://radare.org/";
|
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ raskin makefu mic92 ];
|
|
|
|
platforms = with lib.platforms; linux;
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|