summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Street2021-04-22 12:09:31 -0400
committerLuke Street2021-04-22 12:09:31 -0400
commit3b1e2a990591dba8b209e9836b5fdd6ec1a845d5 (patch)
tree3813b665c68ba29e3eed9bb06134bef51970afdf
parent612239acb6873e369b9929f55ddba749f3e7c9dd (diff)
downloadaur-3b1e2a990591dba8b209e9836b5fdd6ec1a845d5.tar.gz
Update to 9.2.3; cleanup from ghidra-dev
-rw-r--r--.SRCINFO19
-rw-r--r--2443.patch15
-rw-r--r--PKGBUILD134
3 files changed, 63 insertions, 105 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a404b1fafd5b..e983d128ca28 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,36 +1,19 @@
pkgbase = ghidra-git
pkgdesc = Software reverse engineering framework (git)
- pkgver = 9.2.2+r211+g41c453c54
+ pkgver = 9.2.3+r725+gb57744d4e
pkgrel = 1
url = https://www.nsa.gov/ghidra
arch = x86_64
license = Apache
makedepends = git
makedepends = gradle
- makedepends = unzip
- makedepends = fop
depends = java-runtime-common
depends = jdk11-openjdk
- depends = bash
- depends = hicolor-icon-theme
provides = ghidra
conflicts = ghidra
- noextract = AXMLPrinter2.jar
- noextract = yajsw-stable-12.12.zip
- noextract = hfsexplorer-0_21-bin.zip
source = git+https://github.com/NationalSecurityAgency/ghidra
- source = git+https://github.com/NationalSecurityAgency/ghidra-data
- source = https://github.com/pxb1988/dex2jar/releases/download/2.0/dex-tools-2.0.zip
- source = https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar
- source = https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-12.12/yajsw-stable-12.12.zip
- source = https://sourceforge.net/projects/catacombae/files/HFSExplorer/0.21/hfsexplorer-0_21-bin.zip
source = ghidra.desktop
sha512sums = SKIP
- sha512sums = SKIP
- sha512sums = c4a6c72ea09b58a44fcb8918cfada600467f10f99a02b53d2436ac68295e73c8daf9ba0a8bc7160ba1e28e87f032ee034435ebe40af35b6e2fe9fa4607581358
- sha512sums = c1168ec913f1fbb0675915d4fd865ec9a8e8573f6c8aedcb6e68166f61f11aeaececc7548d54d78134843c0102c57d6350973f6d3027d0ffdae52a5c57a7f601
- sha512sums = 0ff5a228ae1c5251c8ba59f9bcd9b4a199b0caaf688f6eccba42c3d227784d8f56f9164b2fad73fc173ec314340c036144123ce152fe911013df5598bd708944
- sha512sums = b85b4316115695acc78cc7c675c673058c05a238451562be0c6a48b2d11a28e5645a42cb62cdf063be015369df26201dfab6cf2e60f39e6468d1d53b23f94415
sha512sums = a85b8b3276e2ff4ed8bda6470c15d02711ebaa48463c775cd2a36549fad738e9fe073dab80f8c57646490ffc959cdc27e9d25b1dc2a5810b0ddb249b5dc99a9b
pkgname = ghidra-git
diff --git a/2443.patch b/2443.patch
deleted file mode 100644
index 9b44916f032f..000000000000
--- a/2443.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/Ghidra/Features/Decompiler/src/main/help/help/TOC_Source.xml b/Ghidra/Features/Decompiler/src/main/help/help/TOC_Source.xml
-index 2317da834..20cd85554 100644
---- a/Ghidra/Features/Decompiler/src/main/help/help/TOC_Source.xml
-+++ b/Ghidra/Features/Decompiler/src/main/help/help/TOC_Source.xml
-@@ -68,7 +68,9 @@
- text="Program Annotations Affecting the Decompiler"
- target="help/topics/DecompilePlugin/DecompilerAnnotations.html">
- <tocdef id="AnnoteFunctionBody" sortgroup="a" text="Machine Instructions" target="help/topics/DecompilePlugin/DecompilerAnnotations.html#AnnoteFunctionBody"/>
-- <tocdef id="AnnoteComments" sortgroup="b" text="Comments" target="help/topics/DecompilePlugin/DecompilerAnnotations.html#AnnoteComments"/>
-+ <!-- Space added to text="Comments" attribute below to distinguish it from the CommentsPlugin section of the same name
-+ https://github.com/NationalSecurityAgency/ghidra/issues/2443 -->
-+ <tocdef id="AnnoteComments" sortgroup="b" text="Comments " target="help/topics/DecompilePlugin/DecompilerAnnotations.html#AnnoteComments"/>
- <tocdef id="AnnoteVariables" sortgroup="c" text="Variable Annotations" target="help/topics/DecompilePlugin/DecompilerAnnotations.html#AnnoteVariables"/>
- <tocdef id="AnnotePrototype" sortgroup="d" text="Function Prototypes" target="help/topics/DecompilePlugin/DecompilerAnnotations.html#AnnotePrototype"/>
- <tocdef id="AnnoteMutability" sortgroup="e" text="Data Mutability" target="help/topics/DecompilePlugin/DecompilerAnnotations.html#AnnoteMutability"/>
diff --git a/PKGBUILD b/PKGBUILD
index 7e30f542a5bd..508377b1b226 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,107 +1,97 @@
-# Maintainer: Jean Lucas <jean@4ray.co>
+# Maintainer: Luke Street <luke@street.dev>
+# Contributor: Arnaud Dovi <mr.dovi@gmail.com>
+# Contributor: Jean Lucas <jean@4ray.co>
# Contributor: Danny Bautista <pyrolagus@gmail.com>
pkgname=ghidra-git
-pkgver=9.2.2+r211+g41c453c54
-_d2j=2.0
-_yajsw=12.12
-_hfsx=0.21
+pkgver=9.2.3+r725+gb57744d4e
pkgrel=1
pkgdesc='Software reverse engineering framework (git)'
-arch=(x86_64)
-url=https://www.nsa.gov/ghidra
-_git=https://github.com/NationalSecurityAgency/ghidra
+arch=('x86_64')
+url='https://www.nsa.gov/ghidra'
license=(Apache)
provides=(ghidra)
conflicts=(ghidra)
-depends=(java-runtime-common jdk11-openjdk bash hicolor-icon-theme)
-makedepends=(git gradle unzip fop)
+depends=(
+ 'java-runtime-common'
+ 'jdk11-openjdk'
+)
+makedepends=(
+ 'git'
+ 'gradle'
+)
source=(
- git+$_git
- git+$_git-data
- https://github.com/pxb1988/dex2jar/releases/download/$_d2j/dex-tools-$_d2j.zip
- https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar
- https://sourceforge.net/projects/yajsw/files/yajsw/yajsw-stable-$_yajsw/yajsw-stable-$_yajsw.zip
- https://sourceforge.net/projects/catacombae/files/HFSExplorer/$_hfsx/hfsexplorer-${_hfsx/./_}-bin.zip
+ "git+https://github.com/NationalSecurityAgency/ghidra"
ghidra.desktop
)
-noextract=(
- AXMLPrinter2.jar
- yajsw-stable-$_yajsw.zip
- hfsexplorer-${_hfsx/./_}-bin.zip
+sha512sums=(
+ 'SKIP'
+ 'a85b8b3276e2ff4ed8bda6470c15d02711ebaa48463c775cd2a36549fad738e9fe073dab80f8c57646490ffc959cdc27e9d25b1dc2a5810b0ddb249b5dc99a9b'
)
-sha512sums=('SKIP'
- 'SKIP'
- 'c4a6c72ea09b58a44fcb8918cfada600467f10f99a02b53d2436ac68295e73c8daf9ba0a8bc7160ba1e28e87f032ee034435ebe40af35b6e2fe9fa4607581358'
- 'c1168ec913f1fbb0675915d4fd865ec9a8e8573f6c8aedcb6e68166f61f11aeaececc7548d54d78134843c0102c57d6350973f6d3027d0ffdae52a5c57a7f601'
- '0ff5a228ae1c5251c8ba59f9bcd9b4a199b0caaf688f6eccba42c3d227784d8f56f9164b2fad73fc173ec314340c036144123ce152fe911013df5598bd708944'
- 'b85b4316115695acc78cc7c675c673058c05a238451562be0c6a48b2d11a28e5645a42cb62cdf063be015369df26201dfab6cf2e60f39e6468d1d53b23f94415'
- 'a85b8b3276e2ff4ed8bda6470c15d02711ebaa48463c775cd2a36549fad738e9fe073dab80f8c57646490ffc959cdc27e9d25b1dc2a5810b0ddb249b5dc99a9b')
+_pkgname="${pkgname/-*/}"
+_stop='\e[m'
+_color="\e[33m"
+_bold='\e[1m'
+_prefix=" ${_bold}${_color}==>$_stop "
pkgver() {
- cd ghidra
+ cd "$_pkgname"
git describe --tags | sed 's#Ghidra_##;s#_build##;s#-#+#g;s#+#+r#'
}
prepare() {
- # HFSExplorer isn't archived in a folder, so let's make one to extract it into
- mkdir -p hfsx
- unzip -o hfsexplorer-${_hfsx/./_}-bin.zip -d hfsx
-
- cd ghidra
-
- # Copy needed libraries into a flat repo
- mkdir -p flatRepo
- cp ../dex2jar-$_d2j/lib/dex-*.jar \
- ../AXMLPrinter2.jar \
- ../hfsx/lib/{csframework,hfsx*,iharder-base64}.jar \
- flatRepo
- cp ../yajsw-stable-$_yajsw.zip Ghidra/Features/GhidraServer
-
- # YAJSW expects this symlink
- ln -nsf ghidra ../ghidra.bin
-
- # Add FID datasets
- install -Dm 644 ../ghidra-data/FunctionID/*.fidb -t Ghidra/Features/FunctionID/src/main/fidb
-
- # Ignore lack of licensing for YAJSW zip, packed FID datasets, and the native binaries
- sed -i '/FileTree tree/a\\t\texclude "yajsw-stable-**.zip"\n\t\texclude "src/main/fidb/**.fidb"\n\t\texclude "os/linux64/**"' gradle/support/ip.gradle
+ cd "$_pkgname"
+
+ echo -e "${_prefix}Setting up the build dependencies"
+ gradle --parallel --init-script gradle/support/fetchDependencies.gradle init
+
+ ##
+ ## FOR GHIDRA DEVELOPERS
+ ## (Left commented because the steps below are only required if you want to develop and contribute to ghidra)
+ ## https://github.com/NationalSecurityAgency/ghidra/blob/master/DevGuide.md
+ ##
+
+# echo -e "${_prefix}Setting up the developers environment"
+# gradle --parallel prepDev
+#
+# echo -e "${_prefix}Setting up the eclipse configurations"
+# gradle --parallel eclipse
+#
+# echo -e "${_prefix}Compiling the linux64 native binaries"
+# gradle --parallel buildNatives_linux64
+#
+# echo -e "${_prefix}Compiling the precompile language modules"
+# gradle --parallel sleighCompile
}
build() {
- cd ghidra
-
- # GhidraServer requires YAJSW
- gradle yajswDevUnpack
-
- # Build native components
- gradle prebuildNatives_linux64
-
- # Pre-compile language modules
- gradle sleighCompile
-
- # Let's go
- gradle buildGhidra
+ cd "$_pkgname"
+ echo -e "${_prefix}Building Ghidra"
+ gradle --parallel buildGhidra
}
package() {
- cd ghidra
+ cd "$_pkgname"
+ base="$(pwd)"
+ echo -e "${_prefix}Creating the package base"
install -d "$pkgdir"/{opt,usr/bin}
- # Extract built archive into destination folder
+ echo -e "${_prefix}Extracting the zip archive"
_appver=$(grep -oP '(?<=^application.version=).*$' Ghidra/application.properties)
_relname=$(grep -oP '(?<=^application.release.name=).*$' Ghidra/application.properties)
- unzip -u build/dist/ghidra_${_appver}_${_relname}_$(date +"%Y%m%d")_linux64.zip -d "$pkgdir"/opt
- # Use a simple directory name
- mv "$pkgdir"/opt/ghidra{_${_appver}_${_relname},}
+ (cd "$pkgdir"/opt && jar xf "$base"/build/dist/ghidra_"${_appver}_${_relname}_$(date +"%Y%m%d")"_linux64.zip)
+
+ echo -e "${_prefix}Setting up a versionless directory name"
+ mv "$pkgdir"/opt/ghidra{_"${_appver}_${_relname}",}
+ echo -e "${_prefix}Setting up /usr/bin launchers"
ln -s /opt/ghidra/ghidraRun "$pkgdir"/usr/bin/ghidra
ln -s /opt/ghidra/support/analyzeHeadless "$pkgdir"/usr/bin/ghidra-headless
+ echo -e "${_prefix}Setting up desktop shortcut"
install -Dm 644 ../ghidra.desktop -t "$pkgdir"/usr/share/applications
- for i in 16 24 32 40 48 64 128 256; do
- install -Dm 644 Ghidra/Framework/Generic/src/main/resources/images/GhidraIcon$i.png \
- "$pkgdir"/usr/share/icons/hicolor/${i}x${i}/apps/ghidra.png
- done
+
+ echo -e "${_prefix}Setting up desktop icon"
+ install -Dm 644 Ghidra/Framework/Generic/src/main/resources/images/GhidraIcon64.png "$pkgdir"/usr/share/pixmaps/ghidra.png
}