From 056a35ad9796417bf82de7e4eac4094617440478 Mon Sep 17 00:00:00 2001 From: Pamplemousse Date: Tue, 20 Oct 2020 08:58:17 -0700 Subject: [PATCH 1/2] radare2-cutter: Use Qt 5.15 Signed-off-by: Pamplemousse --- pkgs/development/tools/analysis/radare2/cutter.nix | 6 +++--- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/analysis/radare2/cutter.nix b/pkgs/development/tools/analysis/radare2/cutter.nix index 1cef52a3444..d4c554f8ff6 100644 --- a/pkgs/development/tools/analysis/radare2/cutter.nix +++ b/pkgs/development/tools/analysis/radare2/cutter.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub +{ fetchFromGitHub, lib, mkDerivation # nativeBuildInputs , qmake, pkgconfig # Qt @@ -8,7 +8,7 @@ , python3 , wrapQtAppsHook }: -stdenv.mkDerivation rec { +mkDerivation rec { pname = "radare2-cutter"; version = "1.12.0"; @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - meta = with stdenv.lib; { + meta = with lib; { description = "A Qt and C++ GUI for radare2 reverse engineering framework"; homepage = src.meta.homepage; license = licenses.gpl3; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b29cd7a0d5d..047b4a3981f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11735,7 +11735,7 @@ julia_15 = callPackage ../development/compilers/julia/1.5.nix { lua = lua5; } // (config.radare or {}))) radare2 r2-for-cutter; - radare2-cutter = libsForQt514.callPackage ../development/tools/analysis/radare2/cutter.nix { }; + radare2-cutter = libsForQt515.callPackage ../development/tools/analysis/radare2/cutter.nix { }; ragel = ragelStable; From f9716740ce434d758e2c2a717ff7464670bed87d Mon Sep 17 00:00:00 2001 From: Pamplemousse Date: Fri, 23 Oct 2020 16:13:29 -0700 Subject: [PATCH 2/2] radare2-cutter: Support Python plugins Signed-off-by: Pamplemousse --- .../tools/analysis/radare2/cutter.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/analysis/radare2/cutter.nix b/pkgs/development/tools/analysis/radare2/cutter.nix index d4c554f8ff6..d4a102ac097 100644 --- a/pkgs/development/tools/analysis/radare2/cutter.nix +++ b/pkgs/development/tools/analysis/radare2/cutter.nix @@ -30,18 +30,28 @@ mkDerivation rec { --replace "include(lib_radare2.pri)" "" ''; - nativeBuildInputs = [ qmake pkgconfig ]; - buildInputs = [ qtbase qtsvg qtwebengine r2-for-cutter python3 wrapQtAppsHook ]; + nativeBuildInputs = [ qmake pkgconfig python3 wrapQtAppsHook ]; + propagatedBuildInputs = [ python3.pkgs.pyside2 ]; + buildInputs = [ qtbase qtsvg qtwebengine r2-for-cutter python3 ]; - qmakeFlags = [ + qmakeFlags = with python3.pkgs; [ "CONFIG+=link_pkgconfig" "PKGCONFIG+=r_core" # Leaving this enabled doesn't break build but generates errors # at runtime (to console) about being unable to load needed bits. # Disable until can be looked at. "CUTTER_ENABLE_JUPYTER=false" + # Enable support for Python plugins + "CUTTER_ENABLE_PYTHON=true" + "CUTTER_ENABLE_PYTHON_BINDINGS=true" + "SHIBOKEN_EXTRA_OPTIONS+=-I${r2-for-cutter}/include/libr" ]; + preBuild = '' + export NIX_LDFLAGS="$NIX_LDFLAGS $(pkg-config --libs python3-embed)" + qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH") + ''; + enableParallelBuilding = true; meta = with lib; {