# Copyright 2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="VCS which prioritizes ease of use and simplicity over flexibility"
HOMEPAGE="https://gameoftrees.org/"
SRC_URI="https://gameoftrees.org/releases/portable/got-portable-${PV}.tar.gz"
S="${WORKDIR}/got-portable-${PV}/"

LICENSE="ISC"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="cvg bearssl"

# util-linux for uuid.pc
# openssl for libcrypto
DEPEND="
	dev-libs/libevent:=
	sys-apps/util-linux
	virtual/zlib:=
	dev-libs/libbsd
	!bearssl? ( dev-libs/libretls:= )
	bearssl? ( dev-libs/libtls-bearssl:= )
	dev-libs/openssl:=
	sys-libs/ncurses:=
	app-crypt/libmd
"
RDEPEND="${DEPEND}"
BDEPEND="
	app-alternatives/yacc
	virtual/pkgconfig
"

src_configure() {
	econf \
		$(use_enable cvg) \
		--with-gitwrapper-git-libexec-path="${EPREFIX}/usr/libexec/git-core"
}