ghidra: Use finalAttrs for extensions where sensible

This commit is contained in:
Tim Schumacher 2025-06-21 12:52:07 +02:00
parent acee522557
commit 84983852e7
6 changed files with 53 additions and 63 deletions

View File

@ -3,26 +3,23 @@
fetchFromGitHub,
buildGhidraExtension,
}:
let
version = "3.0.6";
in
buildGhidraExtension {
buildGhidraExtension (finalAttrs: {
pname = "findcrypt";
inherit version;
version = "3.0.6";
src = fetchFromGitHub {
owner = "antoniovazquezblanco";
repo = "GhidraFindcrypt";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-VWi1MP72Vl4XCrbTvRA6qYPk2QyvRyVb9N8QQ/Zml0A=";
};
meta = {
description = "Ghidra analysis plugin to locate cryptographic constants";
homepage = "https://github.com/antoniovazquezblanco/GhidraFindcrypt";
downloadPage = "https://github.com/antoniovazquezblanco/GhidraFindcrypt/releases/tag/v${version}";
changelog = "https://github.com/antoniovazquezblanco/GhidraFindcrypt/releases/tag/v${version}";
downloadPage = "https://github.com/antoniovazquezblanco/GhidraFindcrypt/releases/tag/v${finalAttrs.version}";
changelog = "https://github.com/antoniovazquezblanco/GhidraFindcrypt/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3;
maintainers = [ lib.maintainers.BonusPlay ];
};
}
})

View File

@ -4,40 +4,36 @@
gradle,
fetchFromGitHub,
}:
let
ghidra.buildGhidraExtension (finalAttrs: {
pname = "ghidra-delinker-extension";
version = "0.5.1";
self = ghidra.buildGhidraExtension {
pname = "ghidra-delinker-extension";
inherit version;
src = fetchFromGitHub {
owner = "boricj";
repo = "ghidra-delinker-extension";
rev = "v${version}";
hash = "sha256-h6F50Z7S6tPOl9mIhChLKoFxHuAkq/n36ysUEFwWGxI=";
};
postPatch = ''
substituteInPlace build.gradle \
--replace-fail '"''${getGitHash()}"' '"v${version}"'
'';
gradleBuildTask = "buildExtension";
__darwinAllowLocalNetworking = true;
mitmCache = gradle.fetchDeps {
pkg = self;
data = ./deps.json;
};
meta = {
description = "Ghidra extension for delinking executables back to object files";
homepage = "https://github.com/boricj/ghidra-delinker-extension";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.jchw ];
platforms = lib.platforms.unix;
};
src = fetchFromGitHub {
owner = "boricj";
repo = "ghidra-delinker-extension";
rev = "v${finalAttrs.version}";
hash = "sha256-h6F50Z7S6tPOl9mIhChLKoFxHuAkq/n36ysUEFwWGxI=";
};
in
self
postPatch = ''
substituteInPlace build.gradle \
--replace-fail '"''${getGitHash()}"' '"v${finalAttrs.version}"'
'';
gradleBuildTask = "buildExtension";
__darwinAllowLocalNetworking = true;
mitmCache = gradle.fetchDeps {
pkg = finalAttrs.finalPackage;
data = ./deps.json;
};
meta = {
description = "Ghidra extension for delinking executables back to object files";
homepage = "https://github.com/boricj/ghidra-delinker-extension";
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.jchw ];
platforms = lib.platforms.unix;
};
})

View File

@ -3,22 +3,22 @@
fetchFromGitHub,
buildGhidraExtension,
}:
buildGhidraExtension rec {
buildGhidraExtension (finalAttrs: {
pname = "Ghidra-GolangAnalyzerExtension";
version = "1.2.4";
src = fetchFromGitHub {
owner = "mooncat-greenpy";
repo = "Ghidra_GolangAnalyzerExtension";
rev = version;
rev = finalAttrs.version;
hash = "sha256-uxozIJ+BLcP1vBnLOCZD9ueY10hd37fON/Miii3zabo=";
};
meta = {
description = "Facilitates the analysis of Golang binaries using Ghidra";
homepage = "https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension";
downloadPage = "https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension/releases/tag/${version}";
downloadPage = "https://github.com/mooncat-greenpy/Ghidra_GolangAnalyzerExtension/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.ivyfanchiang ];
};
}
})

View File

@ -24,14 +24,14 @@ let
}
);
self = buildGhidraExtension rec {
self = buildGhidraExtension (finalAttrs: {
pname = "kaiju";
version = "250610";
src = fetchFromGitHub {
owner = "CERTCC";
repo = "kaiju";
rev = version;
rev = finalAttrs.version;
hash = "sha256-qqUnWakQDOBw3sI/6iWD9140iRAsM5PUEQJSV/3/8FQ=";
};
@ -58,7 +58,7 @@ let
meta = {
description = "A Java implementation of some features of the CERT Pharos Binary Analysis Framework for Ghidra";
homepage = "https://github.com/CERTCC/kaiju";
downloadPage = "https://github.com/CERTCC/kaiju/releases/tag/${version}";
downloadPage = "https://github.com/CERTCC/kaiju/releases/tag/${finalAttrs.version}";
license = lib.licenses.bsd3;
maintainers = [ lib.maintainers.ivyfanchiang ];
platforms = [
@ -68,6 +68,6 @@ let
"aarch64-darwin"
];
};
};
});
in
self

View File

@ -3,14 +3,14 @@
fetchFromGitHub,
buildGhidraExtension,
}:
buildGhidraExtension rec {
buildGhidraExtension (finalAttrs: {
pname = "lightkeeper";
version = "1.2.4";
src = fetchFromGitHub {
owner = "WorksButNotTested";
repo = "lightkeeper";
rev = version;
rev = finalAttrs.version;
hash = "sha256-aGMWg6VQleKH/txlxpSw19QOotWZSqeW5Ve2SpWGhgA=";
};
preConfigure = ''
@ -21,4 +21,4 @@ buildGhidraExtension rec {
homepage = "https://github.com/WorksButNotTested/lightkeeper";
license = lib.licenses.asl20;
};
}
})

View File

@ -5,17 +5,14 @@
ghidra,
ant,
}:
let
version = "2.3.1";
in
buildGhidraExtension {
buildGhidraExtension (finalAttrs: {
pname = "wasm";
inherit version;
version = "2.3.1";
src = fetchFromGitHub {
owner = "nneonneo";
repo = "ghidra-wasm-plugin";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-aoSMNzv+TgydiXM4CbvAyu/YsxmdZPvpkZkYEE3C+V4=";
};
@ -35,9 +32,9 @@ buildGhidraExtension {
meta = {
description = "Ghidra Wasm plugin with disassembly and decompilation support";
homepage = "https://github.com/nneonneo/ghidra-wasm-plugin";
downloadPage = "https://github.com/nneonneo/ghidra-wasm-plugin/releases/tag/v${version}";
changelog = "https://github.com/nneonneo/ghidra-wasm-plugin/releases/tag/v${version}";
downloadPage = "https://github.com/nneonneo/ghidra-wasm-plugin/releases/tag/v${finalAttrs.version}";
changelog = "https://github.com/nneonneo/ghidra-wasm-plugin/releases/tag/v${finalAttrs.version}";
license = lib.licenses.gpl3;
maintainers = [ lib.maintainers.BonusPlay ];
};
}
})