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