@@ -1,4 +1,4 @@
1−{ stdenv, fetchFromGitHub
1+{ fetchFromGitHub, lib, mkDerivation
22# nativeBuildInputs
33, qmake, pkgconfig
44# Qt
@@ -8,7 +8,7 @@
88, python3
99, wrapQtAppsHook }:
1010
11−stdenv.mkDerivation rec {
11+mkDerivation rec {
1212 pname = "radare2-cutter";
1313 version = "1.12.0";
1414
@@ -30,21 +30,31 @@ stdenv.mkDerivation rec {
3030 --replace "include(lib_radare2.pri)" ""
3131 '';
3232
33− nativeBuildInputs = [ qmake pkgconfig ];
34− buildInputs = [ qtbase qtsvg qtwebengine r2-for-cutter python3 wrapQtAppsHook ];
33+ nativeBuildInputs = [ qmake pkgconfig python3 wrapQtAppsHook ];
34+ propagatedBuildInputs = [ python3.pkgs.pyside2 ];
35+ buildInputs = [ qtbase qtsvg qtwebengine r2-for-cutter python3 ];
3536
36− qmakeFlags = [
37+ qmakeFlags = with python3.pkgs; [
3738 "CONFIG+=link_pkgconfig"
3839 "PKGCONFIG+=r_core"
3940 # Leaving this enabled doesn't break build but generates errors
4041 # at runtime (to console) about being unable to load needed bits.
4142 # Disable until can be looked at.
4243 "CUTTER_ENABLE_JUPYTER=false"
44+ # Enable support for Python plugins
45+ "CUTTER_ENABLE_PYTHON=true"
46+ "CUTTER_ENABLE_PYTHON_BINDINGS=true"
47+ "SHIBOKEN_EXTRA_OPTIONS+=-I${r2-for-cutter}/include/libr"
4348 ];
4449
50+ preBuild = ''
51+ export NIX_LDFLAGS="$NIX_LDFLAGS $(pkg-config --libs python3-embed)"
52+ qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
53+ '';
54+
4555 enableParallelBuilding = true;
4656
47− meta = with stdenv.lib; {
57+ meta = with lib; {
4858 description = "A Qt and C++ GUI for radare2 reverse engineering framework";
4959 homepage = src.meta.homepage;
5060 license = licenses.gpl3;