Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{
|
|
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;
|
|
};
|
|
}
|