2022-07-28 18:42:08 +02:00
|
|
|
{ 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=()
|
2022-07-29 01:08:52 +02:00
|
|
|
for plugin in $(find -L lib/rizin/plugins -type f -executable); do
|
2022-07-28 18:42:08 +02:00
|
|
|
wrapProgramArgs+=("--add-flags")
|
|
|
|
wrapProgramArgs+=("-l")
|
|
|
|
wrapProgramArgs+=("--add-flags")
|
|
|
|
wrapProgramArgs+=("$plugin")
|
|
|
|
done
|
|
|
|
wrapProgram $out/bin/rizin ''${wrapProgramArgs[*]}
|
|
|
|
'';
|
|
|
|
} // {
|
|
|
|
withPlugins = p: makeRizinPackageWithPlugins (plugins ++ (p rizinPlugins));
|
|
|
|
};
|
|
|
|
in makeRizinPackageWithPlugins []
|