27 lines
817 B
Nix
27 lines
817 B
Nix
{ rizin-unwrapped, rizinPlugins, makeWrapper, symlinkJoin }:
|
|
let
|
|
makeRizinPackageWithPlugins = plugins:
|
|
let
|
|
plugins_path = symlinkJoin {
|
|
name = "rizin-plugins";
|
|
paths = plugins;
|
|
};
|
|
in
|
|
symlinkJoin {
|
|
name = "rizin";
|
|
paths = [ rizin-unwrapped ];
|
|
buildInputs = [makeWrapper];
|
|
postBuild = ''
|
|
wrapProgramArgs=()
|
|
for plugin in ${plugins_path}/lib/rizin/plugins/*; do
|
|
wrapProgramArgs+=("--add-flags")
|
|
wrapProgramArgs+=("-l")
|
|
wrapProgramArgs+=("--add-flags")
|
|
wrapProgramArgs+=("$plugin")
|
|
done
|
|
wrapProgram $out/bin/rizin ''${wrapProgramArgs[*]}
|
|
'';
|
|
} // {
|
|
withPlugins = p: makeRizinPackageWithPlugins (plugins ++ (p rizinPlugins));
|
|
};
|
|
in makeRizinPackageWithPlugins []
|