2023-11-21 05:26:15 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
2023-08-09 10:04:52 +00:00
|
|
|
# for passthru.plugins
|
|
|
|
, pkgs
|
2021-03-30 10:10:56 +00:00
|
|
|
# nativeBuildInputs
|
2023-11-21 05:26:15 +00:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, wrapQtAppsHook
|
2021-03-30 10:10:56 +00:00
|
|
|
# Qt
|
2023-11-21 05:26:15 +00:00
|
|
|
, qt5compat
|
|
|
|
, qtbase
|
2023-12-08 22:40:01 +00:00
|
|
|
, qtwayland
|
2023-11-21 05:26:15 +00:00
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtwebengine
|
2021-03-30 10:10:56 +00:00
|
|
|
# buildInputs
|
2023-08-05 14:18:43 +00:00
|
|
|
, graphviz
|
2021-03-30 10:10:56 +00:00
|
|
|
, python3
|
2023-11-21 05:26:15 +00:00
|
|
|
, rizin
|
2021-03-30 10:10:56 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-21 05:26:15 +00:00
|
|
|
let cutter = stdenv.mkDerivation rec {
|
2021-03-30 10:10:56 +00:00
|
|
|
pname = "cutter";
|
2024-03-04 14:29:36 +00:00
|
|
|
version = "2.3.4";
|
2021-03-30 10:10:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rizinorg";
|
|
|
|
repo = "cutter";
|
|
|
|
rev = "v${version}";
|
2024-03-04 14:29:36 +00:00
|
|
|
hash = "sha256-TSEi1mXVvvaGo4koo3EnN/veXPUHF747g+gifnl4IDQ=";
|
2021-03-30 10:10:56 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-11-21 05:26:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
python3.pkgs.pyside6
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
graphviz
|
|
|
|
python3
|
|
|
|
qt5compat
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
|
|
|
qttools
|
|
|
|
qtwebengine
|
|
|
|
rizin
|
2023-12-08 22:40:01 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
qtwayland
|
2023-11-21 05:26:15 +00:00
|
|
|
];
|
2021-03-30 10:10:56 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCUTTER_USE_BUNDLED_RIZIN=OFF"
|
|
|
|
"-DCUTTER_ENABLE_PYTHON=ON"
|
|
|
|
"-DCUTTER_ENABLE_PYTHON_BINDINGS=ON"
|
2023-08-05 14:18:43 +00:00
|
|
|
"-DCUTTER_ENABLE_GRAPHVIZ=ON"
|
2023-11-21 05:26:15 +00:00
|
|
|
"-DCUTTER_QT6=ON"
|
2021-03-30 10:10:56 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
|
|
|
|
'';
|
|
|
|
|
2023-08-09 10:04:52 +00:00
|
|
|
passthru = rec {
|
2023-08-09 10:16:59 +00:00
|
|
|
plugins = rizin.plugins // {
|
|
|
|
rz-ghidra = rizin.plugins.rz-ghidra.override {
|
|
|
|
inherit cutter qtbase qtsvg;
|
|
|
|
enableCutterPlugin = true;
|
|
|
|
};
|
|
|
|
};
|
2023-08-09 10:04:52 +00:00
|
|
|
withPlugins = filter: pkgs.callPackage ./wrapper.nix {
|
2023-08-13 14:22:44 +00:00
|
|
|
inherit rizin cutter;
|
|
|
|
isCutter = true;
|
2023-08-09 10:04:52 +00:00
|
|
|
plugins = filter plugins;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-03-30 10:10:56 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Free and Open Source Reverse Engineering Platform powered by rizin";
|
|
|
|
homepage = src.meta.homepage;
|
|
|
|
license = licenses.gpl3;
|
2023-08-13 16:54:57 +00:00
|
|
|
mainProgram = "cutter";
|
2021-03-30 10:10:56 +00:00
|
|
|
maintainers = with maintainers; [ mic92 dtzWill ];
|
2023-11-21 05:26:15 +00:00
|
|
|
inherit (rizin.meta) platforms;
|
2021-03-30 10:10:56 +00:00
|
|
|
};
|
2023-08-09 10:04:52 +00:00
|
|
|
}; in cutter
|