commit
dcb2ea2fc5
1 changed files with 29 additions and 33 deletions
|
@ -3,6 +3,8 @@
|
|||
, fetchFromGitHub
|
||||
, buildPackages
|
||||
, pkg-config
|
||||
, meson
|
||||
, ninja
|
||||
, libusb-compat-0_1
|
||||
, readline
|
||||
, libewf
|
||||
|
@ -19,74 +21,68 @@
|
|||
, python3
|
||||
, ruby
|
||||
, lua
|
||||
, lz4
|
||||
, capstone
|
||||
, useX11 ? false
|
||||
, rubyBindings ? false
|
||||
, pythonBindings ? false
|
||||
, luaBindings ? false
|
||||
}:
|
||||
|
||||
let
|
||||
# FIXME: Compare revision with https://github.com/radareorg/radare2/blob/master/libr/asm/arch/arm/v35arm64/Makefile#L20
|
||||
# FIXME: Compare revision with
|
||||
# https://github.com/radareorg/radare2/blob/master/libr/asm/arch/arm/v35arm64/Makefile#L26-L27
|
||||
arm64 = fetchFromGitHub {
|
||||
owner = "radareorg";
|
||||
repo = "vector35-arch-arm64";
|
||||
rev = "9ab2b0bedde459dc86e079718333de4a63bbbacb";
|
||||
sha256 = "sha256-2KLtjgCqHzBBlo9ImZ8WJ1bsWy/kdJCjCFxlLE+HxoI=";
|
||||
rev = "c9e7242972837ac11fc94db05fabcb801a8269c9";
|
||||
hash = "sha256-HFQj23GlLAyyzMGnPq40XaPv5qPDHdDlQOo0Hprc9Cs=";
|
||||
};
|
||||
armv7 = fetchFromGitHub {
|
||||
owner = "radareorg";
|
||||
repo = "vector35-arch-armv7";
|
||||
rev = "dde39f69ffea19fc37e681874b12cb4707bc4f30";
|
||||
|
||||
sha256 = "sha256-bnWQc0dScM9rhIdzf+iVXvMqYWq/bguEAUQPaZRgdlU=";
|
||||
hash = "sha256-bnWQc0dScM9rhIdzf+iVXvMqYWq/bguEAUQPaZRgdlU=";
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "radare2";
|
||||
version = "5.7.2";
|
||||
version = "5.7.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "radare";
|
||||
repo = "radare2";
|
||||
rev = version;
|
||||
sha256 = "sha256-TZeW+9buJvCOudHsLTMITFpRUlmNpo71efc3xswJoPw=";
|
||||
hash = "sha256-+/9SeILuDCUaYwPhhN6z3vQFicd1Bh8N/yicZTybR5o=";
|
||||
};
|
||||
|
||||
preBuild = ''
|
||||
cp -r ${arm64} libr/asm/arch/arm/v35arm64/arch-arm64
|
||||
chmod -R +w libr/asm/arch/arm/v35arm64/arch-arm64
|
||||
cp -r ${arm64} ../libr/asm/arch/arm/v35arm64/arch-arm64
|
||||
chmod -R +w ../libr/asm/arch/arm/v35arm64/arch-arm64
|
||||
|
||||
cp -r ${armv7} libr/asm/arch/arm/v35arm64/arch-armv7
|
||||
chmod -R +w libr/asm/arch/arm/v35arm64/arch-armv7
|
||||
cp -r ${armv7} ../libr/asm/arch/arm/v35arm64/arch-armv7
|
||||
chmod -R +w ../libr/asm/arch/arm/v35arm64/arch-armv7
|
||||
'';
|
||||
|
||||
postFixup = lib.optionalString stdenv.isDarwin ''
|
||||
for file in $out/bin/rasm2 $out/bin/ragg2 $out/bin/rabin2 $out/lib/libr_asm.${version}.dylib $out/lib/libr_anal.${version}.dylib; do
|
||||
install_name_tool -change libcapstone.4.dylib ${capstone}/lib/libcapstone.4.dylib $file
|
||||
done
|
||||
install_name_tool -add_rpath $out/lib $out/lib/libr_io.${version}.dylib
|
||||
'';
|
||||
|
||||
WITHOUT_PULL = "1";
|
||||
makeFlags = [
|
||||
"GITTAP=${version}"
|
||||
"RANLIB=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.bintools.targetPrefix}ranlib"
|
||||
"CC=${stdenv.cc.targetPrefix}cc"
|
||||
"HOST_CC=${stdenv.cc.targetPrefix}cc"
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--with-sysmagic"
|
||||
"--with-syszip"
|
||||
"--with-sysxxhash"
|
||||
"--with-syscapstone"
|
||||
"--with-openssl"
|
||||
mesonFlags = [
|
||||
"-Duse_sys_capstone=true"
|
||||
"-Duse_sys_magic=true"
|
||||
"-Duse_sys_zip=true"
|
||||
"-Duse_sys_xxhash=true"
|
||||
"-Duse_sys_lz4=true"
|
||||
"-Dr2_gittap=${version}"
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [ pkg-config meson ninja python3 ];
|
||||
buildInputs = [
|
||||
capstone
|
||||
file
|
||||
|
@ -97,9 +93,9 @@ stdenv.mkDerivation rec {
|
|||
zlib
|
||||
openssl
|
||||
libuv
|
||||
lz4
|
||||
] ++ lib.optionals useX11 [ gtkdialog vte gtk2 ]
|
||||
++ lib.optionals rubyBindings [ ruby ]
|
||||
++ lib.optionals pythonBindings [ python3 ]
|
||||
++ lib.optionals luaBindings [ lua ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
|
@ -110,10 +106,10 @@ stdenv.mkDerivation rec {
|
|||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "unix-like reverse engineering framework and commandline tools";
|
||||
homepage = "https://radare.org/";
|
||||
description = "UNIX-like reverse engineering framework and command-line tools";
|
||||
homepage = "https://radare.org";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ raskin makefu mic92 arkivm ];
|
||||
maintainers = with maintainers; [ azahi raskin makefu mic92 arkivm ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue