mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 13:27:09 +02:00
117 lines
3.5 KiB
Plaintext
117 lines
3.5 KiB
Plaintext
# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
|
|
# Contributor: Marian Buschsieweke <marian.buschsieweke@posteo.net>
|
|
pkgname=ghidra
|
|
pkgver=11.0
|
|
pkgrel=0
|
|
pkgdesc="A Cross Platform and Open Source Electronics Design Automation Suite"
|
|
url="https://ghidra-sre.org/"
|
|
# only x86_64 and aarch64 support provided by upstream
|
|
# aarch64: jdk segfaults
|
|
arch="x86_64"
|
|
license="Apache-2.0"
|
|
makedepends="
|
|
bash
|
|
gradle
|
|
protoc
|
|
unzip
|
|
"
|
|
# Note: Ghidra refuses to launch with only JRE installed, so
|
|
# please do not move JDK to makedepends
|
|
depends="
|
|
openjdk17-jdk
|
|
wmname
|
|
"
|
|
subpackages="
|
|
$pkgname-tutorials
|
|
$pkgname-doc
|
|
"
|
|
source="
|
|
https://github.com/NationalSecurityAgency/ghidra/archive/refs/tags/Ghidra_${pkgver}_build.tar.gz
|
|
use-system-protoc.patch
|
|
ghidra.sh
|
|
ghidra.desktop
|
|
"
|
|
# This contains binary executables in the exercises section of the
|
|
# documentation. We don't want to spoil the fun by stripping them.
|
|
options="net !check"
|
|
builddir="$srcdir/ghidra-Ghidra_${pkgver}_build"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
local protoc_ver
|
|
protoc_ver="$(protoc --version | grep -o '[0-9][.0-9]*')"
|
|
|
|
# protoc version needs to match protobuf runtime version
|
|
sed \
|
|
-e "s/com.google.protobuf:protobuf-java:3.17.3/com.google.protobuf:protobuf-java:$protoc_ver/g" \
|
|
-i Ghidra/Debug/Debugger-gadp/build.gradle
|
|
sed \
|
|
-e "s!lib/protobuf-java-3.17.3.jar!lib/protobuf-java-$protoc_ver.jar!g" \
|
|
-i Ghidra/Debug/Debugger-gadp/Module.manifest
|
|
}
|
|
|
|
build() {
|
|
export GRADLE_USER_HOME="$srcdir"/.gradle
|
|
gradle --parallel -I gradle/support/fetchDependencies.gradle init
|
|
gradle --parallel buildGhidra
|
|
}
|
|
|
|
package() {
|
|
# impedance matching between different arch naming conventions:
|
|
local arch
|
|
case "$CARCH" in
|
|
aarch64)
|
|
arch="arm_64"
|
|
;;
|
|
*)
|
|
arch="$CARCH"
|
|
;;
|
|
esac
|
|
|
|
install -d "$pkgdir"/usr/share "$pkgdir"/usr/bin
|
|
unzip \
|
|
-u "build/dist/ghidra_${pkgver}_DEV_$(date +"%Y%m%d")_linux_$arch.zip" \
|
|
-d "$pkgdir"/usr/share
|
|
mv "$pkgdir"/usr/share/ghidra_${pkgver}_DEV "$pkgdir"/usr/share/ghidra
|
|
|
|
# remove precompiled 7zip native libs for x86_64 Mac, Windows, and glibc
|
|
# Linux. Ghidra is falling back to using a java implementation on musl
|
|
# anyway.
|
|
rm -rf "$pkgdir"/usr/share/ghidra/Ghidra/Features/FileFormats/data/sevenzipnativelibs
|
|
|
|
install -Dm755 "$srcdir"/ghidra.sh "$pkgdir"/usr/bin/ghidra
|
|
ln -s /usr/share/ghidra/support/analyzeHeadless "$pkgdir"/usr/bin/ghidra-headless
|
|
install -Dm644 \
|
|
Ghidra/Framework/Gui/src/main/resources/images/GhidraIcon64.png \
|
|
"$pkgdir"/usr/share/icons/hicolor/64x64/apps/$pkgname.png
|
|
install -Dm 644 $srcdir/ghidra.desktop -t $pkgdir/usr/share/applications
|
|
}
|
|
|
|
tutorials() {
|
|
pkgdesc="Ghidra tutorial files"
|
|
# dependency dump:
|
|
# openjdk17-jdk
|
|
# wmname
|
|
# so:libgcc_s.so.1
|
|
# so:libstdc++.so.6
|
|
# the tutorials subpackage contains exmaples linked against glibc
|
|
# which are ment to be decompiled by ghidra
|
|
options="!strip !tracedeps"
|
|
|
|
amove usr/share/ghidra/docs/GhidraClass
|
|
}
|
|
|
|
doc() {
|
|
default_doc
|
|
|
|
amove usr/share/ghidra/docs
|
|
}
|
|
|
|
sha512sums="
|
|
9c6ad91a71ea49ce90bff422f45d2ad076898d618614b7aded6dfabf8660ccf05fc6579e4f41d50e49ea6c1dc88c03260ff63210d411e405f88aa78bb2cce29b Ghidra_11.0_build.tar.gz
|
|
f0d87188e4b90cf64f86130cb479dea640328f2f91d27f0af085fcb9262255cdc34f50b997365c2d6ca3d97b98ac62587e89f48cbd29d4ce6cca0b1b76ec39c7 use-system-protoc.patch
|
|
b075d5ac821bf4ed052acada45b882876a5493ab03cfa4d0537c4c5f27b666aa2b37de9ff561313b025f9d16b06b9ad17d59287ecf205c02798dbca2bc04925f ghidra.sh
|
|
a85b8b3276e2ff4ed8bda6470c15d02711ebaa48463c775cd2a36549fad738e9fe073dab80f8c57646490ffc959cdc27e9d25b1dc2a5810b0ddb249b5dc99a9b ghidra.desktop
|
|
"
|