2020-11-21 19:51:51 +00:00
|
|
|
{ fetchFromGitHub, lib, mkDerivation
|
2020-04-24 23:36:52 +00:00
|
|
|
# nativeBuildInputs
|
2021-02-05 17:12:51 +00:00
|
|
|
, qmake, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
# Qt
|
|
|
|
, qtbase, qtsvg, qtwebengine
|
|
|
|
# buildInputs
|
|
|
|
, r2-for-cutter
|
|
|
|
, python3
|
|
|
|
, wrapQtAppsHook }:
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "radare2-cutter";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "1.12.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "radareorg";
|
|
|
|
repo = "cutter";
|
|
|
|
rev = "v${version}";
|
2020-10-07 09:15:18 +00:00
|
|
|
sha256 = "0ljj3j3apbbw628n2nyrxpbnclixx20bqjxm0xwggqzz9vywsar0";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postUnpack = "export sourceRoot=$sourceRoot/src";
|
|
|
|
|
|
|
|
# Remove this "very helpful" helper file intended for discovering r2,
|
|
|
|
# as it's a doozy of harddcoded paths and unexpected behavior.
|
|
|
|
# Happily Nix has everything all set so we don't need it,
|
|
|
|
# other than as basis for the qmakeFlags set below.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Cutter.pro \
|
|
|
|
--replace "include(lib_radare2.pri)" ""
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ qmake pkg-config python3 wrapQtAppsHook ];
|
2020-11-21 19:51:51 +00:00
|
|
|
propagatedBuildInputs = [ python3.pkgs.pyside2 ];
|
|
|
|
buildInputs = [ qtbase qtsvg qtwebengine r2-for-cutter python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
qmakeFlags = with python3.pkgs; [
|
2021-02-05 17:12:51 +00:00
|
|
|
"CONFIG+=link_pkg-config"
|
2020-04-24 23:36:52 +00:00
|
|
|
"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"
|
2020-11-21 19:51:51 +00:00
|
|
|
# Enable support for Python plugins
|
|
|
|
"CUTTER_ENABLE_PYTHON=true"
|
|
|
|
"CUTTER_ENABLE_PYTHON_BINDINGS=true"
|
|
|
|
"SHIBOKEN_EXTRA_OPTIONS+=-I${r2-for-cutter}/include/libr"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
preBuild = ''
|
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS $(pkg-config --libs python3-embed)"
|
|
|
|
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Qt and C++ GUI for radare2 reverse engineering framework";
|
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ mic92 dtzWill ];
|
|
|
|
};
|
|
|
|
}
|