void-packages/srcpkgs/ghidra/template
2020-11-17 12:58:29 -06:00

70 lines
3.4 KiB
Bash

# Template file for 'ghidra'
pkgname=ghidra
version=9.2
revision=1
archs="x86_64*"
create_wrksrc=yes
hostmakedepends="gradle openjdk11 flex bsdtar unzip"
depends="openjdk11"
short_desc="Software reverse engineering (SRE) framework"
maintainer="Andrew Benson <abenson+void@gmail.com>"
license="Apache-2.0"
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://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/android4me/AXMLPrinter2.jar"
checksum="1ad28e59417b3a503361bf871e97d20dd0f7eb23bf0e87decd1e7a003d113c3e
7907eb4d6e9280b6e17ddce7ee0507eae2ef161ee29f70a10dbc6944fdca75bc
90c9b54798abca5b12f4a678db7d0a4c970f4702cb153c11919536d0014dedbf
1398fcb1e93abb19992c4fa06d7fe5758aabb4c45781d7ef306c6f57ca7a7321
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"
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
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/custom
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/dataMutability
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/globalRegVars.so
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/inline
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/jumpWithinInstruction
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/ldiv
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/noReturn
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/opaque
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/override.so
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/setRegister
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/sharedReturn
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/switch
/usr/libexec/ghidra/docs/GhidraClass/ExerciseFiles/Advanced/write"
python_version=2 #unverified
do_configure() {
cd ghidra-Ghidra_${version}_build
mkdir -p flatRepo
cp -f ${XBPS_SRCDISTDIR}/${pkgname}-${version}/AXMLPrinter2.jar flatRepo
for lib in csframework.jar hfsx_dmglib.jar hfsx.jar iharder-base64.jar; do
cp -f ../lib/$lib flatRepo
done
cp -f ../dex2jar-2.0/lib/dex-*.jar 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/
gradle yajswDevUnpack
}
do_build() {
cd ghidra-Ghidra_${version}_build
gradle buildGhidra
}
do_install() {
cd ghidra-Ghidra_${version}_build
vmkdir usr/libexec/ghidra
bsdtar --strip-components 1 -C ${DESTDIR}/usr/libexec/ghidra -xf build/dist/ghidra_$(echo $version | cut -d. -f1-2)_DEV_$(date -u +%Y%m%d)_linux64.zip
vmkdir usr/bin
ln -srf /usr/libexec/$pkgname/ghidraRun ${DESTDIR}/usr/bin/ghidra
}