ghidra: Prevent lock file creation in with-extensions directory

This file already exists in `lib/ghidra/Ghidra` in the default Ghidra
derivation, but due to various path resolving steps the file also needs
to be created in the with-extensions symlink join as well as the
individual extension directories.
This commit is contained in:
Tim Schumacher
2025-06-25 20:13:31 +02:00
parent 787008d5de
commit 185451d742
2 changed files with 8 additions and 0 deletions
@@ -58,6 +58,11 @@ let
mkdir -p $out/lib/ghidra/Ghidra/Extensions
unzip -d $out/lib/ghidra/Ghidra/Extensions dist/*.zip
# Prevent attempted creation of plugin lock files in the Nix store.
for i in $out/lib/ghidra/Ghidra/Extensions/*; do
touch "$i/.dbDirLock"
done
runHook postInstall
'';
@@ -30,6 +30,9 @@ let
] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
postBuild =
''
# Prevent attempted creation of plugin lock files in the Nix store.
touch $out/lib/ghidra/Ghidra/.dbDirLock
makeWrapper '${ghidra}/bin/ghidra' "$out/bin/ghidra" \
--set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra"
makeWrapper '${ghidra}/bin/ghidra-analyzeHeadless' "$out/bin/ghidra-analyzeHeadless" \