# Maintainer: Mike Nolan <tesses@tesses.net>
pkgname=tessesframework # '-bzr', '-git', '-hg' or '-svn'
pkgver=0.0.4
pkgrel=1
pkgdesc=""
arch=('x86_64' 'powerpc')
url="https://git.tesses.org/tesses50/tessesframework"
license=('MIT')
groups=()
depends=('mbedtls')
makedepends=('git' 'cmake' 'make' 'base-devel' 'wget') # 'bzr', 'git', 'mercurial' or 'subversion'
install=
source=('tessesframework::git+https://git.tesses.org/tesses50/tessesframework')
noextract=()
sha256sums=('SKIP')
if [[ -z "$CMAKE_TOOLCHAIN" ]]; then
options=(!strip)
else
options=(!buildflags !strip)
fi


prepare() {
	cd "$srcdir/${pkgname}"
}

build() {
	cd "$srcdir/${pkgname}"
	mkdir build

	if [[ -z "$CMAKE_TOOLCHAIN" ]]; then
 	cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr -DTESSESFRAMEWORK_VENDERCERTCHAIN=OFF -DTESSESFRAMEWORK_FETCHCONTENT=OFF -DCMAKE_BUILD_TYPE=Release
  	else
	cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/usr -DTESSESFRAMEWORK_VENDERCERTCHAIN=OFF -DTESSESFRAMEWORK_FETCHCONTENT=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN"
	fi

	cd build
	make -j`nproc`

}




package() {
	cd "$srcdir/${pkgname}/build"
	make install DESTDIR="$pkgdir/"
}
