From 8c2095bec53972f9337e3238309efdd6b2d22d41 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 11 Dec 2021 12:59:00 +0100 Subject: [PATCH] ghidra: update to 10.1. --- srcpkgs/ghidra/patches/protoc.patch | 75 ++++++++++++++++++----------- srcpkgs/ghidra/template | 23 ++++++--- 2 files changed, 63 insertions(+), 35 deletions(-) diff --git a/srcpkgs/ghidra/patches/protoc.patch b/srcpkgs/ghidra/patches/protoc.patch index 30c45164caf..aa985b86cf6 100644 --- a/srcpkgs/ghidra/patches/protoc.patch +++ b/srcpkgs/ghidra/patches/protoc.patch @@ -1,46 +1,67 @@ ---- a/ghidra_build/Ghidra/Debug/Debugger-gadp/build.gradle 2021-09-28 20:47:24.000000000 +0200 -+++ - 2021-10-21 16:35:42.275129993 +0200 -@@ -33,21 +33,11 @@ - def os = org.gradle.internal.os.OperatingSystem.current() +--- ghidra-10.1/ghidra_build/Ghidra/Debug/Debugger-gadp/build.gradle 2021-12-10 19:03:38.000000000 +0100 ++++ - 2021-12-11 13:01:51.089861724 +0100 +@@ -33,33 +33,33 @@ + def platform = getCurrentPlatformName() dependencies { -- allProtocArtifacts 'com.google.protobuf:protoc:3.11.1:windows-x86_64@exe' -- allProtocArtifacts 'com.google.protobuf:protoc:3.11.1:linux-x86_64@exe' -- allProtocArtifacts 'com.google.protobuf:protoc:3.11.1:osx-x86_64@exe' +- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:windows-x86_64@exe' +- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:linux-x86_64@exe' +- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:linux-aarch_64@exe' +- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:osx-x86_64@exe' +- allProtocArtifacts 'com.google.protobuf:protoc:3.17.3:osx-aarch_64@exe' + allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:windows-x86_64@exe' -+ allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:linux-x86_64@exe' -+ allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:osx-x86_64@exe' ++ allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:linux-x86_64@exe' ++ allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:linux-aarch_64@exe' ++ allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:osx-x86_64@exe' ++ allProtocArtifacts 'com.google.protobuf:protoc:3.18.1:osx-aarch_64@exe' -- if (os.isWindows()) { -- protocArtifact 'com.google.protobuf:protoc:3.11.1:windows-x86_64@exe' -- } -- if (os.isLinux()) { -- protocArtifact 'com.google.protobuf:protoc:3.11.1:linux-x86_64@exe' -- } -- if (os.isMacOsX()) { -- protocArtifact 'com.google.protobuf:protoc:3.11.1:osx-x86_64@exe' -- } -- -- api 'com.google.protobuf:protobuf-java:3.11.1' + if (isCurrentWindows()) { +- protocArtifact 'com.google.protobuf:protoc:3.17.3:windows-x86_64@exe' ++ protocArtifact 'com.google.protobuf:protoc:3.18.1:windows-x86_64@exe' + } + if (isCurrentLinux()) { + if (platform.endsWith("x86_64")) { +- protocArtifact 'com.google.protobuf:protoc:3.17.3:linux-x86_64@exe' ++ protocArtifact 'com.google.protobuf:protoc:3.18.1:linux-x86_64@exe' + } + else { +- protocArtifact 'com.google.protobuf:protoc:3.17.3:linux-aarch_64@exe' ++ protocArtifact 'com.google.protobuf:protoc:3.18.1:linux-aarch_64@exe' + } + } + if (isCurrentMac()) { + if (platform.endsWith("x86_64")) { +- protocArtifact 'com.google.protobuf:protoc:3.17.3:osx-x86_64@exe' ++ protocArtifact 'com.google.protobuf:protoc:3.18.1:osx-x86_64@exe' + } + else { +- protocArtifact 'com.google.protobuf:protoc:3.17.3:osx-aarch_64@exe' ++ protocArtifact 'com.google.protobuf:protoc:3.18.1:osx-aarch_64@exe' + } + } + +- api 'com.google.protobuf:protobuf-java:3.17.3' + api 'com.google.protobuf:protobuf-java:3.18.1' api project(':Framework-AsyncComm') api project(':Framework-Debugging') api project(':ProposedUtils') -@@ -58,7 +48,7 @@ +@@ -70,7 +70,7 @@ /*protobuf { protoc { -- artifact = 'com.google.protobuf:protoc:3.11.1' +- artifact = 'com.google.protobuf:protoc:3.17.3' + artifact = 'com.google.protobuf:protoc:3.18.1' } }*/ -@@ -72,12 +62,7 @@ +@@ -82,14 +82,9 @@ + 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 (!os.isWindows()) { +- if (!isCurrentWindows()) { - exe.setExecutable(true) - } exec { @@ -49,8 +70,8 @@ args src } } ---- a/ghidra_build/Ghidra/Debug/Debugger-gadp/Module.manifest 2021-09-28 20:47:24.000000000 +0200 -+++ - 2021-10-21 16:40:18.629990242 +0200 +--- ghidra-10.1/ghidra_build/Ghidra/Debug/Debugger-gadp/Module.manifest 2021-12-10 19:03:38.000000000 +0100 ++++ - 2021-12-11 13:02:09.420069640 +0100 @@ -1 +1 @@ --MODULE FILE LICENSE: lib/protobuf-java-3.11.1.jar BSD +-MODULE FILE LICENSE: lib/protobuf-java-3.17.3.jar BSD +MODULE FILE LICENSE: lib/protobuf-java-3.18.1.jar BSD diff --git a/srcpkgs/ghidra/template b/srcpkgs/ghidra/template index 30eb7b2e971..929ded07562 100644 --- a/srcpkgs/ghidra/template +++ b/srcpkgs/ghidra/template @@ -1,8 +1,10 @@ # Template file for 'ghidra' pkgname=ghidra -version=10.0.4 +version=10.1 revision=1 -archs="x86_64*" +archs="x86_64* aarch64*" +# Other 64bit archs should be easily patchable, +# grep for linux_arm_64 to find all places in need of patching create_wrksrc=yes build_wrksrc="ghidra_build" hostmakedepends="gradle openjdk11 flex unzip protobuf which" @@ -14,18 +16,18 @@ homepage="https://ghidra-sre.org/" distfiles="https://github.com/NationalSecurityAgency/ghidra/archive/Ghidra_${version}_build.tar.gz https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip https://sourceforge.net/projects/catacombae/files/HFSExplorer/0.21/hfsexplorer-0_21-bin.zip - https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-12.12/yajsw-stable-12.12.zip + https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-beta-13.01/yajsw-beta-13.01.zip https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar" -checksum="76f1bd9604d49a2e59c47b347aedb90484bcfe51217c792e8cc771fc6481147c +checksum="6250b2c2ff56d6f7beaf29d6144ae5d52ce33ba0a132ef54e5d4f7839d950dff 7907eb4d6e9280b6e17ddce7ee0507eae2ef161ee29f70a10dbc6944fdca75bc 90c9b54798abca5b12f4a678db7d0a4c970f4702cb153c11919536d0014dedbf - 1398fcb1e93abb19992c4fa06d7fe5758aabb4c45781d7ef306c6f57ca7a7321 + 430fb7901bd0fd52a5b90bd0cbd89e9d334077eb72a9b26896f465de1e593a99 00ed038eb6abaf6ddec8d202a3ed7a81b521458f4cd459948115cfd02ff59d6d" skip_extraction="AXMLPrinter2.jar" nopie=yes nostrip_files="animals createStructure dataMutability inline ldiv opaque setRegister switch compilerVsDecompiler custom globalRegVars.so - jumpWithinInstruction noReturn override.so sharedReturn" + jumpWithinInstruction noReturn override.so sharedReturn write" skiprdeps="/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/animals /usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/compilerVsDecompiler /usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/createStructure @@ -43,6 +45,7 @@ skiprdeps="/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/animals /usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/switch /usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/write" python_version=2 # Jython 2.7.2 stuff +nocross=yes post_extract() { # makes patching easier @@ -57,7 +60,7 @@ do_configure() { done cp -f ../dex2jar-2.0/lib/dex-*.jar dependencies/flatRepo mkdir -p ${wrksrc}/ghidra.bin/Ghidra/Features/GhidraServer/ - cp -f ${XBPS_SRCDISTDIR}/${pkgname}-${version}/yajsw-stable-12.12.zip ${wrksrc}/ghidra.bin/Ghidra/Features/GhidraServer/ + cp -f ${XBPS_SRCDISTDIR}/${pkgname}-${version}/yajsw-beta-13.01.zip ${wrksrc}/ghidra.bin/Ghidra/Features/GhidraServer/ gradle yajswDevUnpack } @@ -66,9 +69,13 @@ do_build() { } do_install() { + case "$XBPS_TARGET_MACHINE" in + x86_64*) arch=x86_64;; + aarch64*) arch=arm_64;; + esac cd ${wrksrc}/${build_wrksrc} vmkdir usr/libexec/ghidra - bsdtar --strip-components 1 -C ${DESTDIR}/usr/libexec/ghidra -xf build/dist/ghidra_${version}_DEV_$(date -u +%Y%m%d)_linux64.zip + bsdtar --strip-components 1 -C ${DESTDIR}/usr/libexec/ghidra -xf build/dist/ghidra_${version}_DEV_$(date -u +%Y%m%d)_linux_${arch}.zip vmkdir usr/bin ln -srf /usr/libexec/$pkgname/ghidraRun ${DESTDIR}/usr/bin/ghidra }