cutter, rizin: migrate to by-name

This commit is contained in:
Guy Chronister
2026-05-09 09:13:51 -05:00
committed by Weijia Wang
parent c883fe538e
commit ca4d3165a5
9 changed files with 57 additions and 26 deletions

View File

@@ -8,14 +8,8 @@
# nativeBuildInputs
cmake,
pkg-config,
wrapQtAppsHook,
# Qt
qt5compat,
qtbase,
qtwayland,
qtsvg,
qttools,
qtwebengine,
qt6,
# buildInputs
graphviz,
python3,
@@ -47,7 +41,7 @@ let
cmake
pkg-config
python3
wrapQtAppsHook
qt6.wrapQtAppsHook
];
propagatedBuildInputs = [
@@ -57,15 +51,15 @@ let
buildInputs = [
graphviz
python3
qt5compat
qtbase
qtsvg
qttools
qtwebengine
qt6.qt5compat
qt6.qtbase
qt6.qtsvg
qt6.qttools
qt6.qtwebengine
rizin
]
++ lib.optionals stdenv.hostPlatform.isLinux [
qtwayland
qt6.qtwayland
];
cmakeFlags = [
@@ -83,7 +77,7 @@ let
passthru = rec {
plugins = rizin.plugins // {
rz-ghidra = rizin.plugins.rz-ghidra.override {
inherit cutter qtbase qtsvg;
inherit cutter qt6;
enableCutterPlugin = true;
};
};

View File

@@ -129,7 +129,7 @@ let
jsdec = pkgs.callPackage ./jsdec.nix {
inherit rizin openssl;
};
rz-ghidra = pkgs.qt6.callPackage ./rz-ghidra.nix {
rz-ghidra = pkgs.callPackage ./rz-ghidra.nix {
inherit rizin openssl;
enableCutterPlugin = false;
};

View File

@@ -10,9 +10,7 @@
# optional buildInputs
enableCutterPlugin ? true,
cutter,
qt5compat,
qtbase,
qtsvg,
qt6,
}:
stdenv.mkDerivation (finalAttrs: {
@@ -35,9 +33,9 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optionals enableCutterPlugin [
cutter
qt5compat
qtbase
qtsvg
qt6.qt5compat
qt6.qtbase
qt6.qtsvg
];
dontWrapQtApps = true;

View File

@@ -0,0 +1,43 @@
{
lib,
makeWrapper,
symlinkJoin,
plugins,
rizin,
isCutter ? false,
cutter,
}:
let
unwrapped = if isCutter then cutter else rizin;
in
symlinkJoin {
name = "${unwrapped.pname}-with-plugins-${unwrapped.version}";
# NIX_RZ_PREFIX only changes where *Rizin* locates files (plugins,
# themes, etc). But we must change it even for wrapping Cutter, because
# Cutter plugins often have associated Rizin plugins. This means that
# $out (which NIX_RZ_PREFIX will be set to) must always contain Rizin
# files, even if we only wrap Cutter - so for Cutter, include Rizin to
# symlinkJoin paths.
paths = [ unwrapped ] ++ lib.optional isCutter rizin ++ plugins;
nativeBuildInputs = [ makeWrapper ];
passthru = {
inherit unwrapped;
};
postBuild = ''
rm $out/bin/*
wrapperArgs=(--set NIX_RZ_PREFIX $out${lib.optionalString isCutter " --prefix XDG_DATA_DIRS : $out/share"})
for binary in $(ls ${unwrapped}/bin); do
makeWrapper ${unwrapped}/bin/$binary $out/bin/$binary "''${wrapperArgs[@]}"
done
'';
meta = unwrapped.meta // {
# prefer wrapped over unwrapped
priority = (unwrapped.meta.priority or lib.meta.defaultPriority) - 1;
};
}

View File

@@ -5756,12 +5756,8 @@ with pkgs;
// (config.radare or { })
);
rizin = pkgs.callPackage ../development/tools/analysis/rizin { };
rizinPlugins = recurseIntoAttrs rizin.plugins;
cutter = qt6.callPackage ../development/tools/analysis/rizin/cutter.nix { };
cutterPlugins = recurseIntoAttrs cutter.plugins;
ragel = ragelStable;