mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-06-05 21:03:40 +00:00
cutter, rizin: migrate to by-name
This commit is contained in:
committed by
Weijia Wang
parent
c883fe538e
commit
ca4d3165a5
@@ -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;
|
||||
};
|
||||
};
|
||||
@@ -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;
|
||||
};
|
||||
@@ -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;
|
||||
43
pkgs/by-name/ri/rizin/wrapper.nix
Normal file
43
pkgs/by-name/ri/rizin/wrapper.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user