Merge pull request #232882 from erdnaxe/ghidra-update

ghidra,ghidra-bin: update to 10.3
This commit is contained in:
Ryan Lahfa 2023-05-21 21:52:09 +02:00 committed by GitHub
commit 9356eead97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 134 additions and 54 deletions

View File

@ -1,79 +1,60 @@
From 913e74b8682f77da94ed7b7d459482b9b23a5d88 Mon Sep 17 00:00:00 2001
From: roblabla <unfiltered@roblab.la>
Date: Tue, 28 Dec 2021 14:20:30 +0100
Subject: [PATCH] Use protobuf gradle plugin
---
Ghidra/Debug/Debugger-gadp/build.gradle | 76 +++----------------------
build.gradle | 6 ++
2 files changed, 15 insertions(+), 67 deletions(-)
diff --git a/Ghidra/Debug/Debugger-gadp/build.gradle b/Ghidra/Debug/Debugger-gadp/build.gradle diff --git a/Ghidra/Debug/Debugger-gadp/build.gradle b/Ghidra/Debug/Debugger-gadp/build.gradle
index 1b4922f66..3d2ef8856 100644 index f4dbd3cd0..6108e8534 100644
--- a/Ghidra/Debug/Debugger-gadp/build.gradle --- a/Ghidra/Debug/Debugger-gadp/build.gradle
+++ b/Ghidra/Debug/Debugger-gadp/build.gradle +++ b/Ghidra/Debug/Debugger-gadp/build.gradle
@@ -23,42 +23,19 @@ apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle" @@ -23,42 +23,18 @@ apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle" apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
apply plugin: 'eclipse' apply plugin: 'eclipse'
-eclipse.project.name = 'Debug Debugger-gadp'
+apply plugin: 'com.google.protobuf' +apply plugin: 'com.google.protobuf'
eclipse.project.name = 'Debug Debugger-gadp'
-configurations { -configurations {
- allProtocArtifacts - allProtocArtifacts
- protocArtifact - protocArtifact
-} -}
+eclipse.project.name = 'Debug Debugger-gadp' -
def platform = getCurrentPlatformName() def platform = getCurrentPlatformName()
-dependencies { -dependencies {
- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:windows-x86_64@exe' - allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:windows-x86_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:linux-x86_64@exe' - allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:linux-x86_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:linux-aarch_64@exe' - allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:linux-aarch_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:osx-x86_64@exe' - allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:osx-x86_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:osx-aarch_64@exe' - allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:osx-aarch_64@exe'
- -
- if (isCurrentWindows()) { - if (isCurrentWindows()) {
- protocArtifact 'com.google.protobuf:protoc:3.17.3:windows-x86_64@exe' - protocArtifact 'com.google.protobuf:protoc:3.21.8:windows-x86_64@exe'
- } - }
- if (isCurrentLinux()) { - if (isCurrentLinux()) {
- if (platform.endsWith("x86_64")) { - if (platform.endsWith("x86_64")) {
- protocArtifact 'com.google.protobuf:protoc:3.17.3:linux-x86_64@exe' - protocArtifact 'com.google.protobuf:protoc:3.21.8:linux-x86_64@exe'
- } - }
- else { - else {
- protocArtifact 'com.google.protobuf:protoc:3.17.3:linux-aarch_64@exe' - protocArtifact 'com.google.protobuf:protoc:3.21.8:linux-aarch_64@exe'
- } - }
- } - }
- if (isCurrentMac()) { - if (isCurrentMac()) {
- if (platform.endsWith("x86_64")) { - if (platform.endsWith("x86_64")) {
- protocArtifact 'com.google.protobuf:protoc:3.17.3:osx-x86_64@exe' - protocArtifact 'com.google.protobuf:protoc:3.21.8:osx-x86_64@exe'
- } - }
- else { - else {
- protocArtifact 'com.google.protobuf:protoc:3.17.3:osx-aarch_64@exe' - protocArtifact 'com.google.protobuf:protoc:3.21.8:osx-aarch_64@exe'
- } - }
- }
+buildscript { +buildscript {
+ dependencies { + dependencies {
+ classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18' + classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
+ } }
+} +}
+dependencies { +dependencies {
api 'com.google.protobuf:protobuf-java:3.17.3'
api project(':Framework-AsyncComm') api project(':Framework-AsyncComm')
api project(':Framework-Debugging') api project(':Framework-Debugging')
@@ -68,43 +45,8 @@ dependencies { api project(':ProposedUtils')
testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts') @@ -73,37 +49,3 @@ dependencies {
}
-/*protobuf {
+protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.17.3'
} }
-}*/ }*/
-
-task generateProto { -task generateProto {
- ext.srcdir = file("src/main/proto") - ext.srcdir = file("src/main/proto")
- ext.src = fileTree(srcdir) { - ext.src = fileTree(srcdir) {
@ -93,7 +74,7 @@ index 1b4922f66..3d2ef8856 100644
- args src - args src
- } - }
- } - }
} -}
- -
-tasks.compileJava.dependsOn(tasks.generateProto) -tasks.compileJava.dependsOn(tasks.generateProto)
-tasks.eclipse.dependsOn(tasks.generateProto) -tasks.eclipse.dependsOn(tasks.generateProto)
@ -108,11 +89,105 @@ index 1b4922f66..3d2ef8856 100644
-} -}
-zipSourceSubproject.dependsOn generateProto -zipSourceSubproject.dependsOn generateProto
- -
diff --git a/Ghidra/Debug/Debugger-isf/build.gradle b/Ghidra/Debug/Debugger-isf/build.gradle
index 6bf945c2e..3225d095d 100644
--- a/Ghidra/Debug/Debugger-isf/build.gradle
+++ b/Ghidra/Debug/Debugger-isf/build.gradle
@@ -20,42 +20,18 @@ apply from: "${rootProject.projectDir}/gradle/javaTestProject.gradle"
apply from: "${rootProject.projectDir}/gradle/distributableGhidraModule.gradle"
apply plugin: 'eclipse'
+apply plugin: 'com.google.protobuf'
eclipse.project.name = 'Debug Debugger-isf'
-configurations {
- allProtocArtifacts
- protocArtifact
-}
-
def platform = getCurrentPlatformName()
-dependencies {
- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:windows-x86_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:linux-x86_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:linux-aarch_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:osx-x86_64@exe'
- allProtocArtifacts 'com.google.protobuf:protoc:3.21.8:osx-aarch_64@exe'
-
- if (isCurrentWindows()) {
- protocArtifact 'com.google.protobuf:protoc:3.21.8:windows-x86_64@exe'
- }
- if (isCurrentLinux()) {
- if (platform.endsWith("x86_64")) {
- protocArtifact 'com.google.protobuf:protoc:3.21.8:linux-x86_64@exe'
- }
- else {
- protocArtifact 'com.google.protobuf:protoc:3.21.8:linux-aarch_64@exe'
- }
- }
- if (isCurrentMac()) {
- if (platform.endsWith("x86_64")) {
- protocArtifact 'com.google.protobuf:protoc:3.21.8:osx-x86_64@exe'
- }
- else {
- protocArtifact 'com.google.protobuf:protoc:3.21.8:osx-aarch_64@exe'
- }
+buildscript {
+ dependencies {
+ classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
}
+}
+dependencies {
api project(':Framework-AsyncComm')
api project(':Framework-Debugging')
api project(':ProposedUtils')
@@ -64,40 +40,6 @@ dependencies {
testImplementation project(path: ':Framework-Debugging', configuration: 'testArtifacts')
}
-task generateProto {
- ext.srcdir = file("src/main/proto")
- ext.src = fileTree(srcdir) {
- include "**/*.proto"
- }
- ext.outdir = file("build/generated/source/proto/main/java")
- outputs.dir(outdir)
- inputs.files(src)
- dependsOn(configurations.protocArtifact)
- doLast {
- def exe = configurations.protocArtifact.first()
- if (!isCurrentWindows()) {
- exe.setExecutable(true)
- }
- exec {
- commandLine exe, "--java_out=$outdir", "-I$srcdir"
- args src
- }
- }
-}
-
-tasks.compileJava.dependsOn(tasks.generateProto)
-tasks.eclipse.dependsOn(tasks.generateProto)
-rootProject.tasks.prepDev.dependsOn(tasks.generateProto)
-
-sourceSets {
- main {
- java {
- srcDir tasks.generateProto.outdir
- }
- }
-}
-zipSourceSubproject.dependsOn generateProto
-
// Include buildable native source in distribution
rootProject.assembleDistribution {
from (this.project.projectDir.toString()) {
diff --git a/build.gradle b/build.gradle diff --git a/build.gradle b/build.gradle
index dce3a5149..7a2e637ce 100644 index b0c717fb1..5f56506a5 100644
--- a/build.gradle --- a/build.gradle
+++ b/build.gradle +++ b/build.gradle
@@ -76,6 +76,12 @@ if (flatRepo.isDirectory()) { @@ -74,6 +74,12 @@ if (flatRepo.isDirectory()) {
jcenter() jcenter()
flatDir name: "flat", dirs:["$flatRepo"] flatDir name: "flat", dirs:["$flatRepo"]
} }
@ -125,6 +200,3 @@ index dce3a5149..7a2e637ce 100644
} }
} }
else { else {
--
2.33.1

View File

@ -12,20 +12,20 @@
, autoPatchelfHook , autoPatchelfHook
, icoutils , icoutils
, xcbuild , xcbuild
, protobuf3_17 , protobuf
, libredirect , libredirect
}: }:
let let
pkg_path = "$out/lib/ghidra"; pkg_path = "$out/lib/ghidra";
pname = "ghidra"; pname = "ghidra";
version = "10.2.3"; version = "10.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "NationalSecurityAgency"; owner = "NationalSecurityAgency";
repo = "Ghidra"; repo = "Ghidra";
rev = "Ghidra_${version}_build"; rev = "Ghidra_${version}_build";
sha256 = "sha256-YhjKRlFlF89H05NsTS69SB108rNiiWijvZZY9fR+Ebc="; hash = "sha256-v3XP+4fwjPzt/OOxX27L0twXw8T1Y94hgP4A5Ukol5I=";
}; };
gradle = gradle_7; gradle = gradle_7;
@ -45,7 +45,14 @@ let
cat >>Ghidra/Debug/Debugger-gadp/build.gradle <<HERE cat >>Ghidra/Debug/Debugger-gadp/build.gradle <<HERE
protobuf { protobuf {
protoc { protoc {
path = '${protobuf3_17}/bin/protoc' path = '${protobuf}/bin/protoc'
}
}
HERE
cat >>Ghidra/Debug/Debugger-isf/build.gradle <<HERE
protobuf {
protoc {
path = '${protobuf}/bin/protoc'
} }
} }
HERE HERE
@ -106,7 +113,7 @@ HERE
''; '';
outputHashAlgo = "sha256"; outputHashAlgo = "sha256";
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHash = "sha256-Z4RS3IzDP8V3SrrwOuX/hTlX7fs3woIhR8GPK/tFAzs="; outputHash = "sha256-HveS3f8XHpJqefc4djYmnYfd01H2OBFK5PLNOsHAqlc=";
}; };
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
@ -171,6 +178,7 @@ in stdenv.mkDerivation rec {
]; ];
license = licenses.asl20; license = licenses.asl20;
maintainers = with maintainers; [ roblabla ]; maintainers = with maintainers; [ roblabla ];
broken = stdenv.isDarwin;
}; };
} }

View File

@ -24,12 +24,12 @@ let
in stdenv.mkDerivation rec { in stdenv.mkDerivation rec {
pname = "ghidra"; pname = "ghidra";
version = "10.2.3"; version = "10.3";
versiondate = "20230208"; versiondate = "20230510";
src = fetchzip { src = fetchzip {
url = "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_${version}_build/ghidra_${version}_PUBLIC_${versiondate}.zip"; url = "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_${version}_build/ghidra_${version}_PUBLIC_${versiondate}.zip";
hash = "sha256-0uDLS+fnUqLw+oqoR/Vs56vhzNmA54k0WBvhvDmlGKs="; hash = "sha256-uFyTMWhj3yMVIPxEwkLtTqpJUi2S8A2GFjjY3rNTC2c=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [