about summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-02-19 15:24:13 +0100
committerVladimír Čunát <vcunat@gmail.com>2018-02-19 15:24:13 +0100
commit0c8939b5fbb276be0cbf00b6f6bfcbc56806164b (patch)
tree1b260e3a59ca673474580c466274f3b7ca388415 /pkgs/development/tools
parent9cad2a4f4a2de889d20db1eafdb5c7ac552e707b (diff)
parent9b662759053eabe0ccea199b00859243593151f1 (diff)
downloadnixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.tar
nixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.tar.gz
nixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.tar.bz2
nixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.tar.lz
nixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.tar.xz
nixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.tar.zst
nixlib-0c8939b5fbb276be0cbf00b6f6bfcbc56806164b.zip
Merge branch 'master' into gcc-7
Hydra: ?compare=1434487
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/analysis/radare2-cutter/default.nix48
-rw-r--r--pkgs/development/tools/analysis/radare2/default.nix25
2 files changed, 61 insertions, 12 deletions
diff --git a/pkgs/development/tools/analysis/radare2-cutter/default.nix b/pkgs/development/tools/analysis/radare2-cutter/default.nix
new file mode 100644
index 000000000000..3cd1d309e15d
--- /dev/null
+++ b/pkgs/development/tools/analysis/radare2-cutter/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchFromGitHub, fetchpatch, qmake, pkgconfig, qtbase, qtsvg, radare2 }:
+
+
+stdenv.mkDerivation rec {
+  name = "radare2-cutter-${version}";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "radareorg";
+    repo = "cutter";
+    rev = "v${version}";
+    sha256 = "02m5sf45n455hn34y7hrqanj830rc5xhz2ppp1z3mzbz0s515pfl";
+  };
+
+  postUnpack = "export sourceRoot=$sourceRoot/src";
+
+  patches = [
+    # Fixup version number :D
+    (fetchpatch {
+      url = "https://github.com/radareorg/cutter/commit/69506b64600df632afdca8b680baa7d946c78644.patch";
+      sha256 = "0ks3ixz8bycjcfi26bd0p6z7qaplhq00alw44hsfzpdm4bmr01x0";
+    })
+    (fetchpatch {
+      url = "https://github.com/radareorg/cutter/commit/8b52c66f4f0091cd9d97389b32aa519c2c602e2b.patch";
+      sha256 = "0wcdn35lx2943pfzm7mkg4sr82pm0qz3yxf74m8fxbd70s3w0gkm";
+    })
+
+    # case-insensitive filtering
+    (fetchpatch {
+      url = "https://github.com/radareorg/cutter/commit/0ebd34370bcaed00000168147572bb78106eeab1.patch";
+      sha256 = "0sc50jwhncfnd2i5mlyld4dbdzi2ws7nh4yglkhlap9l9h1jxn20";
+    })
+  ];
+
+  patchFlags = [ "-p2" ];
+
+  nativeBuildInputs = [ qmake pkgconfig ];
+  buildInputs = [ qtbase qtsvg radare2 ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A Qt and C++ GUI for radare2 reverse engineering framework";
+    homepage = src.meta.homepage;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/pkgs/development/tools/analysis/radare2/default.nix b/pkgs/development/tools/analysis/radare2/default.nix
index 49f6aeb72799..6a7992b01311 100644
--- a/pkgs/development/tools/analysis/radare2/default.nix
+++ b/pkgs/development/tools/analysis/radare2/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, fetchurl, fetchpatch, pkgconfig, libusb, readline, libewf, perl, zlib, openssl,
+{stdenv, fetchFromGitHub, fetchgit, fetchurl, fetchpatch, pkgconfig, libusb, readline, libewf, perl, zlib, openssl, git,
 gtk2 ? null, vte ? null, gtkdialog ? null,
 python ? null,
 ruby ? null,
@@ -13,32 +13,33 @@ let
   inherit (stdenv.lib) optional;
 in
 stdenv.mkDerivation rec {
-  version = "2.2.0";
+  version = "2.3.0";
   name = "radare2-${version}";
 
   src = fetchFromGitHub {
     owner = "radare";
     repo = "radare2";
     rev = version;
-    sha256 = "0rd1dfgwdpn3x1pzi67sw040vxywbg5h6yw0mj317p0p1cvlyihl";
+    sha256 = "0x5vcprqf0fnj876mdvryfvg7ymbrw1cxrr7a06v0swg7yql1lpw";
   };
 
   postPatch = let
-    cs_ver = "3.0.4"; # version from $sourceRoot/shlr/Makefile
-    capstone = fetchurl {
-      url = "https://github.com/aquynh/capstone/archive/${cs_ver}.tar.gz";
-      sha256 = "1whl5c8j6vqvz2j6ay2pyszx0jg8d3x8hq66cvgghmjchvsssvax";
+    cs_tip = "bdbc57de63725a98732ddc34b48de96f8ada66f2"; # version from $sourceRoot/shlr/Makefile
+    capstone = fetchgit {
+      url = "https://github.com/aquynh/capstone.git";
+      rev = cs_tip;
+      sha256 = "1sqxpjf2dlrg87dm9p39p5d1qzahrnfnrjijpv1xg1shax439jni";
+      leaveDotGit = true;
     };
   in ''
-    if ! grep -F "CS_VER=${cs_ver}" shlr/Makefile; then echo "CS_VER mismatch"; exit 1; fi
-    substituteInPlace shlr/Makefile --replace CS_RELEASE=0 CS_RELEASE=1
-    cp ${capstone} shlr/capstone-${cs_ver}.tar.gz
-
+    if ! grep -F "CS_TIP=${cs_tip}" shlr/Makefile; then echo "CS_TIP mismatch"; exit 1; fi
+    cp -r ${capstone} shlr/capstone
+    chmod -R u+rw shlr/capstone
   '';
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig git ];
   buildInputs = [ readline libusb libewf perl zlib openssl]
     ++ optional useX11 [gtkdialog vte gtk2]
     ++ optional rubyBindings [ruby]