### this file is sourced not run
PKGVER=1.3.0.2023.06 # pull date, release is 3 years behind
PKGBUILD=1
PKGARCH=x86_64

# source: james
TARBALL=edb-debugger-2023.06.14.tar.bz2
MD5SUM=bfa5699241e8c182c186e98b1c25416a
#SRC_URL=https://github.com/eteran/edb-debugger/releases/download/$PKGVER/$TARBALL
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$TARBALL # package our own because of submodules
BUNDLE=

SLACKREQ='qt5-common libboost-common libcapstone'
SLACKDESC="edb: edb $PKGVER (Executable debugger)  
edb:  
edb: edb is a cross platform x86/x86-64 debugger and disassembler. The 
edb: difference between this and gdb is that this program can be used to debug 
edb: binary-only executables that come without any source code.  
edb: 
edb: https://github.com/eteran/edb-debugger
edb: http://codef00.com/projects 
edb: 
edb: 
edb: 
"
SLACKSUG="graphviz-qt5"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/edb* &&
	sed -i -e '6,8d' CMakeLists.txt && # remove the check for git submodule
	
	# qt5	
	export PATH="$PATH:/opt/qt5/bin"
	export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/qt5/$LIBDIR"
	export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_PATH="/opt/qt5/bin"
	export QT5_LD_LIBRARY_PATH="/opt/qt5/$LIBDIR"
	export QT5_PKG_CONFIG_PATH="/opt/qt5/$LIBDIR/pkgconfig"
	export QT5_CPLUS_INCLUDE_PATH="/opt/qt5/include" 
	
	# main binary
	pkg_build_cmake &&
	
	# docs
	#mkdir -p /usr/share/doc/edb /usr/share/man/man1 &&
	#cp -a doc /usr/share/doc/edb/html &&
	#cp -a README /usr/share/doc/edb &&
	#chown -R 0:0 /usr/share/doc/edb &&
	#install -m644 edb.1 /usr/share/man/man1 &&
	
	pkg_build_slackdesc
}
