depot/third_party/nixpkgs/pkgs/development/tools/analysis/radare2/default.nix
Default email a97b1c8da0 Project import generated by Copybara.
GitOrigin-RevId: d235056d6d6dcbd2999bd55fd120d831d4df6304
2021-04-22 04:08:21 +02:00

112 lines
2.3 KiB
Nix

{ lib
, fetchpatch
, stdenv
, fetchFromGitHub
, buildPackages
, pkg-config
, libusb-compat-0_1
, readline
, libewf
, perl
, zlib
, openssl
, libuv
, file
, libzip
, xxHash
, gtk2
, vte
, gtkdialog
, python3
, ruby
, lua
, capstone
, useX11 ? false
, rubyBindings ? false
, pythonBindings ? false
, luaBindings ? false
}:
let
inherit (lib) optional;
#<generated>
# DO NOT EDIT! Automatically generated by ./update.py
gittap = "5.2.0";
gittip = "cf3db945083fb4dab951874e5ec1283128deab11";
rev = "5.2.0";
version = "5.2.0";
sha256 = "08azxfk6mw2vr0x4zbz0612rk7pj4mfz8shrzc9ima77wb52b8sm";
#</generated>
in
stdenv.mkDerivation {
pname = "radare2";
inherit version;
src = fetchFromGitHub {
owner = "radare";
repo = "radare2";
inherit rev sha256;
};
patches = [
# fix build against openssl, included in next release
(fetchpatch {
url = "https://github.com/radareorg/radare2/commit/e5e7469b6450c374e0884d35d44824e1a4eb46b4.patch";
sha256 = "sha256-xTmMHvUdW7d2QG7d4hlvMgEcegND7pGU745TWGqzY44=";
})
];
postInstall = ''
install -D -m755 $src/binr/r2pm/r2pm $out/bin/r2pm
'';
WITHOUT_PULL = "1";
makeFlags = [
"GITTAP=${gittap}"
"GITTIP=${gittip}"
"RANLIB=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.bintools.targetPrefix}ranlib"
];
configureFlags = [
"--with-sysmagic"
"--with-syszip"
"--with-sysxxhash"
"--with-syscapstone"
"--with-openssl"
];
enableParallelBuilding = true;
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [
capstone
file
readline
libusb-compat-0_1
libewf
perl
zlib
openssl
libuv
] ++ optional useX11 [ gtkdialog vte gtk2 ]
++ optional rubyBindings [ ruby ]
++ optional pythonBindings [ python3 ]
++ optional luaBindings [ lua ];
propagatedBuildInputs = [
# radare2 exposes r_lib which depends on these libraries
file # for its list of magic numbers (`libmagic`)
libzip
xxHash
];
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;
};
}