fix extension build
This commit is contained in:
parent
26d03f13e2
commit
9d42d525a8
|
@ -21,16 +21,17 @@ let
|
||||||
platforms = oldMeta.platforms or ghidra.meta.platforms;
|
platforms = oldMeta.platforms or ghidra.meta.platforms;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildGhidraExtension =
|
buildGhidraExtension = lib.extendMkDerivation {
|
||||||
|
constructDrv = stdenv.mkDerivation;
|
||||||
|
extendDrvArgs =
|
||||||
|
finalAttrs:
|
||||||
{
|
{
|
||||||
pname,
|
pname,
|
||||||
nativeBuildInputs ? [ ],
|
nativeBuildInputs ? [ ],
|
||||||
meta ? { },
|
meta ? { },
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
stdenv.mkDerivation (
|
{
|
||||||
args
|
|
||||||
// {
|
|
||||||
nativeBuildInputs = nativeBuildInputs ++ [
|
nativeBuildInputs = nativeBuildInputs ++ [
|
||||||
unzip
|
unzip
|
||||||
jdk
|
jdk
|
||||||
|
@ -58,22 +59,28 @@ let
|
||||||
mkdir -p $out/lib/ghidra/Ghidra/Extensions
|
mkdir -p $out/lib/ghidra/Ghidra/Extensions
|
||||||
unzip -d $out/lib/ghidra/Ghidra/Extensions dist/*.zip
|
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
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = metaCommon meta;
|
meta = metaCommon meta;
|
||||||
}
|
};
|
||||||
);
|
};
|
||||||
|
|
||||||
buildGhidraScripts =
|
buildGhidraScripts = lib.extendMkDerivation {
|
||||||
|
constructDrv = stdenv.mkDerivation;
|
||||||
|
extendDrvArgs =
|
||||||
|
finalAttrs:
|
||||||
{
|
{
|
||||||
pname,
|
pname,
|
||||||
meta ? { },
|
meta ? { },
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
stdenv.mkDerivation (
|
{
|
||||||
args
|
|
||||||
// {
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
|
@ -95,8 +102,8 @@ let
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = metaCommon meta;
|
meta = metaCommon meta;
|
||||||
}
|
};
|
||||||
);
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit buildGhidraExtension buildGhidraScripts;
|
inherit buildGhidraExtension buildGhidraScripts;
|
||||||
|
|
|
@ -29,8 +29,10 @@ let
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
makeBinaryWrapper
|
makeBinaryWrapper
|
||||||
] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
|
] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
|
||||||
postBuild =
|
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" \
|
makeWrapper '${ghidra}/bin/ghidra' "$out/bin/ghidra" \
|
||||||
--set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra"
|
--set NIX_GHIDRAHOME "$out/lib/ghidra/Ghidra"
|
||||||
makeWrapper '${ghidra}/bin/ghidra-analyzeHeadless' "$out/bin/ghidra-analyzeHeadless" \
|
makeWrapper '${ghidra}/bin/ghidra-analyzeHeadless' "$out/bin/ghidra-analyzeHeadless" \
|
||||||
|
|
Loading…
Reference in New Issue