### this file is sourced not run
PKGBUILD=1
PKGARCH=x86_64

# source: james
# release tarball
#PKGVER=
#TARBALL=
#MD5SUM=
#SRC_URL=
#BUNDLE=

# git-master tarball
PKGVER=4.0.2.2023.06 # pull date, release is 3 years behind
MD5SUM=f4a1a3df590b3d27e94fc06cc2f1211a
hash=e9fd6f4800be1584124e9eee92cf15ab947d33ec
hash7=${hash#???????}; hash7=${hash%$hash7}
TARBALL=capstone-$PKGVER-$hash7.tar.gz
SRC_URL=https://github.com/capstone-engine/capstone/archive/$hash.tar.gz

SLACKREQ=
SLACKDESC="libcapstone: libcapstone $PKGVER (Disassembly library)
libcapstone: 
libcapstone: Capstone is a lightweight multi-platform, multi-architecture 
libcapstone: disassembly framework, supporting multiple architectures: Arm, Arm64 
libcapstone: (Armv8), Ethereum Virtual Machine, M68K, M680X, Mips, PowerPC, Sparc, 
libcapstone: SystemZ, TMS320C64X, XCore & x86 and x86_64
libcapstone: 
libcapstone: http://www.capstone-engine.org/
libcapstone: 
libcapstone: 
libcapstone: 
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/capstone* &&
	CMAKEFLAGS="$CMAKEFLAGS -DLIBSUFFIX=64"
	CFLAGS="$CFLAGS -fPIC" CXXFLAGS="$CXXFLAGS -fPIC" # or it can't be linked by edb later
	sed -i -e 's|lib/pkgconfig|lib64/pkgconfig|' CMakeLists.txt &&
	pkg_build_cmake &&
	pkg_build_slackdesc
}


