Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghidra: 11.1.1 -> 11.1.2, upgrade to gradle 8, openjdk 21 #326303

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pkgs/tools/security/ghidra/0001-Use-protobuf-gradle-plugin.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] Use com.google.protobuf:protobuf-gradle-plugin
Ghidra/Debug/Debugger-isf/build.gradle | 8 +-
Ghidra/Debug/Debugger-rmi-trace/build.gradle | 14 +--
build.gradle | 6 ++
gradle/debugger/hasProtobuf.gradle | 94 --------------------
gradle/hasProtobuf.gradle | 94 --------------------
5 files changed, 26 insertions(+), 103 deletions(-)

diff --git a/Ghidra/Debug/Debugger-gadp/build.gradle b/Ghidra/Debug/Debugger-gadp/build.gradle
Expand All @@ -19,7 +19,7 @@ index 9e1c57faf..3a3242eb5 100644
apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle"
apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
-apply from: "${rootProject.projectDir}/gradle/debugger/hasProtobuf.gradle"
-apply from: "${rootProject.projectDir}/gradle/hasProtobuf.gradle"
+apply plugin: 'com.google.protobuf'

apply plugin: 'eclipse'
Expand All @@ -41,7 +41,7 @@ index d135294a0..785681ca2 100644
apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle"
apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
-apply from: "${rootProject.projectDir}/gradle/debugger/hasProtobuf.gradle"
-apply from: "${rootProject.projectDir}/gradle/hasProtobuf.gradle"
-
+apply plugin: 'com.google.protobuf'
apply plugin: 'eclipse'
Expand All @@ -63,9 +63,9 @@ index 40fbc17ab..7517ffe6e 100644
apply from: "${rootProject.projectDir}/gradle/jacocoProject.gradle"
apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
-apply from: "${rootProject.projectDir}/gradle/debugger/hasProtobuf.gradle"
-apply from: "${rootProject.projectDir}/gradle/hasProtobuf.gradle"
+apply plugin: 'com.google.protobuf'
apply from: "${rootProject.projectDir}/gradle/debugger/hasPythonPackage.gradle"
apply from: "${rootProject.projectDir}/gradle/hasPythonPackage.gradle"

apply plugin: 'eclipse'
eclipse.project.name = 'Debug Debugger-rmi-trace'
Expand Down Expand Up @@ -110,10 +110,10 @@ index b0c717fb1..5f56506a5 100644
}
}
else {
diff --git a/gradle/debugger/hasProtobuf.gradle b/gradle/debugger/hasProtobuf.gradle
diff --git a/gradle/hasProtobuf.gradle b/gradle/hasProtobuf.gradle
index 23b4ce74b..e69de29bb 100644
--- a/gradle/debugger/hasProtobuf.gradle
+++ b/gradle/debugger/hasProtobuf.gradle
--- a/gradle/hasProtobuf.gradle
+++ b/gradle/hasProtobuf.gradle
@@ -1,94 +0,0 @@
-/* ###
- * IP: GHIDRA
Expand Down
14 changes: 6 additions & 8 deletions pkgs/tools/security/ghidra/build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
fetchFromGitHub,
lib,
callPackage,
gradle_7,
gradle,
makeBinaryWrapper,
openjdk17,
openjdk21,
unzip,
makeDesktopItem,
copyDesktopItems,
Expand All @@ -20,15 +20,15 @@
let
pkg_path = "$out/lib/ghidra";
pname = "ghidra";
version = "11.1.1";
version = "11.1.2";

releaseName = "NIX";
distroPrefix = "ghidra_${version}_${releaseName}";
src = fetchFromGitHub {
owner = "NationalSecurityAgency";
repo = "Ghidra";
rev = "Ghidra_${version}_build";
hash = "sha256-t96FcAK3JwO66dOf4OhpOfU8CQfAczfF61Cg7m+B3fA=";
hash = "sha256-FL1nLaq8A9PI+RzqZg5+O+4+ZsH16MG3cf7OIKimDqw=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
Expand All @@ -43,8 +43,6 @@ let
'';
};

gradle = gradle_7;

patches = [
# Use our own protoc binary instead of the prebuilt one
./0001-Use-protobuf-gradle-plugin.patch
Expand Down Expand Up @@ -128,7 +126,7 @@ stdenv.mkDerivation (finalAttrs: {
data = ./deps.json;
};

gradleFlags = [ "-Dorg.gradle.java.home=${openjdk17}" ];
gradleFlags = [ "-Dorg.gradle.java.home=${openjdk21}" ];

preBuild = ''
export JAVA_TOOL_OPTIONS="-Duser.home=$NIX_BUILD_TOP/home"
Expand Down Expand Up @@ -164,7 +162,7 @@ stdenv.mkDerivation (finalAttrs: {
ln -s "${pkg_path}/ghidraRun" "$out/bin/ghidra"
wrapProgram "${pkg_path}/support/launch.sh" \
--set-default NIX_GHIDRAHOME "${pkg_path}/Ghidra" \
--prefix PATH : ${lib.makeBinPath [ openjdk17 ]}
--prefix PATH : ${lib.makeBinPath [ openjdk21 ]}
'';

passthru = {
Expand Down
22 changes: 11 additions & 11 deletions pkgs/tools/security/ghidra/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.