about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/analysis/radare2/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/analysis/radare2/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/analysis/radare2/default.nix62
1 files changed, 21 insertions, 41 deletions
diff --git a/nixpkgs/pkgs/development/tools/analysis/radare2/default.nix b/nixpkgs/pkgs/development/tools/analysis/radare2/default.nix
index 1622c6168606..e59c48f91d30 100644
--- a/nixpkgs/pkgs/development/tools/analysis/radare2/default.nix
+++ b/nixpkgs/pkgs/development/tools/analysis/radare2/default.nix
@@ -19,67 +19,38 @@
 , 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.1.1";
-  gittip = "a86f8077fc148abd6443384362a3717cd4310e64";
-  rev = "5.1.1";
-  version = "5.1.1";
-  sha256 = "0hv9x31iabasj12g8f04incr1rbcdkxi3xnqn3ggp8gl4h6pf2f3";
-  cs_ver = "4.0.2";
-  cs_sha256 = "0y5g74yjyliciawpn16zhdwya7bd3d7b1cccpcccc2wg8vni1k2w";
-  #</generated>
-in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "radare2";
-  inherit version;
+  version = "5.2.1";
 
   src = fetchFromGitHub {
     owner = "radare";
     repo = "radare2";
-    inherit rev sha256;
+    rev = version;
+    sha256 = "0n3k190qjhdlj10fjqijx6ismz0g7fk28i83j0480cxdqgmmlbxc";
   };
 
-  postPatch =
-    let
-      capstone = fetchFromGitHub {
-        owner = "aquynh";
-        repo = "capstone";
-        # version from $sourceRoot/shlr/Makefile
-        rev = cs_ver;
-        sha256 = cs_sha256;
-      };
-    in
-    ''
-      mkdir -p build/shlr
-      cp -r ${capstone} capstone-${cs_ver}
-      chmod -R +w capstone-${cs_ver}
-      tar -czvf shlr/capstone-${cs_ver}.tar.gz capstone-${cs_ver}
-    '';
-
   postInstall = ''
     install -D -m755 $src/binr/r2pm/r2pm $out/bin/r2pm
   '';
 
   WITHOUT_PULL = "1";
   makeFlags = [
-    "GITTAP=${gittap}"
-    "GITTIP=${gittip}"
+    "GITTAP=${version}"
     "RANLIB=${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.bintools.targetPrefix}ranlib"
   ];
   configureFlags = [
     "--with-sysmagic"
     "--with-syszip"
     "--with-sysxxhash"
+    "--with-syscapstone"
     "--with-openssl"
   ];
 
@@ -87,11 +58,20 @@ stdenv.mkDerivation {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ 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 ];
+  buildInputs = [
+    capstone
+    file
+    readline
+    libusb-compat-0_1
+    libewf
+    perl
+    zlib
+    openssl
+    libuv
+  ] ++ lib.optional useX11 [ gtkdialog vte gtk2 ]
+    ++ lib.optional rubyBindings [ ruby ]
+    ++ lib.optional pythonBindings [ python3 ]
+    ++ lib.optional luaBindings [ lua ];
 
   propagatedBuildInputs = [
     # radare2 exposes r_lib which depends on these libraries