dev-util/uncrustify: require python always; correctly find it

The build uses several python code generators. The package worked anyway
despite pkg_setup only running for USE=test, because it always found the
latest version, ignoring PYTHON_COMPAT entirely. This occurs because
cmake.eclass no longer forces the python_setup executable to be found.

Bug: https://bugs.gentoo.org/959154
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
This commit is contained in:
Eli Schwartz
2025-07-30 00:48:11 -04:00
parent f82121a6e3
commit e7e87eeca3
3 changed files with 25 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -21,11 +21,13 @@ HOMEPAGE="https://uncrustify.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="test? ( ${PYTHON_DEPS} )"
BDEPEND="${PYTHON_DEPS}"
pkg_setup() {
use test && python-any-r1_pkg_setup
src_configure() {
local mycmakeargs=(
-DPython3_FIND_STRATEGY=LOCATION
)
cmake_src_configure
}

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -21,11 +21,13 @@ HOMEPAGE="https://uncrustify.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="test? ( ${PYTHON_DEPS} )"
BDEPEND="${PYTHON_DEPS}"
pkg_setup() {
use test && python-any-r1_pkg_setup
src_configure() {
local mycmakeargs=(
-DPython3_FIND_STRATEGY=LOCATION
)
cmake_src_configure
}

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -12,22 +12,22 @@ else
S=${WORKDIR}/${PN}-${P}
fi
inherit cmake ${scm_eclass}
PYTHON_COMPAT=( python3_{9..12} )
inherit python-any-r1
inherit cmake python-any-r1 ${scm_eclass}
DESCRIPTION="C/C++/C#/D/Java/Pawn code indenter and beautifier"
HOMEPAGE="https://uncrustify.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="test? ( ${PYTHON_DEPS} )"
BDEPEND="${PYTHON_DEPS}"
pkg_setup() {
use test && python-any-r1_pkg_setup
src_configure() {
local mycmakeargs=(
-DPython3_FIND_STRATEGY=LOCATION
)
cmake_src_configure
}