git.iko.soy/typeable/nixpkgs
on master help sign in
r2, r2-cutter: refactor and bump cutter to 1.7
commit29573133569af11328ad9fd67c78f9a120605eca authorWill Dietz <w@wdtz.org> dateTue 21 Aug 2018, 17:37 (8 years ago) parentec7af52
5 files changed+116−94
pkgs/development/tools/analysis/radare2-cutter/default.nix → pkgs/development/tools/analysis/radare2/cutter.nix+4−15 pkgs/development/tools/analysis/radare2/default.nix+12−78 pkgs/development/tools/analysis/radare2/generic.nix+75 pkgs/development/tools/analysis/radare2/r2-for-cutter.nix+16 pkgs/top-level/all-packages.nix+9−1
pkgs/development/tools/analysis/radare2-cutter/default.nix → pkgs/development/tools/analysis/radare2/cutter.nixrenamed+4−15
@@ -4,22 +4,11 @@
44# Qt
55, qtbase, qtsvg, qtwebengine
66# buildInputs
7−, radare2
7+, r2-for-cutter
88, python3 }:
99
1010let
11− r2 = radare2.overrideDerivation (o: {
12− name = "radare2-for-cutter-${version}";
13− src = fetchFromGitHub {
14− owner = "radare";
15− repo = "radare2";
16− # XXX: The revision used here should match what Cutter uses as submodule.
17− # For now it's the revision cutter-git uses for r2.
18− rev = "c9ec8b54b9ba32ba6712f319825f8d032e573e68";
19− sha256 = "04ri3wis8l1mbcp2gx419x7yfimljn7xa01izch71jy2h2mzk3z6";
20− };
21− });
22− version = "1.6";
11+ version = "1.7";
2312in
2413stdenv.mkDerivation rec {
2514 name = "radare2-cutter-${version}";
@@ -28,7 +17,7 @@ stdenv.mkDerivation rec {
2817 owner = "radareorg";
2918 repo = "cutter";
3019 rev = "v${version}";
31− sha256 = "1ps52yf94yfnws3nn1iiwch2jy33dyvi7j47xkmh0m5fpdqi5xk7";
20+ sha256 = "0z9wzxd5hw0ivakrg3xiv4zx1rjj032hlmizq0pxj22xjrj1gg9n";
3221 };
3322
3423 postUnpack = "export sourceRoot=$sourceRoot/src";
@@ -43,7 +32,7 @@ stdenv.mkDerivation rec {
4332 '';
4433
4534 nativeBuildInputs = [ qmake pkgconfig ];
46− buildInputs = [ qtbase qtsvg qtwebengine r2 python3 ];
35+ buildInputs = [ qtbase qtsvg qtwebengine r2-for-cutter python3 ];
4736
4837 qmakeFlags = [
4938 "CONFIG+=link_pkgconfig"
pkgs/development/tools/analysis/radare2/default.nix+12−78
@@ -1,82 +1,16 @@
1−{stdenv, fetchFromGitHub
2−, ninja, meson , pkgconfig
3−, libusb, readline, libewf, perl, zlib, openssl
4−, gtk2 ? null, vte ? null, gtkdialog ? null
5−, python ? null
6−, ruby ? null
7−, lua ? null
8−, useX11, rubyBindings, pythonBindings, luaBindings
9−}:
1+{ callPackage, ...} @ args:
102
11−assert useX11 -> (gtk2 != null && vte != null && gtkdialog != null);
12−assert rubyBindings -> ruby != null;
13−assert pythonBindings -> python != null;
14−
15−
16−let
17− inherit (stdenv.lib) optional;
3+callPackage ./generic.nix (args // {
184 #<generated>
195 # DO NOT EDIT! Automatically generated by ./update.py
20− version_commit = "19004";
21− gittap = "2.8.0";
22− gittip = "a76b965410aba07b4ef8b96d90b25b271c2003dd";
23− version = "2.8.0";
24− sha256 = "1d9rkzc3vychy2h1bnywwx4why83rr18r0lvvl1cqx87ad5awcjk";
25− cs_tip = "782ea67e17a391ca0d3faafdc365b335a1a8930a";
26− cs_sha256 = "1maww4ir78a193pm3f8lr2kdkizi7rywn68ffa65ipyr7j4pl6i4";
27− #</generated>
28−in
29−stdenv.mkDerivation rec {
30− name = "radare2-${version}";
31−
32− src = fetchFromGitHub {
33− owner = "radare";
34− repo = "radare2";
35− rev = version;
36− inherit sha256;
37− };
38−
39− postPatch = let
40− capstone = fetchFromGitHub {
41− owner = "aquynh";
42− repo = "capstone";
43− # version from $sourceRoot/shlr/Makefile
44− rev = cs_tip;
45− sha256 = cs_sha256;
46− };
47− in ''
48− if ! grep -F "CS_TIP=${cs_tip}" shlr/Makefile; then echo "CS_TIP mismatch"; exit 1; fi
49− # When using meson, it expects capstone source relative to build directory
50− mkdir -p build/shlr
51− ln -s ${capstone} build/shlr/capstone
52− '';
53−
54− postInstall = ''
55− ln -s $out/bin/radare2 $out/bin/r2
56− install -D -m755 $src/binr/r2pm/r2pm $out/bin/r2pm
57− '';
58−
59− mesonFlags = [
60− "-Dr2_version_commit=${version_commit}"
61− "-Dr2_gittap=${gittap}"
62− "-Dr2_gittip=${gittip}"
63− ];
64−
65− enableParallelBuilding = true;
66−
67− nativeBuildInputs = [ pkgconfig ninja meson ];
68− buildInputs = [ readline libusb libewf perl zlib openssl]
69− ++ optional useX11 [gtkdialog vte gtk2]
70− ++ optional rubyBindings [ruby]
71− ++ optional pythonBindings [python]
72− ++ optional luaBindings [lua];
73−
74− meta = {
75− description = "unix-like reverse engineering framework and commandline tools";
76− homepage = http://radare.org/;
77− license = stdenv.lib.licenses.gpl2Plus;
78− maintainers = with stdenv.lib.maintainers; [raskin makefu mic92];
79− platforms = with stdenv.lib.platforms; linux;
80− inherit version;
6+ src_info = {
7+ version_commit = "19004";
8+ gittap = "2.8.0";
9+ gittip = "a76b965410aba07b4ef8b96d90b25b271c2003dd";
10+ version = "2.8.0";
11+ sha256 = "1d9rkzc3vychy2h1bnywwx4why83rr18r0lvvl1cqx87ad5awcjk";
12+ cs_tip = "782ea67e17a391ca0d3faafdc365b335a1a8930a";
13+ cs_sha256 = "1maww4ir78a193pm3f8lr2kdkizi7rywn68ffa65ipyr7j4pl6i4";
8114 };
82−}
15+ #</generated>
16+})
pkgs/development/tools/analysis/radare2/generic.nixnew file+75
@@ -0,0 +1,75 @@
1+{stdenv, fetchFromGitHub
2+, src_info, callPackage
3+, ninja, meson , pkgconfig
4+, libusb, readline, libewf, perl, zlib, openssl
5+, gtk2 ? null, vte ? null, gtkdialog ? null
6+, python ? null
7+, ruby ? null
8+, lua ? null
9+, useX11, rubyBindings, pythonBindings, luaBindings
10+}:
11+
12+assert useX11 -> (gtk2 != null && vte != null && gtkdialog != null);
13+assert rubyBindings -> ruby != null;
14+assert pythonBindings -> python != null;
15+
16+
17+let
18+ inherit (stdenv.lib) optional;
19+in stdenv.mkDerivation (with src_info; rec {
20+ name = "radare2-${version}";
21+
22+ src = fetchFromGitHub {
23+ owner = "radare";
24+ repo = "radare2";
25+ rev = version;
26+ inherit sha256;
27+ };
28+
29+ postPatch = let
30+ capstone = fetchFromGitHub {
31+ owner = "aquynh";
32+ repo = "capstone";
33+ # version from $sourceRoot/shlr/Makefile
34+ rev = cs_tip;
35+ sha256 = cs_sha256;
36+ };
37+ in ''
38+ if ! grep -F "CS_TIP=${cs_tip}" shlr/Makefile; then echo "CS_TIP mismatch"; exit 1; fi
39+ # When using meson, it expects capstone source relative to build directory
40+ mkdir -p build/shlr
41+ ln -s ${capstone} build/shlr/capstone
42+ '';
43+
44+ postInstall = ''
45+ ln -s $out/bin/radare2 $out/bin/r2
46+ install -D -m755 $src/binr/r2pm/r2pm $out/bin/r2pm
47+ '';
48+
49+ mesonFlags = [
50+ "-Dr2_version_commit=${version_commit}"
51+ "-Dr2_gittap=${gittap}"
52+ "-Dr2_gittip=${gittip}"
53+ # 2.8.0 expects this, but later it becomes an option with default=false.
54+ "-Dcapstone_in_builddir=true"
55+ ];
56+
57+ enableParallelBuilding = true;
58+
59+ nativeBuildInputs = [ pkgconfig ninja meson ];
60+ buildInputs = [ readline libusb libewf perl zlib openssl]
61+ ++ optional useX11 [gtkdialog vte gtk2]
62+ ++ optional rubyBindings [ruby]
63+ ++ optional pythonBindings [python]
64+ ++ optional luaBindings [lua];
65+
66+ meta = {
67+ description = "unix-like reverse engineering framework and commandline tools";
68+ homepage = http://radare.org/;
69+ license = stdenv.lib.licenses.gpl2Plus;
70+ maintainers = with stdenv.lib.maintainers; [raskin makefu mic92];
71+ platforms = with stdenv.lib.platforms; linux;
72+ inherit version;
73+ };
74+})
75+
pkgs/development/tools/analysis/radare2/r2-for-cutter.nixnew file+16
@@ -0,0 +1,16 @@
1+{ callPackage, ...} @ args:
2+
3+callPackage ./generic.nix (args // {
4+ #<generated>
5+ # DO NOT EDIT! Automatically generated by ./update.py
6+ src_info = {
7+ version_commit = "19256";
8+ gittap = "2.8.0-118-gb0547831f";
9+ gittip = "b0547831f127b7357e3c93bc43933482a4d6213b";
10+ version = "2.9.0-git";
11+ sha256 = "1ix42kipd1aayb494ajbxawzc1cwikm9fxk343d1kchxx4a30a1m";
12+ cs_tip = "782ea67e17a391ca0d3faafdc365b335a1a8930a";
13+ cs_sha256 = "1maww4ir78a193pm3f8lr2kdkizi7rywn68ffa65ipyr7j4pl6i4";
14+ };
15+ #</generated>
16+})
pkgs/top-level/all-packages.nix+9−1
@@ -8540,7 +8540,15 @@ with pkgs;
85408540 rubyBindings = config.radare.rubyBindings or false;
85418541 luaBindings = config.radare.luaBindings or false;
85428542 };
8543− radare2-cutter = libsForQt5.callPackage ../development/tools/analysis/radare2-cutter { };
8543+ r2-for-cutter = callPackage ../development/tools/analysis/radare2/r2-for-cutter.nix {
8544+ inherit (gnome2) vte;
8545+ lua = lua5;
8546+ useX11 = config.radare.useX11 or false;
8547+ pythonBindings = config.radare.pythonBindings or false;
8548+ rubyBindings = config.radare.rubyBindings or false;
8549+ luaBindings = config.radare.luaBindings or false;
8550+ };
8551+ radare2-cutter = libsForQt5.callPackage ../development/tools/analysis/radare2/cutter.nix { };
85448552
85458553 ragel = ragelStable;
85468554