• [gentoo-dev] [PATCH v2 0/7] distutils-r1.eclass + python-utils-r1.eclas

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Tue Mar 5 18:20:01 2024
    Hi,

    The same set as previously + extra patches from Eli, James and Sam.



    Eli Schwartz (1):
    distutils-r1.eclass: wire up meson-python to meson.eclass

    James Le Cuirot (1):
    python-utils-r1.eclass: Fix python_doheader install location with ROOT

    Michał Górny (4):
    distutils-r1.eclass: Remove -Werror... hack (now in cython)
    distutils-r1.eclass: Limit DISTUTILS_EXT logic to compile & test
    distutils-r1.eclass: Move filter-lto into DISTUTILS_EXT block
    distutils-r1.eclass: Make vars local before calling filter-lto

    Sam James (1):
    meson.eclass: move python_export_utf8_locale to meson_src_configure

    eclass/distutils-r1.eclass | 45 +++++++++++++++++++++++++----------
    eclass/meson.eclass | 6 ++---
    eclass/python-utils-r1.eclass | 2 +-
    3 files changed, 36 insertions(+), 17 deletions(-)

    --
    2.44.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Tue Mar 5 18:20:01 2024
    From: James Le Cuirot <[email protected]>

    python_get_includedir is prefixed with ESYSROOT, not EPREFIX, so we need
    to strip off the former, not the latter.

    This is currently only used for dev-python/pillow, which I have tested.

    Signed-off-by: James Le Cuirot <[email protected]>
    ---
    eclass/python-utils-r1.eclass | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 3af3cbdb075e..caa39813feec 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -884,7 +884,7 @@ python_doheader() {
    [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'

    local includedir=$(python_get_includedir)
    - local d=${includedir#${EPREFIX}}
    + local d=${includedir#${ESYSROOT}}

    (
    insopts -m 0644
    --
    2.44.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Tue Mar 5 18:30:01 2024
    From: Sam James <[email protected]>

    We don't need it in setup_meson_src_configure as distutils-r1 uses it and
    it'll get called twice then.

    Signed-off-by: Sam James <[email protected]>
    ---
    eclass/meson.eclass | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/eclass/meson.eclass b/eclass/meson.eclass
    index 3bf0ba9ebe97..85f024de1b0c 100644
    --- a/eclass/meson.eclass
    +++ b/eclass/meson.eclass
    @@ -393,9 +393,6 @@ setup_meson_src_configure() {
    tc-export NM
    tc-getPROG READELF readelf >/dev/null

    - # https://bugs.gentoo.org/625396
    - python_export_utf8_locale
    -
    # https://bugs.gentoo.org/721786
    export BOOST_INCLUDEDIR="${BOOST_INCLUDEDIR-${EPREFIX}/usr/include}"
    export BOOST_LIBRARYDIR="${BOOST_LIBRARYDIR-${EPREFIX}/usr/$(get_libdir)}"
    @@ -412,6 +409,9 @@ meson_src_configure() {

    BUILD_DIR="${BUILD_DIR:-${WORKDIR}/${P}-build}"

    + # https://bugs.gentoo.org/625396
    + python_export_utf8_locale
    +
    (
    setup_meson_src_configure "$@"
    MESONARGS+=(
    --
    2.44.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Tue Mar 5 18:30:01 2024
    From: Eli Schwartz <[email protected]>

    The meson-python build backend -- as the name suggests -- uses meson
    under the hood. We have a meson eclass which does lots of useful things pertinent to meson. Make sure it gets invoked, by prying out the options
    that meson_src_configure would use and setting passing them as our seed
    values for gpep517.

    [sam: Tweak '=' style.]
    [sam: Tweak mesonargs->MESONARGS for final version of e9189344b971f7ee0e2bec36650c57dbade4f122.]
    [sam: Update local variable list.]
    [mgorny: Add local variables for LTO filtering.]

    Signed-off-by: Eli Schwartz <[email protected]>
    Signed-off-by: Sam James <[email protected]>
    Signed-off-by: Michał Górny <[email protected]>
    ---
    eclass/distutils-r1.eclass | 16 +++++++++++++++-
    1 file changed, 15 insertions(+), 1 deletion(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 134cb39f276a..e0c54d81a846 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -197,6 +197,10 @@ _DISTUTILS_R1_ECLASS=1
    inherit flag-o-matic
    inherit multibuild multilib multiprocessing ninja-utils toolchain-funcs

    +if [[ ${DISTUTILS_USE_PEP517} == meson-python ]]; then
    + inherit meson
    +fi
    +
    if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
    inherit python-r1
    else
    @@ -1386,9 +1390,19 @@ distutils_pep517_install() {
    )
    ;;
    meson-python)
    + # variables defined by setup_meson_src_configure
    + local MESONARGS=() BOOST_INCLUDEDIR BOOST_LIBRARYDIR NM READELF
    + # it also calls filter-lto
    + local x
    + for x in $(all-flag-vars); do
    + local -x "${x}=${!x}"
    + done
    +
    + setup_meson_src_configure "${DISTUTILS_ARGS[@]}"
    +
    local -x NINJAOPTS=$(get_NINJAOPTS)
    config_