commit:     f9edecf8b9d748a4849c58313c0066cfe3d525cc
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 16 15:54:38 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Thu Nov 16 15:55:04 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9edecf8

dev-java/java-config: update for new Meson-based build

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 dev-java/java-config/java-config-9999.ebuild | 51 +++++++++++++++++++++-------
 1 file changed, 38 insertions(+), 13 deletions(-)

diff --git a/dev-java/java-config/java-config-9999.ebuild 
b/dev-java/java-config/java-config-9999.ebuild
index 852afb28806a..a4dc516e9ab8 100644
--- a/dev-java/java-config/java-config-9999.ebuild
+++ b/dev-java/java-config/java-config-9999.ebuild
@@ -3,13 +3,11 @@
 
 EAPI=8
 
-# jython depends on java-config, so don't add it or things will break
 PYTHON_COMPAT=( python3_{10..12} )
-DISTUTILS_USE_PEP517=setuptools
 
-inherit distutils-r1 prefix
+inherit meson python-r1
 
-if [[ ${PV} = *9999 ]]; then
+if [[ ${PV} = 9999 ]]; then
        inherit git-r3
        EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/java-config.git";
 else
@@ -24,27 +22,54 @@ LICENSE="GPL-2"
 SLOT="2"
 IUSE="test"
 RESTRICT="!test? ( test )"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
 DEPEND="test? ( sys-apps/portage[${PYTHON_USEDEP}] )"
 
 # baselayout-java is added as a dep till it can be added to eclass.
 RDEPEND="
+       ${PYTHON_DEPS}
        sys-apps/baselayout-java
        sys-apps/portage[${PYTHON_USEDEP}]
 "
 
-python_configure_all() {
-       # setup.py fails to update this file
-       eprefixify src/launcher.bash
+src_configure() {
+       local python_only=false
+       python_foreach_impl my_src_configure
 }
 
-python_install_all() {
-       distutils-r1_python_install_all
+my_src_configure() {
+       local emesonargs=(
+               -Darch="${ARCH}"
+               -Dpython-only="${python_only}"
+               -Deprefix="${EPREFIX}"
+       )
 
-       # This replaces the file installed by java-config-wrapper.
-       dosym java-config-2 /usr/bin/java-config
+       meson_src_configure
+       python_only=true
 }
 
-python_test() {
-       esetup.py test
+src_compile() {
+       python_foreach_impl meson_src_compile
+}
+
+src_test() {
+       python_foreach_impl meson_src_test --no-rebuild --verbose
+}
+
+src_install() {
+       python_foreach_impl my_src_install
+
+       local scripts
+       mapfile -t scripts < <(awk '/^#!.*python/ {print FILENAME} {nextfile}' 
"${ED}"/usr/bin/* || die)
+       python_replicate_script "${scripts[@]}"
+}
+
+my_src_install() {
+       meson_src_install
+
+       local pydirs=(
+               "${D}$(python_get_sitedir)"
+       )
+       python_optimize "${pydirs[@]}"
 }

Reply via email to