From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BAFA2158089 for ; Thu, 12 Oct 2023 05:04:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80E922BC014; Thu, 12 Oct 2023 05:04:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E05502BC014 for ; Thu, 12 Oct 2023 05:04:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ADFA4335C2A for ; Thu, 12 Oct 2023 05:04:40 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 48FBEEC5 for ; Thu, 12 Oct 2023 05:04:39 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1697087068.54b07999b19d0f3de682b6bec5c545cf1af20bc0.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-portage/gentoolkit/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-portage/gentoolkit/gentoolkit-9999.ebuild X-VCS-Directories: app-portage/gentoolkit/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 54b07999b19d0f3de682b6bec5c545cf1af20bc0 X-VCS-Branch: master Date: Thu, 12 Oct 2023 05:04:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: eb0015dc-d961-40dc-a052-16ec3a8be6b2 X-Archives-Hash: bcd08a31486e073ad67e55acb21978a2 commit: 54b07999b19d0f3de682b6bec5c545cf1af20bc0 Author: Zac Medico gentoo org> AuthorDate: Mon Oct 9 05:19:33 2023 +0000 Commit: Sam James gentoo org> CommitDate: Thu Oct 12 05:04:28 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54b07999 app-portage/gentoolkit: Migrate 9999 to use Meson Bug: https://bugs.gentoo.org/909888 Signed-off-by: Zac Medico gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/33257 Signed-off-by: Sam James gentoo.org> app-portage/gentoolkit/gentoolkit-9999.ebuild | 68 +++++++++++++++++++++++---- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/app-portage/gentoolkit/gentoolkit-9999.ebuild b/app-portage/gentoolkit/gentoolkit-9999.ebuild index 018a60d8df98..e4a3125c8852 100644 --- a/app-portage/gentoolkit/gentoolkit-9999.ebuild +++ b/app-portage/gentoolkit/gentoolkit-9999.ebuild @@ -6,7 +6,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{10..12} pypy3 ) PYTHON_REQ_USE="xml(+),threads(+)" -inherit distutils-r1 tmpfiles +inherit meson python-r1 tmpfiles if [[ ${PV} = 9999* ]]; then EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/gentoolkit.git" @@ -21,6 +21,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage-Tools" LICENSE="GPL-2" SLOT="0" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" # Need newer Portage for eclean-pkg API, bug #900224 DEPEND=" @@ -28,19 +29,25 @@ DEPEND=" " RDEPEND=" ${DEPEND} + ${PYTHON_DEPS} app-alternatives/awk sys-apps/gentoo-functions " -BDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]" -distutils_enable_tests setup.py - -python_prepare_all() { - python_setup - echo VERSION="${PVR}" "${PYTHON}" setup.py set_version - VERSION="${PVR}" "${PYTHON}" setup.py set_version - distutils-r1_python_prepare_all +# setuptools is still needed as a workaround for Python 3.12+ for now. +# https://github.com/mesonbuild/meson/issues/7702 +# +# >=meson-1.2.1-r1 for bug #912051 +BDEPEND=" + ${PYTHON_DEPS} + >=dev-util/meson-1.2.1-r1 + $(python_gen_cond_dep ' + dev-python/setuptools[${PYTHON_USEDEP}] + ' python3_12) +" +src_prepare() { + default if use prefix-guest ; then # use correct repo name, bug #632223 sed -i \ @@ -49,6 +56,49 @@ python_prepare_all() { fi } +src_configure() { + local code_only=false + python_foreach_impl my_src_configure +} + +my_src_configure() { + local emesonargs=( + -Dcode-only=${code_only} + -Deprefix="${EPREFIX}" + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" + ) + + meson_src_configure + code_only=true +} + +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 + dotmpfiles data/tmpfiles.d/revdep-rebuild.conf + + local scripts + mapfile -t scripts < <(awk '/^#!.*python/ {print FILENAME} {nextfile}' "${ED}"/usr/bin/* || die) + python_replicate_script "${scripts[@]}" +} + +my_src_install() { + local pydirs=( + "${D}$(python_get_sitedir)" + ) + + meson_src_install + python_optimize "${pydirs[@]}" + python_fix_shebang "${pydirs[@]}" +} + pkg_postinst() { tmpfiles_process revdep-rebuild.conf