# Template file for 'cryfs'
pkgname=cryfs
version=1.0.3
revision=2
build_style=cmake
configure_args="-DBoost_USE_STATIC_LIBS=OFF -DCRYFS_UPDATE_CHECKS=off
 -DBUILD_TESTING=ON
 -DDEPENDENCY_CONFIG=../cmake-utils/DependenciesFromLocalSystem.cmake"
hostmakedepends="pkg-config python3"
makedepends="boost-devel-minimal
 crypto++-devel fmt-devel fuse-devel libcurl-devel
 libgomp-devel range-v3 spdlog gtest-devel"
depends="fuse"
short_desc="Cryptographic filesystem for the cloud"
maintainer="Andy Weidenbaum <atweiden@tutanota.de>"
license="LGPL-3.0-only"
homepage="https://www.cryfs.org"
changelog="https://github.com/cryfs/cryfs/raw/master/ChangeLog.txt"
distfiles="https://github.com/cryfs/cryfs/releases/download/${version}/${pkgname}-${version}.tar.xz"
checksum=1f30cc406e5c811490ba14174518a797a80442bfff317a2fdfbc5d21205b9dfe

post_patch() {
	rm -rf vendor/cryptopp
	rm -rf vendor/spdlog
}

pre_configure() {
	local _pkg_config="$($PKG_CONFIG --cflags spdlog)"
	CFLAGS+=" $_pkg_config"
	CXXFLAGS+=" $_pkg_config"
}

do_check() {
	cd ${wrksrc}/build
	./test/gitversion/gitversion-test
	./test/cpp-utils/cpp-utils-test
	./test/parallelaccessstore/parallelaccessstore-test
	./test/blockstore/blockstore-test
	./test/blobstore/blobstore-test
	./test/cryfs/cryfs-test
	# ./test/cryfs-cli/cryfs-cli-test
	cd ${wrksrc}
}

# REMARKS:
# On update, check upstream CI script to inform do_check:
# cryfs/cryfs/.github/workflows/actions/run_tests/action.yaml
