ghidra: Add ghidra-analyzeHeadless to PATH

This new binary is an alias to the support/analyzeHeadless script, which
is used to run ghidra scripts in a headless manner. This
ghidra-analyzeHeadless name is also the one used by the ArchLinux
package.
This commit is contained in:
roblabla 2024-08-11 23:21:37 +02:00
parent de6fbfa299
commit be6aa219ed
3 changed files with 4 additions and 0 deletions

View File

@ -160,6 +160,7 @@ stdenv.mkDerivation (finalAttrs: {
postFixup = ''
mkdir -p "$out/bin"
ln -s "${pkg_path}/ghidraRun" "$out/bin/ghidra"
ln -s "${pkg_path}/support/analyzeHeadless" "$out/bin/ghidra-analyzeHeadless"
wrapProgram "${pkg_path}/support/launch.sh" \
--set-default NIX_GHIDRAHOME "${pkg_path}/Ghidra" \
--prefix PATH : ${lib.makeBinPath [ openjdk21 ]}

View File

@ -66,6 +66,7 @@ stdenv.mkDerivation rec {
postFixup = ''
mkdir -p "$out/bin"
ln -s "${pkg_path}/ghidraRun" "$out/bin/ghidra"
ln -s "${pkg_path}/support/analyzeHeadless" "$out/bin/ghidra-analyzeHeadless"
wrapProgram "${pkg_path}/support/launch.sh" \
--prefix PATH : ${lib.makeBinPath [ openjdk17 ]}

View File

@ -32,6 +32,8 @@ let
''
makeWrapper '${ghidra}/bin/ghidra' "$out/bin/ghidra" \
--set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra"
makeWrapper '${ghidra}/bin/ghidra-analyzeHeadless' "$out/bin/ghidra-analyzeHeadless" \
--set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra"
ln -s ${ghidra}/share $out/share
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''