# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

REAL_PN="xgqt-python-lib-${PN}"
MAJOR="$(ver_cut 1)"

DISTUTILS_USE_PEP517="flit"
PYTHON_COMPAT=( python3_{12..13} )

inherit distutils-r1

DESCRIPTION="Extensions for SCons, includes Python libraries and builders"
HOMEPAGE="https://codeberg.org/xgqt/xgqt-python-lib-scons-xo-exts/"

if [[ "${PV}" == *9999* ]] ; then
	inherit git-r3

	EGIT_REPO_URI="https://codeberg.org/xgqt/${REAL_PN}"
	S="${WORKDIR}/${P}/code/source/v${MAJOR}/${PN}-lib"
else
	SRC_URI="https://codeberg.org/xgqt/${REAL_PN}/archive/${PV}.tar.gz
		-> ${P}.codeberg.tar.gz"
	S="${WORKDIR}/${REAL_PN}/code/source/v${MAJOR}/${PN}-lib"

	KEYWORDS="~amd64 ~x86"
fi

LICENSE="MPL-2.0"
SLOT="0/${MAJOR}"

RDEPEND="
	dev-build/scons[${PYTHON_USEDEP}]
"