Re: [gentoo-dev] Updating community maintained Gentoo Eclipse IDE repository ebuild to EAPI 7

2024-09-19 Thread James Stevenson
Hello,

If the current maintainer does not want to continue maintaining these, and
no one else volunteers to, then the overlay will just be removed.

Someone else would need to volunteer to maintain eclipse in a new
overlay/repo for updates to happen. Then potentially that new overlay will
be integrated into eselect-repository to replace the old one. It doesn't
sound like anyone is willing to do the maintenance on it though, so likely
the overlay will just be deleted.

All the best,
James

On Fri, 20 Sept 2024, 04:06 Kevin Brace,  wrote:

> Hi Sam,
>
> Okay, if I was not clear about what I wanted, I will try to clarify.
> I personally wanted the "sort of official" Eclipse IDE Gentoo overlay on
> GitHub to take up my updated EAPI 7 based ebuilds, but the only person I
> was able to contact  refused.
> I call the repository "sort of official" since it is still on the Gentoo
> wiki page. [1]
> I fixed the ebuild so I do not feel like it should be rejected by the
> developer, but it is what it is.
> Since this is what the situation is, I feel like the existing "sort of
> official" Eclipse IDE Gentoo overlay should be forked, and the updated
> ebuilds should be incorporated.
> Or, perhaps I can gain access to commit the updates to this repository,
> but I assume the people listed on the GitHub page probably will not allow
> that.
> I hope the explanation I wrote here makes sense.
> I was not aware of the alternative unofficial repository .
> I will take a look at it.
> That being said, the wiki page still has the now broken repository. [2]
> Something needs to be done to remedy the situation.
>
> Regards,
>
> Kevin Brace
> Brace Computer Laboratory blog
> https://bracecomputerlab.com
>
>
> [1]: https://wiki.gentoo.org/wiki/Eclipse
> [2]: https://github.com/gentoo/eclipse-overlay
>
>
> > Sent: Thursday, September 19, 2024 at 7:34 PM
> > From: "Sam James" 
> > To: "Kevin Brace" 
> > Cc: gentoo-dev@lists.gentoo.org
> > Subject: Re: [gentoo-dev] Updating community maintained Gentoo Eclipse
> IDE repository ebuild to EAPI 7
> >
> > Kevin Brace  writes:
> >
> > > Hi,
> > Hi,
> >
> > >
> > > I am a first time poster who just subscribed to the gentoo-dev mailing
> list.
> > > I installed Eclipse IDE 4.6 to one Gentoo Linux installation using the
> > > community maintained Eclipse IDE repository ebuild when Portage still
> > > supported EAPI 6, but the current release of Portage no longer does
> > > so.
> > > I have been increasingly annoyed by this community maintained Gentoo
> Eclipse IDE ebuild giving me weird warning type messages when running
> Portage.
> > > Of course, it does not stop Portage from running, but I do not like it
> aesthetically.
> > > The cause of the warning messages are that ebuilds are still at EAPI 5
> (for Eclipse IDE 4.5) and 6 (for Eclipse IDE 4.6), and they need to be
> updated to at least EAPI 7.
> > > I got so annoyed by this that I decided to take them into my own
> hands, and I managed to update ebuilds in question.
> > > I got rid of all the annoying messages displayed when running Portage,
> and it appears that Eclipse IDE installs fine.
> > > So I directly contacted one developer of the three still active on
> GitHub, but he refused to take up the ebuilds and update them.
> > > He does not seem to want to maintain the repository any longer (he
> > > appears to be disillusioned with the Eclipse IDE ebuilds they
> > > developed for some reason), and even suggested that a new community
> > > repository to be created to replace the now obsolete Eclipse IDE
> > > repository.
> > > This one I am talking about.
> > >
> > > https://github.com/gentoo/eclipse-overlay
> > >
> > > Personally, I really did not want to get involved in this type of OS
> > > infrastructure project because I work on totally different type of
> > > code development projects, but I feel like something has to be done to
> > > update the Eclipse IDE ebuilds to keep up with Portage.
> > > Let me know what more experienced Gentoo developers think.
> >
> > In general, packaging Java is pretty painful and everyone has migrated
> > to using just prebuilt jars for useful applications (like Eclipse).
> >
> > (See
> > e.g.
> https://lists.fedoraproject.org/archives/list/de...@lists.fedoraproject.org/thread/4EHBACT4I263R4QF75HB3DUJWWANGHAS/
> ,
> > and I think Chewi wrote a similar email at one point.)
> >
> > I'm not 100% clear what's being requested here:
> > * it def

Re: [gentoo-dev] Updating community maintained Gentoo Eclipse IDE repository ebuild to EAPI 7

2024-09-19 Thread Sam James
Kevin Brace  writes:

> Hi,
Hi,

>
> I am a first time poster who just subscribed to the gentoo-dev mailing list.
> I installed Eclipse IDE 4.6 to one Gentoo Linux installation using the
> community maintained Eclipse IDE repository ebuild when Portage still
> supported EAPI 6, but the current release of Portage no longer does
> so.
> I have been increasingly annoyed by this community maintained Gentoo Eclipse 
> IDE ebuild giving me weird warning type messages when running Portage.
> Of course, it does not stop Portage from running, but I do not like it 
> aesthetically.
> The cause of the warning messages are that ebuilds are still at EAPI 5 (for 
> Eclipse IDE 4.5) and 6 (for Eclipse IDE 4.6), and they need to be updated to 
> at least EAPI 7.
> I got so annoyed by this that I decided to take them into my own hands, and I 
> managed to update ebuilds in question.
> I got rid of all the annoying messages displayed when running Portage, and it 
> appears that Eclipse IDE installs fine.
> So I directly contacted one developer of the three still active on GitHub, 
> but he refused to take up the ebuilds and update them.
> He does not seem to want to maintain the repository any longer (he
> appears to be disillusioned with the Eclipse IDE ebuilds they
> developed for some reason), and even suggested that a new community
> repository to be created to replace the now obsolete Eclipse IDE
> repository.
> This one I am talking about.
>
> https://github.com/gentoo/eclipse-overlay
>
> Personally, I really did not want to get involved in this type of OS
> infrastructure project because I work on totally different type of
> code development projects, but I feel like something has to be done to
> update the Eclipse IDE ebuilds to keep up with Portage.
> Let me know what more experienced Gentoo developers think.

In general, packaging Java is pretty painful and everyone has migrated
to using just prebuilt jars for useful applications (like Eclipse).

(See
e.g. 
https://lists.fedoraproject.org/archives/list/de...@lists.fedoraproject.org/thread/4EHBACT4I263R4QF75HB3DUJWWANGHAS/,
and I think Chewi wrote a similar email at one point.)

I'm not 100% clear what's being requested here:
* it definitely looks like the eclipse overlay is pretty dead and
  should probably be removed from the repository list;
* we can consider requests if someone wants access to it (perhaps you!)
  to contribute fixed ebuilds to it, but it might just be better to make
  your own repository for that;
* there seem to be some newer ebuilds for eclipse in other repositories,
  see e.g. http://gpo.zugaina.org/Search?search=eclipse

>
> Regards,
>
> Kevin Brace
> Brace Computer Laboratory blog
> https://bracecomputerlab.com

thanks,
sam



Re: [gentoo-dev] [PATCH 1/3] [QA] fix .editorconfig

2024-09-19 Thread Sam James
Paul Zander  writes:

> This series of patches is meant as a basis to fix the .editorconfig used in 
> ::gentoo. Initial reason was that .patch
> files are being broken by the current version.
>
> trimming trailing whitespace breaks patches
>
> Signed-off-by: Paul Zander 
> ---
>  .editorconfig | 6 ++
>  1 file changed, 6 insertions(+)
>
> diff --git a/.editorconfig b/.editorconfig
> index 7d6e17345e1..f2cd7328e57 100644
> --- a/.editorconfig
> +++ b/.editorconfig
> @@ -1,3 +1,6 @@
> +# Copyright 1999-2024 Gentoo Authors
> +# Distributed under the terms of the GNU General Public License v2
> +
>  # https://editorconfig.org/
>  root = true
>  
> @@ -9,3 +12,6 @@ indent_style = tab
>  indent_size = 4
>  trim_trailing_whitespace = true
>  #max_line_length = 80
> +
> +[*.patch]
> +trim_trailing_whitespace = false

This first patch is OK and I'll pull it in. The others need to be respun
with commit messages describing it.



Re: [gentoo-dev] [PATCH] profiles/targets/desktop: make USE=qml default for more than just plasma

2024-09-10 Thread Sam James
Eli Schwartz  writes:

> Installing random applications tends to drag in qml requirements, as it
> is a pivotal part of the Qt technology stack required by other
> components. One quickly ends up in USE flag resolution hell when trying
> to select it on a per-package basis for most use cases other than having
> Qt installed solely for an isolated application.
>
> For average desktop use it makes sense to simply default it to on.
> People can always disable it manually if they want, but it basically
> just adds a single package (qtdeclarative) as a dep to your Qt stack.
>

Yes, please do. Especially given Ionen said he was OK with it (IIRC)
and asturm acked it.

> Signed-off-by: Eli Schwartz 
> ---
>  profiles/targets/desktop/make.defaults| 2 +-
>  profiles/targets/desktop/plasma/make.defaults | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/profiles/targets/desktop/make.defaults 
> b/profiles/targets/desktop/make.defaults
> index 72e77543df12..02e4f168b0a1 100644
> --- a/profiles/targets/desktop/make.defaults
> +++ b/profiles/targets/desktop/make.defaults
> @@ -1,4 +1,4 @@
>  # Copyright 1999-2024 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  
> -USE="a52 aac acpi alsa bluetooth branding cairo cdda cdr cups dbus
> dri dts dvd dvdr elogind encode exif flac gif gpm gtk gui icu jpeg
> kf6compat lcms libnotify mad mng mp3 mp4 mpeg ogg opengl pango pdf png
> policykit ppds qt6 qt5 sdl sound spell startup-notification svg tiff
> truetype vorbis udev udisks unicode upower usb vulkan wxwidgets X xcb
> xft x264 xml xv xvid"
> +USE="a52 aac acpi alsa bluetooth branding cairo cdda cdr cups dbus
> dri dts dvd dvdr elogind encode exif flac gif gpm gtk gui icu jpeg
> kf6compat lcms libnotify mad mng mp3 mp4 mpeg ogg opengl pango pdf png
> policykit ppds qml qt6 qt5 sdl sound spell startup-notification svg
> tiff truetype vorbis udev udisks unicode upower usb vulkan wxwidgets X
> xcb xft x264 xml xv xvid"
> diff --git a/profiles/targets/desktop/plasma/make.defaults 
> b/profiles/targets/desktop/plasma/make.defaults
> index 62e625bbfdcb..7f42ef98fc5b 100644
> --- a/profiles/targets/desktop/plasma/make.defaults
> +++ b/profiles/targets/desktop/plasma/make.defaults
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2023 Gentoo Authors
> +# Copyright 1999-2024 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  
> -USE="activities declarative dri kde kwallet networkmanager pipewire plasma 
> policykit pulseaudio qml screencast semantic-desktop wayland widgets"
> +USE="activities declarative dri kde kwallet networkmanager pipewire plasma 
> policykit pulseaudio screencast semantic-desktop wayland widgets"


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH 44/44] xdg-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/xdg-utils.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index 34535a129e334..84f88eee18fce 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2023 Gentoo Authors
+# Copyright 2004-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg-utils.eclass
@@ -18,7 +18,11 @@
 #  * XDG mime information database management
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 43/44] xdg.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/xdg.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/xdg.eclass b/eclass/xdg.eclass
index 14c56047af451..6af4b91875fc6 100644
--- a/eclass/xdg.eclass
+++ b/eclass/xdg.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: xdg.eclass
@@ -13,14 +13,18 @@
 # Utility eclass to update the desktop, icon and shared mime info as laid
 # out in the freedesktop specs & implementations
 
+if [[ -z ${_XDG_ECLASS} ]]; then
+_XDG_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_XDG_ECLASS} ]]; then
-_XDG_ECLASS=1
-
 inherit xdg-utils
 
 # Avoid dependency loop as both depend on glib-2
-- 
2.46.0




[gentoo-dev] [PATCH 42/44] wrapper.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/wrapper.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/wrapper.eclass b/eclass/wrapper.eclass
index 8d3d273d81c65..a62bb51d0fe71 100644
--- a/eclass/wrapper.eclass
+++ b/eclass/wrapper.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: wrapper.eclass
@@ -7,15 +7,19 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: create a shell wrapper script
 
+if [[ -z ${_WRAPPER_ECLASS} ]]; then
+_WRAPPER_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_WRAPPER_ECLASS} ]]; then
-_WRAPPER_ECLASS=1
-
-# @FUNCTION: make_wrapper
+# FUNCTION: make_wrapper
 # @USAGE:   [chdir] [libpaths] [installpath]
 # @DESCRIPTION:
 # Create a shell wrapper script named wrapper in installpath
-- 
2.46.0




[gentoo-dev] [PATCH 41/44] webapp.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/webapp.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/webapp.eclass b/eclass/webapp.eclass
index 5b091c84851ff..e8bc127e1b96c 100644
--- a/eclass/webapp.eclass
+++ b/eclass/webapp.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: webapp.eclass
@@ -10,14 +10,18 @@
 # The webapp eclass contains functions to handle web applications with
 # webapp-config. Part of the implementation of GLEP #11
 
+if [[ -z ${_WEBAPP_ECLASS} ]]; then
+_WEBAPP_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_WEBAPP_ECLASS} ]]; then
-_WEBAPP_ECLASS=1
-
 # @ECLASS_VARIABLE: WEBAPP_DEPEND
 # @DESCRIPTION:
 # An ebuild should use WEBAPP_DEPEND if a custom DEPEND needs to be built, most
-- 
2.46.0




[gentoo-dev] [PATCH 40/44] virtualx.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/virtualx.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
index f7318eafc59e7..07d303899582e 100644
--- a/eclass/virtualx.eclass
+++ b/eclass/virtualx.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: virtualx.eclass
@@ -9,14 +9,18 @@
 # @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: This eclass can be used for packages that need a working X 
environment to build.
 
+if [[ -z ${_VIRTUALX_ECLASS} ]]; then
+_VIRTUALX_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VIRTUALX_ECLASS} ]]; then
-_VIRTUALX_ECLASS=1
-
 # @ECLASS_VARIABLE: VIRTUALX_REQUIRED
 # @PRE_INHERIT
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 39/44] vim-spell.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/vim-spell.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/vim-spell.eclass b/eclass/vim-spell.eclass
index 607771ae8035d..57bcb0dc8021b 100644
--- a/eclass/vim-spell.eclass
+++ b/eclass/vim-spell.eclass
@@ -62,14 +62,18 @@
 # spell files. It's best to let upstream know if you've generated spell files
 # for another language rather than keeping them Gentoo-specific.
 
+if [[ -z ${_VIM_SPELL_ECLASS} ]] ; then
+_VIM_SPELL_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VIM_SPELL_ECLASS} ]] ; then
-_VIM_SPELL_ECLASS=1
-
 SRC_URI="mirror://gentoo/${P}.tar.bz2"
 SLOT="0"
 
-- 
2.46.0




[gentoo-dev] [PATCH 38/44] vim-plugin.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/vim-plugin.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/vim-plugin.eclass b/eclass/vim-plugin.eclass
index ee4f1b6e0f813..b2ae0cb9e4c33 100644
--- a/eclass/vim-plugin.eclass
+++ b/eclass/vim-plugin.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vim-plugin.eclass
@@ -12,14 +12,18 @@
 # which is read automatically by vim.  The only exception is
 # documentation, for which we make a special case via vim-doc.eclass.
 
+if [[ -z ${_VIM_PLUGIN_ECLASS} ]]; then
+_VIM_PLUGIN_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VIM_PLUGIN_ECLASS} ]]; then
-_VIM_PLUGIN_ECLASS=1
-
 inherit vim-doc
 
 [[ ${EAPI} != [67] ]] && _DEFINE_VIM_PLUGIN_SRC_PREPARE=true
-- 
2.46.0




[gentoo-dev] [PATCH 37/44] vim-doc.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/vim-doc.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/vim-doc.eclass b/eclass/vim-doc.eclass
index 119ce793071d6..f20f7397cf65b 100644
--- a/eclass/vim-doc.eclass
+++ b/eclass/vim-doc.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vim-doc.eclass
@@ -16,13 +16,17 @@
 # DEPEND in vim-plugin or by whatever version of vim is being
 # installed by the eclass.
 
+if [[ ! ${_VIM_DOC_ECLASS} ]] ; then
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_VIM_DOC_ECLASS} ]] ; then
-
 # @FUNCTION: update_vim_helptags
 # @USAGE:
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 36/44] vcs-clean.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/vcs-clean.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/vcs-clean.eclass b/eclass/vcs-clean.eclass
index e4c61ac7164ac..719bdec17676b 100644
--- a/eclass/vcs-clean.eclass
+++ b/eclass/vcs-clean.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: vcs-clean.eclass
@@ -9,14 +9,18 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: helper functions to remove VCS directories
 
+if [[ -z ${_VCS_CLEAN_ECLASS} ]] ; then
+_VCS_CLEAN_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_VCS_CLEAN_ECLASS} ]] ; then
-_VCS_CLEAN_ECLASS=1
-
 # @FUNCTION: ecvs_clean
 # @USAGE: [list of dirs]
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 35/44] udev.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/udev.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/udev.eclass b/eclass/udev.eclass
index ac94f98221aad..7fd99cbba8b06 100644
--- a/eclass/udev.eclass
+++ b/eclass/udev.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: udev.eclass
@@ -36,14 +36,18 @@
 # }
 # @CODE
 
+if [[ -z ${_UDEV_ECLASS} ]]; then
+_UDEV_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_UDEV_ECLASS} ]]; then
-_UDEV_ECLASS=1
-
 inherit toolchain-funcs
 
 if [[ ${EAPI} == [56] ]]; then
-- 
2.46.0




[gentoo-dev] [PATCH 34/44] toolchain-funcs.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/toolchain-funcs.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 5e36fa275dcd0..66819996ea33b 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -13,14 +13,18 @@
 # in such a way that you can rely on the function always returning
 # something sane.
 
+if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
+_TOOLCHAIN_FUNCS_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_TOOLCHAIN_FUNCS_ECLASS} ]]; then
-_TOOLCHAIN_FUNCS_ECLASS=1
-
 inherit multilib
 
 # tc-getPROG   [tuple]
-- 
2.46.0




[gentoo-dev] [PATCH 33/44] tmpfiles.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/tmpfiles.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/tmpfiles.eclass b/eclass/tmpfiles.eclass
index 39650401a6a0f..63889a275fef5 100644
--- a/eclass/tmpfiles.eclass
+++ b/eclass/tmpfiles.eclass
@@ -1,4 +1,4 @@
-# Copyright 2016-2022 Gentoo Authors
+# Copyright 2016-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: tmpfiles.eclass
@@ -55,9 +55,13 @@
 if [[ -z ${_TMPFILES_ECLASS} ]]; then
 _TMPFILES_ECLASS=1
 
-case "${EAPI}" in
-5|6|7|8) ;;
-*) die "API is undefined for EAPI ${EAPI}" ;;
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 # @ECLASS_VARIABLE: TMPFILES_OPTIONAL
-- 
2.46.0




[gentoo-dev] [PATCH 32/44] systemd.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/systemd.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
index 03d6a82fd3103..a5f0decde1e35 100644
--- a/eclass/systemd.eclass
+++ b/eclass/systemd.eclass
@@ -1,4 +1,4 @@
-# Copyright 2011-2023 Gentoo Authors
+# Copyright 2011-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: systemd.eclass
@@ -25,7 +25,11 @@
 # @CODE
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 31/44] strip-linguas.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/strip-linguas.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/strip-linguas.eclass b/eclass/strip-linguas.eclass
index 718341b4a6264..b31f414c87c31 100644
--- a/eclass/strip-linguas.eclass
+++ b/eclass/strip-linguas.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2021 Gentoo Authors
+# Copyright 2004-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: strip-linguas.eclass
@@ -9,15 +9,19 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: convenience function for LINGUAS support
 
+if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
+_STRIP_LINGUAS_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_STRIP_LINGUAS_ECLASS} ]]; then
-_STRIP_LINGUAS_ECLASS=1
-
-# @FUNCTION: strip-linguas
+# FUNCTION: strip-linguas
 # @USAGE: [|<-i|-u> ]
 # @DESCRIPTION:
 # Make sure that LINGUAS only contains languages that a package can
-- 
2.46.0




[gentoo-dev] [PATCH 30/44] ruby-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/ruby-utils.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass
index 789f57ce25f6a..48a25114b396b 100644
--- a/eclass/ruby-utils.eclass
+++ b/eclass/ruby-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-utils.eclass
@@ -15,13 +15,17 @@
 # This eclass does not set any metadata variables nor export any phase
 # functions. It can be inherited safely.
 
-case ${EAPI:-0} in
-   [5678]) ;;
+if [[ ! ${_RUBY_UTILS} ]]; then
+
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_RUBY_UTILS} ]]; then
-
 # @ECLASS_VARIABLE: RUBY_TARGETS_PREFERENCE
 # @INTERNAL
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 29/44] ruby-ng.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/ruby-ng.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/ruby-ng.eclass b/eclass/ruby-ng.eclass
index d80ae96dd40bc..2ef6d22474351 100644
--- a/eclass/ruby-ng.eclass
+++ b/eclass/ruby-ng.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-ng.eclass
@@ -67,7 +67,11 @@
 # passed to "grep -E" to remove reporting of these shared objects.
 
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 28/44] ruby-fakegem.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/ruby-fakegem.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index 40ff76ce900e0..04099a82ef4fd 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: ruby-fakegem.eclass
@@ -139,7 +139,11 @@ RUBY_FAKEGEM_BINDIR="${RUBY_FAKEGEM_BINDIR-bin}"
 RUBY_FAKEGEM_EXTENSION_LIBDIR="${RUBY_FAKEGEM_EXTENSION_LIBDIR-lib}"
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 27/44] readme.gentoo-r1.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/readme.gentoo-r1.eclass | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/eclass/readme.gentoo-r1.eclass b/eclass/readme.gentoo-r1.eclass
index 48023d9c049f8..3d2d8244687c7 100644
--- a/eclass/readme.gentoo-r1.eclass
+++ b/eclass/readme.gentoo-r1.eclass
@@ -21,7 +21,11 @@ if [[ -z ${_README_GENTOO_ECLASS} ]]; then
 _README_GENTOO_ECLASS=1
 
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 26/44] preserve-libs.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/preserve-libs.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/preserve-libs.eclass b/eclass/preserve-libs.eclass
index 35c65ef4436f9..38571447b945d 100644
--- a/eclass/preserve-libs.eclass
+++ b/eclass/preserve-libs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: preserve-libs.eclass
@@ -7,14 +7,18 @@
 # @SUPPORTED_EAPIS: 5 6 7 8
 # @BLURB: preserve libraries after SONAME changes
 
+if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
+_PRESERVE_LIBS_ECLASS=1
+
 case ${EAPI} in
-   5|6|7|8) ;;
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_PRESERVE_LIBS_ECLASS} ]]; then
-_PRESERVE_LIBS_ECLASS=1
-
 # @FUNCTION: preserve_old_lib
 # @USAGE:  [more libs]
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 25/44] prefix.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/prefix.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/prefix.eclass b/eclass/prefix.eclass
index 8d50d0ba7b6e1..e968e8ae8bac7 100644
--- a/eclass/prefix.eclass
+++ b/eclass/prefix.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: prefix.eclass
@@ -12,14 +12,18 @@
 # located somewhere in the filesystem.  Prefix ebuilds require
 # additional functions and variables which are defined by this eclass.
 
-case ${EAPI:-0} in
-   [5678]) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ -z ${_PREFIX_ECLASS} ]]; then
 _PREFIX_ECLASS=1
 
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 # @ECLASS_VARIABLE: EPREFIX
 # @DESCRIPTION:
 # The offset prefix of a Gentoo Prefix installation.  When Gentoo Prefix
-- 
2.46.0




[gentoo-dev] [PATCH 24/44] portability.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/portability.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/portability.eclass b/eclass/portability.eclass
index 78da440e22ddb..926ac8b8b825f 100644
--- a/eclass/portability.eclass
+++ b/eclass/portability.eclass
@@ -9,14 +9,18 @@
 # @SUPPORTED_EAPIS: 6 7 8
 # @BLURB: This eclass is created to avoid using non-portable GNUisms inside 
ebuilds
 
+if [[ -z ${_PORTABILITY_ECLASS} ]]; then
+_PORTABILITY_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_PORTABILITY_ECLASS} ]]; then
-_PORTABILITY_ECLASS=1
-
 # @FUNCTION: treecopy
 # @USAGE:  [orig2 orig3 ] 
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 23/44] php-pear-r2.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/php-pear-r2.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/php-pear-r2.eclass b/eclass/php-pear-r2.eclass
index 9882c7dcc7004..567aa9a8144f3 100644
--- a/eclass/php-pear-r2.eclass
+++ b/eclass/php-pear-r2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: php-pear-r2.eclass
@@ -14,14 +14,18 @@
 # Note that this eclass doesn't handle dependencies of PEAR packages
 # on purpose; please use (R)DEPEND to define them correctly!
 
+if [[ -z ${_PHP_PEAR_R2_ECLASS} ]]; then
+_PHP_PEAR_R2_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_PHP_PEAR_R2_ECLASS} ]]; then
-_PHP_PEAR_R2_ECLASS=1
-
 RDEPEND=">=dev-php/pear-1.8.1"
 [[ ${EAPI} != [67] ]] && IDEPEND=">=dev-php/pear-1.8.1"
 
-- 
2.46.0




[gentoo-dev] [PATCH 22/44] perl-functions.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/perl-functions.eclass | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/eclass/perl-functions.eclass b/eclass/perl-functions.eclass
index 142fdeb8cfbd0..d2b6cfb85f734 100644
--- a/eclass/perl-functions.eclass
+++ b/eclass/perl-functions.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: perl-functions.eclass
@@ -17,11 +17,12 @@
 # global scope.
 
 case ${EAPI} in
-   7|8)
-   ;;
-   *)
-   die "${ECLASS}: EAPI ${EAPI:-0} not supported"
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 [[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
-- 
2.46.0




[gentoo-dev] [PATCH 21/44] pax-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/pax-utils.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/pax-utils.eclass b/eclass/pax-utils.eclass
index 3830f03df3419..a7144278fd9a4 100644
--- a/eclass/pax-utils.eclass
+++ b/eclass/pax-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: pax-utils.eclass
@@ -21,14 +21,18 @@
 # To control what markings are made, set PAX_MARKINGS in /etc/portage/make.conf
 # to contain either "PT", "XT" or "none".  The default is none
 
-case ${EAPI:-0} in
-   5|6|7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ -z ${_PAX_UTILS_ECLASS} ]]; then
 _PAX_UTILS_ECLASS=1
 
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 # @ECLASS_VARIABLE: PAX_MARKINGS
 # @DESCRIPTION:
 # Control which markings are made:
-- 
2.46.0




[gentoo-dev] [PATCH 20/44] out-of-source-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/out-of-source-utils.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/out-of-source-utils.eclass 
b/eclass/out-of-source-utils.eclass
index d68b210889951..55a88127ca711 100644
--- a/eclass/out-of-source-utils.eclass
+++ b/eclass/out-of-source-utils.eclass
@@ -1,4 +1,4 @@
-# Copyright 2022-2023 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: out-of-source-utils.eclass
@@ -12,14 +12,18 @@
 # This eclass provides a run_in_build_dir() helper that can be used
 # to execute specified command inside BUILD_DIR.
 
+if [[ ! ${_OUT_OF_SOURCE_UTILS_ECLASS} ]]; then
+_OUT_OF_SOURCE_UTILS_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_OUT_OF_SOURCE_UTILS_ECLASS} ]]; then
-_OUT_OF_SOURCE_UTILS_ECLASS=1
-
 # @FUNCTION: run_in_build_dir
 # @USAGE: ...
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 19/44] multiprocessing.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/multiprocessing.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass
index 13d6a92f2f2e5..f9627de26c3b9 100644
--- a/eclass/multiprocessing.eclass
+++ b/eclass/multiprocessing.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multiprocessing.eclass
@@ -24,14 +24,18 @@
 # }
 # @CODE
 
-case ${EAPI:-0} in
-   [5678]) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ -z ${_MULTIPROCESSING_ECLASS} ]]; then
 _MULTIPROCESSING_ECLASS=1
 
+case ${EAPI} in
+   5|6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 # @FUNCTION: get_nproc
 # @USAGE: [${fallback:-1}]
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 18/44] multilib-minimal.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/multilib-minimal.eclass | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/eclass/multilib-minimal.eclass b/eclass/multilib-minimal.eclass
index 92968b6cf2137..c84fb3781a975 100644
--- a/eclass/multilib-minimal.eclass
+++ b/eclass/multilib-minimal.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multilib-minimal.eclass
@@ -23,16 +23,21 @@
 #
 # If you need generic install rules, use multilib_src_install_all function.
 
-case ${EAPI} in
-   6|7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 inherit multilib-build
 
 if [[ ! ${_MULTILIB_MINIMAL_ECLASS} ]]; then
 _MULTILIB_MINIMAL_ECLASS=1
 
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+
 multilib-minimal_src_configure() {
debug-print-function ${FUNCNAME} "$@"
 
-- 
2.46.0




[gentoo-dev] [PATCH 17/44] multilib.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/multilib.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index bf9c88f7e6a4e..eca8c02d8336c 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multilib.eclass
@@ -9,14 +9,18 @@
 # @DESCRIPTION:
 # This eclass is for all functions pertaining to handling multilib 
configurations.
 
+if [[ -z ${_MULTILIB_ECLASS} ]]; then
+_MULTILIB_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_MULTILIB_ECLASS} ]]; then
-_MULTILIB_ECLASS=1
-
 inherit toolchain-funcs
 
 # Defaults:
-- 
2.46.0




[gentoo-dev] [PATCH 16/44] multilib-build.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/multilib-build.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
index 1774ad057430b..22c4a8bb30489 100644
--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -1,4 +1,4 @@
-# Copyright 2013-2023 Gentoo Authors
+# Copyright 2013-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multilib-build.eclass
@@ -17,14 +17,18 @@
 # dependencies shall use the USE dependency string in ${MULTILIB_USEDEP}
 # to properly request multilib enabled.
 
+if [[ -z ${_MULTILIB_BUILD_ECLASS} ]]; then
+_MULTILIB_BUILD_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_MULTILIB_BUILD_ECLASS} ]]; then
-_MULTILIB_BUILD_ECLASS=1
-
 inherit multibuild multilib
 
 # @ECLASS_VARIABLE: _MULTILIB_FLAGS
-- 
2.46.0




[gentoo-dev] [PATCH 15/44] multibuild.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/multibuild.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index f15d3327c7dd2..0677ea346e4ce 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: multibuild.eclass
@@ -13,17 +13,21 @@
 # multiple 'variants' of a package (e.g. multilib, Python
 # implementations).
 
+if [[ ! ${_MULTIBUILD_ECLASS} ]]; then
+_MULTIBUILD_ECLASS=1
+
 case ${EAPI} in
-   6|7|8)
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8)
# backwards compatibility for run_in_build_dir
inherit out-of-source-utils
;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ ! ${_MULTIBUILD_ECLASS} ]]; then
-_MULTIBUILD_ECLASS=1
-
 # @ECLASS_VARIABLE: MULTIBUILD_VARIANTS
 # @REQUIRED
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 14/44] mono-env.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/mono-env.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/mono-env.eclass b/eclass/mono-env.eclass
index 48712587ff3ed..02bd7e8dd9bee 100644
--- a/eclass/mono-env.eclass
+++ b/eclass/mono-env.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: mono-env.eclass
@@ -9,14 +9,18 @@
 # @DESCRIPTION:
 # Set environment variables commonly used by dotnet packages.
 
+if [[ -z ${_MONO_ENV_ECLASS} ]] ; then
+_MONO_ENV_ECLASS=1
+
 case ${EAPI} in
-   6|7) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_MONO_ENV_ECLASS} ]] ; then
-_MONO_ENV_ECLASS=1
-
 SRC_URI="http://download.mono-project.com/sources/${PN}/${P}.tar.bz2";
 
 mono-env_pkg_setup() {
-- 
2.46.0




[gentoo-dev] [PATCH 13/44] libtool.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/libtool.eclass | 9 +
 1 file changed, 9 insertions(+)

diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass
index bd6141e1ede93..b36b1fd365d3b 100644
--- a/eclass/libtool.eclass
+++ b/eclass/libtool.eclass
@@ -17,6 +17,15 @@
 if [[ -z ${_LIBTOOL_ECLASS} ]]; then
 _LIBTOOL_ECLASS=1
 
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 case ${EAPI} in
6) DEPEND=">=app-portage/elt-patches-20240116" ;;
7|8) BDEPEND=">=app-portage/elt-patches-20240116" ;;
-- 
2.46.0




[gentoo-dev] [PATCH 12/44] java-utils-2.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/java-utils-2.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 647f25e2c9870..6bf6b7788aa59 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -17,14 +17,18 @@
 # that have optional Java support. In addition you can inherit java-ant-2 for
 # Ant-based packages.
 
+if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
+_JAVA_UTILS_2_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
-_JAVA_UTILS_2_ECLASS=1
-
 # EAPI 7 has version functions built-in. Use eapi7-ver for all earlier EAPIs.
 # Keep versionator inheritance in case consumers are using it implicitly.
 [[ ${EAPI} == 6 ]] && inherit eapi7-ver eqawarn multilib versionator
-- 
2.46.0




[gentoo-dev] [PATCH 11/44] java-pkg-2.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/java-pkg-2.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/java-pkg-2.eclass b/eclass/java-pkg-2.eclass
index df024bbadf51f..6da4efd222c22 100644
--- a/eclass/java-pkg-2.eclass
+++ b/eclass/java-pkg-2.eclass
@@ -13,14 +13,18 @@
 # This eclass should be inherited for pure Java packages, or by packages which
 # need to use Java.
 
+if [[ -z ${_JAVA_PKG_2_ECLASS} ]] ; then
+_JAVA_PKG_2_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_JAVA_PKG_2_ECLASS} ]] ; then
-_JAVA_PKG_2_ECLASS=1
-
 inherit java-utils-2
 
 # @ECLASS_VARIABLE: JAVA_PKG_IUSE
-- 
2.46.0




[gentoo-dev] [PATCH 10/44] gnuconfig.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/gnuconfig.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/gnuconfig.eclass b/eclass/gnuconfig.eclass
index fb73087aeacf4..afcb8feee04ef 100644
--- a/eclass/gnuconfig.eclass
+++ b/eclass/gnuconfig.eclass
@@ -16,14 +16,18 @@
 # other files that come with automake, e.g. depcomp, mkinstalldirs, etc.
 #
 
-case ${EAPI:-0} in
-   6|7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ -z ${_GNUCONFIG_ECLASS} ]] ; then
  _GNUCONFIG_CLASS=1
 
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 # @ECLASS_VARIABLE: GNUCONFIG_DEPEND
 # @OUTPUT_VARIABLE
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 09/44] fortran-2.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/fortran-2.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/fortran-2.eclass b/eclass/fortran-2.eclass
index 855dcba59a390..5e2ce1fc68e48 100644
--- a/eclass/fortran-2.eclass
+++ b/eclass/fortran-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: fortran-2.eclass
@@ -26,14 +26,18 @@
 #
 # FORTRAN_NEED_OPENMP=1
 
+if [[ -z ${_FORTRAN_2_ECLASS} ]]; then
+_FORTRAN_2_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_FORTRAN_2_ECLASS} ]]; then
-_FORTRAN_2_ECLASS=1
-
 inherit toolchain-funcs
 
 # @ECLASS_VARIABLE: FORTRAN_NEED_OPENMP
-- 
2.46.0




[gentoo-dev] [PATCH 08/44] flag-o-matic.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/flag-o-matic.eclass | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index c6b1ad80e12eb..02cd2dcfc5926 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -10,14 +10,18 @@
 # This eclass contains a suite of functions to help developers sanely
 # and safely manage toolchain flags in their builds.
 
+if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then
+_FLAG_O_MATIC_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_FLAG_O_MATIC_ECLASS} ]]; then
-_FLAG_O_MATIC_ECLASS=1
-
 inherit toolchain-funcs
 
 [[ ${EAPI} == 6 ]] && inherit eqawarn
-- 
2.46.0




[gentoo-dev] [PATCH 07/44] desktop.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/desktop.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/desktop.eclass b/eclass/desktop.eclass
index 780971342ba1e..144514c8f7c27 100644
--- a/eclass/desktop.eclass
+++ b/eclass/desktop.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: desktop.eclass
@@ -8,7 +8,11 @@
 # @BLURB: support for desktop files, menus, and icons
 
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 06/44] depend.apache.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/depend.apache.eclass | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/eclass/depend.apache.eclass b/eclass/depend.apache.eclass
index 8f0469931d2c7..60926c298f042 100644
--- a/eclass/depend.apache.eclass
+++ b/eclass/depend.apache.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: depend.apache.eclass
@@ -40,12 +40,13 @@
 # }
 # @CODE
 
-case ${EAPI:-0} in
-   6|7|8)
-   ;;
-   *)
-   die "EAPI=${EAPI} is not supported by depend.apache.eclass"
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 # 
==
-- 
2.46.0




[gentoo-dev] [PATCH 05/44] check-reqs.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/check-reqs.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index fac2f4553d746..02ff61187c455 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2023 Gentoo Authors
+# Copyright 2004-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: check-reqs.eclass
@@ -38,14 +38,18 @@
 # These checks should probably mostly work on non-Linux, and they should
 # probably degrade gracefully if they don't. Probably.
 
+if [[ -z ${_CHECK_REQS_ECLASS} ]]; then
+_CHECK_REQS_ECLASS=1
+
 case ${EAPI} in
-   6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-if [[ -z ${_CHECK_REQS_ECLASS} ]]; then
-_CHECK_REQS_ECLASS=1
-
 # @ECLASS_VARIABLE: CHECKREQS_MEMORY
 # @DEFAULT_UNSET
 # @DESCRIPTION:
-- 
2.46.0




[gentoo-dev] [PATCH 04/44] cdrom.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/cdrom.eclass | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/eclass/cdrom.eclass b/eclass/cdrom.eclass
index 4e56db9511960..4f7ba663bebaf 100644
--- a/eclass/cdrom.eclass
+++ b/eclass/cdrom.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: cdrom.eclass
@@ -15,14 +15,18 @@
 # eclass will require RESTRICT="bindist" but the point still stands.
 # The functions are generally called in src_unpack.
 
-case ${EAPI:-0} in
-   6|7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ -z ${_CDROM_ECLASS} ]]; then
 _CDROM_ECLASS=1
 
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 inherit portability
 
 # @ECLASS_VARIABLE: CDROM_OPTIONAL
-- 
2.46.0




[gentoo-dev] [PATCH 03/44] bash-completion-r1.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/bash-completion-r1.eclass | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/bash-completion-r1.eclass b/eclass/bash-completion-r1.eclass
index df1a2a54d39a8..be506793ae94b 100644
--- a/eclass/bash-completion-r1.eclass
+++ b/eclass/bash-completion-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: bash-completion-r1.eclass
@@ -29,7 +29,11 @@ _BASH_COMPLETION_R1_ECLASS=1
 inherit toolchain-funcs
 
 case ${EAPI} in
-   5|6|7|8) ;;
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.46.0




[gentoo-dev] [PATCH 02/44] autotools.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/autotools.eclass | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/eclass/autotools.eclass b/eclass/autotools.eclass
index 3c9e89bda90ed..0571b18ba5252 100644
--- a/eclass/autotools.eclass
+++ b/eclass/autotools.eclass
@@ -13,11 +13,6 @@
 # Note: We require GNU m4, as does autoconf.  So feel free to use any features
 # from the GNU version of m4 without worrying about other variants (i.e. BSD).
 
-case ${EAPI} in
-   6|7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
-
 if [[ ${_AUTOTOOLS_AUTO_DEPEND+set} == "set" ]] ; then
# See if we were included already, but someone changed the value
# of AUTOTOOLS_AUTO_DEPEND on us.  We could reload the entire
@@ -31,6 +26,15 @@ fi
 if [[ -z ${_AUTOTOOLS_ECLASS} ]] ; then
 _AUTOTOOLS_ECLASS=1
 
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 [[ ${EAPI} == 6 ]] && inherit eqawarn
 
 GNUCONFIG_AUTO_DEPEND=no
-- 
2.46.0




[gentoo-dev] [PATCH 01/44] apache-module.eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
Signed-off-by: Sam James 
---
 eclass/apache-module.eclass | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/eclass/apache-module.eclass b/eclass/apache-module.eclass
index 5a84ffedf71a0..07bdb79e08a27 100644
--- a/eclass/apache-module.eclass
+++ b/eclass/apache-module.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: apache-module.eclass
@@ -44,14 +44,19 @@
 # 
 # @CODE
 
-case ${EAPI} in
-   6|7|8) ;;
-   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
-esac
 
 if [[ -z ${_APACHE_MODULE_ECLASS} ]]; then
 _APACHE_MODULE_ECLASS=1
 
+case ${EAPI} in
+   6)
+   ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated 
EAPI ${EAPI}!"
+   ewarn "${CATEGORY}/${PF}: Support will be removed on 
2024-10-08. Please port to newer EAPI."
+   ;;
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 inherit depend.apache
 
 # 
==
-- 
2.46.0




[gentoo-dev] [PATCH 00/44] eclass: add global-scope ewarn for deprecated < EAPI 7

2024-09-08 Thread Sam James
The motivation here is to give users and casual ebuild authors a final
last warning before things are yanked out from under them, to make
Gentoo a bit less hostile to develop on without following the MLs
closely. While we want people to run e.g. pkgcheck, not everyone
is going to.

The global scope warning is noisy but all consumers in ::gentoo
are gone already and the noise will be there in 30 days once
the support is actually removed (as is already queued [0]) but with
no temporary workaround then.

For future EAPI deprecation cycles, we should consider warnings
in the package manager as well as maybe a better well-defined lifecycle
for EAPI support in eclasses, as it's currently very ad-hoc based on
when the last consumer is gone in ::gentoo per-eclass.

[0] https://github.com/gentoo/gentoo/pull/37652

Sam James (44):
  apache-module.eclass: add global-scope ewarn for deprecated < EAPI 7
  autotools.eclass: add global-scope ewarn for deprecated < EAPI 7
  bash-completion-r1.eclass: add global-scope ewarn for deprecated <
EAPI 7
  cdrom.eclass: add global-scope ewarn for deprecated < EAPI 7
  check-reqs.eclass: add global-scope ewarn for deprecated < EAPI 7
  depend.apache.eclass: add global-scope ewarn for deprecated < EAPI 7
  desktop.eclass: add global-scope ewarn for deprecated < EAPI 7
  flag-o-matic.eclass: add global-scope ewarn for deprecated < EAPI 7
  fortran-2.eclass: add global-scope ewarn for deprecated < EAPI 7
  gnuconfig.eclass: add global-scope ewarn for deprecated < EAPI 7
  java-pkg-2.eclass: add global-scope ewarn for deprecated < EAPI 7
  java-utils-2.eclass: add global-scope ewarn for deprecated < EAPI 7
  libtool.eclass: add global-scope ewarn for deprecated < EAPI 7
  mono-env.eclass: add global-scope ewarn for deprecated < EAPI 7
  multibuild.eclass: add global-scope ewarn for deprecated < EAPI 7
  multilib-build.eclass: add global-scope ewarn for deprecated < EAPI 7
  multilib.eclass: add global-scope ewarn for deprecated < EAPI 7
  multilib-minimal.eclass: add global-scope ewarn for deprecated < EAPI
7
  multiprocessing.eclass: add global-scope ewarn for deprecated < EAPI 7
  out-of-source-utils.eclass: add global-scope ewarn for deprecated <
EAPI 7
  pax-utils.eclass: add global-scope ewarn for deprecated < EAPI 7
  perl-functions.eclass: add global-scope ewarn for deprecated < EAPI 7
  php-pear-r2.eclass: add global-scope ewarn for deprecated < EAPI 7
  portability.eclass: add global-scope ewarn for deprecated < EAPI 7
  prefix.eclass: add global-scope ewarn for deprecated < EAPI 7
  preserve-libs.eclass: add global-scope ewarn for deprecated < EAPI 7
  readme.gentoo-r1.eclass: add global-scope ewarn for deprecated < EAPI
7
  ruby-fakegem.eclass: add global-scope ewarn for deprecated < EAPI 7
  ruby-ng.eclass: add global-scope ewarn for deprecated < EAPI 7
  ruby-utils.eclass: add global-scope ewarn for deprecated < EAPI 7
  strip-linguas.eclass: add global-scope ewarn for deprecated < EAPI 7
  systemd.eclass: add global-scope ewarn for deprecated < EAPI 7
  tmpfiles.eclass: add global-scope ewarn for deprecated < EAPI 7
  toolchain-funcs.eclass: add global-scope ewarn for deprecated < EAPI 7
  udev.eclass: add global-scope ewarn for deprecated < EAPI 7
  vcs-clean.eclass: add global-scope ewarn for deprecated < EAPI 7
  vim-doc.eclass: add global-scope ewarn for deprecated < EAPI 7
  vim-plugin.eclass: add global-scope ewarn for deprecated < EAPI 7
  vim-spell.eclass: add global-scope ewarn for deprecated < EAPI 7
  virtualx.eclass: add global-scope ewarn for deprecated < EAPI 7
  webapp.eclass: add global-scope ewarn for deprecated < EAPI 7
  wrapper.eclass: add global-scope ewarn for deprecated < EAPI 7
  xdg.eclass: add global-scope ewarn for deprecated < EAPI 7
  xdg-utils.eclass: add global-scope ewarn for deprecated < EAPI 7

 eclass/apache-module.eclass   | 15 ++-
 eclass/autotools.eclass   | 14 +-
 eclass/bash-completion-r1.eclass  |  8 ++--
 eclass/cdrom.eclass   | 16 ++--
 eclass/check-reqs.eclass  | 14 +-
 eclass/depend.apache.eclass   | 13 +++--
 eclass/desktop.eclass |  8 ++--
 eclass/flag-o-matic.eclass| 12 
 eclass/fortran-2.eclass   | 14 +-
 eclass/gnuconfig.eclass   | 14 +-
 eclass/java-pkg-2.eclass  | 12 
 eclass/java-utils-2.eclass| 12 
 eclass/libtool.eclass |  9 +
 eclass/mono-env.eclass| 14 +-
 eclass/multibuild.eclass  | 14 +-
 eclass/multilib-build.eclass  | 14 +-
 eclass/multilib-minimal.eclass| 17 +++--
 eclass/multilib.eclass| 14 +-
 eclass/multiprocessing.eclass | 16

[gentoo-dev] [COMMITTED] kernel-build.eclass: call ctf_install for tests too

2024-09-03 Thread Sam James
As suggested by Andrew at 
https://github.com/gentoo/gentoo/pull/38392#discussion_r1741574357.

Signed-off-by: Sam James 
---
 eclass/kernel-build.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 1fc86c4a2208..3836bef1276b 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -321,7 +321,7 @@ kernel-build_src_test() {
 
emake O="${WORKDIR}"/build "${MAKEARGS[@]}" \
INSTALL_MOD_PATH="${T}" INSTALL_MOD_STRIP="${strip_args}" \
-   modules_install
+   modules_install ctf_install
 
kernel-install_test "${KV_FULL}" \
"${WORKDIR}/build/$(dist-kernel_get_image_path)" \
-- 
2.46.0




[gentoo-dev] [COMMITTED] kernel-build.eclass: handle CTF if enabled

2024-09-03 Thread Sam James
genpatches will soon be adding optional CTF debug information support
via a patch. If it's enabled, we need to call a few special make targets
to create and install the CTF information. We also need to avoid stripping
the CTF archive.

Signed-off-by: Sam James 
---
 eclass/kernel-build.eclass | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index 10fd0cca2cc5..1fc86c4a2208 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -296,7 +296,13 @@ kernel-build_src_configure() {
 kernel-build_src_compile() {
debug-print-function ${FUNCNAME} "${@}"
 
-   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" all
+   local targets=( all )
+
+   if grep -q "CONFIG_CTF=y" "${WORKDIR}/modprep/.config"; then
+   targets+=( ctf )
+   fi
+
+   emake O="${WORKDIR}"/build "${MAKEARGS[@]}" "${targets[@]}"
 }
 
 # @FUNCTION: kernel-build_src_test
@@ -337,6 +343,10 @@ kernel-build_src_install() {
targets+=( dtbs_install )
fi
 
+   if grep -q "CONFIG_CTF=y" "${WORKDIR}/modprep/.config"; then
+   targets+=( ctf_install )
+   fi
+
# Use the kernel build system to strip, this ensures the modules
# are stripped *before* they are signed or compressed.
local strip_args
@@ -430,6 +440,7 @@ kernel-build_src_install() {
mv "build/vmlinux" "${ED}${kernel_dir}/vmlinux" || die
fi
dostrip -x "${kernel_dir}/vmlinux"
+   dostrip -x "${kernel_dir}/vmlinux.ctfa"
fi
 
# strip empty directories
-- 
2.46.0




Re: [gentoo-dev] [RFC] News Item v2: KDE Plasma 6.1.4 and Gear 24.05.2 Upgrade

2024-08-31 Thread Sam James
Andreas Sturmlechner  writes:

> Title: KDE Plasma 6.1.4 and Gear 24.05.2 Upgrade
> Author: Andreas Sturmlechner 
> Posted: 2024-08-31
> Revision: 1
> News-Item-Format: 2.0
> Display-If-Installed: kde-plasma/plasma-workspace:5
>
> Reasons
> ===
>
> KDE Plasma 5 has reached end of life and is no longer supported by Gentoo.
> Qt5 upstream OSS support ended on 2020-12-08, and LTS releases - even with
> considerable effort by KDE community's backports on top - only go so far.
> It is therefore required for all users to upgrade to KDE Plasma 6[1].
>
> At the same time, KDE Gear 24.05.2 is provided with most applications ported
> over to KDE Frameworks 6. As long as KF5-based applications are being shipped
> with the KDE Gear bundle, and other non-KDE Qt5-based applications still
> common in ::gentoo repository, it is advised *not* to disable USE="qt5".
>
>
> Changes
> ===
>
> Not many - much like Qt6, this is mostly an evolution of the existing
> codebase, no disruptive feat.
>
> Plasma Wayland support has come a long way and therefore KDE developers have
> decided to make it the default login session for Plasma 6, even if some
> known papercuts[2] remain. For users affected too much by those, switching
> to the still existing X11 session is as easy as selecting it in the display
> manager of choice. Disabling USE="wayland" is *not* changing this default,
> it will yield no dependency savings, and we advise against doing so. It does
> not affect users' X11 sessions.
>
> In Gentoo:
>
> The 32-bit ~arm/arm keyword was inconsistent across KDE Plasma, KDE
> Frameworks, and KDE Gear, and has been dropped.
>
> The situation for x86 was similar to arm and test failures often blocked
> stabilization. Stable x86 has been dropped, ~x86 was dropped for KDE PIM,
> dev-util/kdevelop and any other dev-qt/qtwebengine:6 reverse dependencies.
>
>
> User Action Required
> 
>
> For users of a plasma profile[3], no specific upgrade steps are necessary,
> although some precautionary measures are advised before and during upgrade:
>
> - Switch to a standard (Breeze or Oxygen) theme
> - Depclean kde-misc/latte-dock, it is unfit for Plasma 6 (and masked already)
> - Cleanup sets and @world from any SLOT or version pinning of KDE packages
> - If possible, perform the upgrade not inside a running Plasma session
>
> Necessary USE flag changes were already made in plasma profile, therefore
> only users of other profiles should set USE="kf6compat qt6" globally[4].

"Users are recommended to run the following command (pretend-only) to identify 
packages
in @world which have been removed, to help reduce conflicts:

emerge -pev @world -backtrack=0

Then for any "no ebuild available" messages, either resolve it by making
the needed changes, or emerge --deselect them. Then proceed to the world
upgrade below.

>
> Once the packages become available on your arch, it should be as simple as
> update @world:
>
> emerge -aquUD @world
>
>
> [1] https://kde.org/plasma-desktop/
> [2] https://community.kde.org/Plasma/Wayland_Known_Significant_Issues
> [3] https://wiki.gentoo.org/wiki/KDE#Profile
> [4] https://wiki.gentoo.org/wiki//etc/portage/package.use


signature.asc
Description: PGP signature


Re: [gentoo-dev] [RFC] News Item: KDE Plasma 6.1.4 and Gear 24.05.2 Upgrade

2024-08-29 Thread Sam James
Andreas Sturmlechner  writes:

> Title: KDE Plasma 6.1.4 and Gear 24.05.2 Upgrade
> Author: Andreas Sturmlechner 
> Posted: 2024-08-31
> Revision: 1
> News-Item-Format: 2.0
> Display-If-Installed: kde-plasma/plasma-workspace:5
>
> Reasons
> ===
>
> KDE Plasma 5 has reached end of life and is no longer supported by Gentoo.
> Qt5 upstream OSS support ended on 2020-12-08, and LTS releases - even with
> considerable effort by KDE community's backports on top - only go so far.
> It is therefore required for all users to upgrade to KDE Plasma 6[1].
>
> At the same time, KDE Gear 24.05.2 is provided with most applications ported
> over to KDE Frameworks 6. As long as KF5-based applications are being shipped
> with the KDE Gear bundle, and other non-KDE Qt5-based applications still
> common in ::gentoo repository, it is advised *not* to disable USE="qt5".
>
>
> Changes
> ===
>
> Not many - much like Qt6, this is mostly an evolution of the existing
> codebase, no disruptive feat.
>
> Plasma Wayland support has come a long way and therefore KDE developers have
> decided to make it the default login session for Plasma 6, even if some
> known papercuts[2] remain. For users affected too much by those, switching
> to the still existing X11 session is as easy as selecting it in the display
> manager of choice. Disabling USE="wayland" is *not* changing this default,
> it will yield no dependency savings, and we advise against doing so. It does
> not affect users' X11 sessions.
>
> In Gentoo:

Let's rephrase this a bit.

> - arm 32-bit support is discontinued

"The 32-bit ~arm/arm keyword was inconsistent across KDE Plasma, KDE
Frameworks, and KDE Gear, and has been dropped."

> - x86 will not see stabilisation of Plasma 6 and KF6-based packages

"Like for arm, but to a lesser extent, the situation for x86 was
inconsistent and test failures often blocked stabliization."

This makes it sound less final and avoids the potential for
misunderstandings.

>
>
> User Action Required
> 
>
> For users of a plasma profile[3], no specific upgrade steps are necessary,
> although some precautionary measures are advised before and during upgrade:
>
> - Switch to a standard (Breeze or Oxygen) theme
> - Unmerge kde-misc/latte-dock, it is unfit for Plasma 6 (and masked already)

s/Unmerge/Depclean/, but weren't there others we should do as well? Or
maybe they're all handled?

Maybe we can recommend: emerge -pev @world --backtrack=0 and emerge
--deselecting any KDE-adjacent software which says "no ebuilds
available".

> - Cleanup sets and @world from any SLOT or version pinning of KDE packages
> - If possible, perform the upgrade not inside a running Plasma session
>
> Necessary USE flag changes were already made in plasma profile, therefore
> only users of other profiles should set USE="kf6compat qt6" globally[4].
>
> Once the packages become available on your arch, it should be as simple as
> update @world:
>
> emerge -aquvUD @world
>

-q and -v? (yes, this does work in Portage, but it looks odd...)

>
> [1] https://kde.org/plasma-desktop/
> [2] https://community.kde.org/Plasma/Wayland_Known_Significant_Issues
> [3] https://wiki.gentoo.org/wiki/KDE#Profile
> [4] https://wiki.gentoo.org/wiki//etc/portage/package.use



Re: [gentoo-dev] [PATCH 00/50] XXXXXX.eclass: drop support for EAPI6

2024-08-27 Thread Sam James
Eli Schwartz  writes:

> On 8/27/24 5:03 PM, Robin H. Johnson wrote:
>> There wasn't an introduction message to this series, but I wanted to
>> raise the discussion.
>> 
>> We only JUST got rid of the last EAPI6 ebuilds in the main tree.
>> 
>> There are overlays that still have EAPI6 ebuilds - and depend on these
>> ebuilds.
>> 
>> When is an expected time for all of those ebuilds to migrate, and how is
>> that being communicated?
>
>
> If we were removing an eclass that only supports EAPI 6 and is being
> dropped because it's useless, we'd last rite it and give people 30 days
> to move.
>
> But because the *file* isn't being removed, there is no rule how to do
> it apparently?? :D The obvious answer here is to stick an ewarn in the
> "if EAPI 6" branch at global scope.
>
>
> (It's a bit messy when doing dependency calculation. This too is a
> feature, if you think about it.)

Yes, it's something which has bothered me for a while. When we ratified
GLEP 83 [0], I wanted to come back to it for handling EAPI support
deprecation in "important" eclasses but I couldn't figure out a nice
definition for that and got distracted.

I actually *do* think we should do something here, but I will note
pkgcheck will have been warning about use of DeprecatedEapi at least.

[0] https://www.gentoo.org/glep/glep-0083.html



Re: [gentoo-dev] [PATCH 1/4] distutils-r1.eclass: Allow .jar files in sitedir

2024-08-25 Thread Sam James
Sam James  writes:

> Eli Schwartz  writes:
>
>> On 8/25/24 11:33 AM, Michał Górny wrote:
>>> Closes: https://bugs.gentoo.org/937642
>>> Signed-off-by: Michał Górny 
>>> ---
>>>  eclass/distutils-r1.eclass | 2 ++
>>>  1 file changed, 2 insertions(+)
>>> 
>>> diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
>>> index 0f9dc8d14d5e..39705c5c3c84 100644
>>> --- a/eclass/distutils-r1.eclass
>>> +++ b/eclass/distutils-r1.eclass
>>> @@ -2109,8 +2109,10 @@ _distutils-r1_post_python_install() {
>>> local strays=()
>>> local p
>>> mapfile -d $'\0' -t strays < <(
>>> +   # jar for jpype, https://bugs.gentoo.org/937642
>>> find "${sitedir}" -maxdepth 1 -type f '!' '(' \
>>> -name '*.egg-info' -o \
>>> +   -name '*.jar' -o \
>>> -name '*.pth' -o \
>>> -name '*.py' -o \
>>> -name '*.pyi' -o \
>>
>>
>> Copying my comment from the bug report:
>>
>> I don't think it makes sense to add a special exception for jar files.
>> If we think that packages may be legitimately storing *data* files at
>> the top level, we should either relax the check in general, or allow
>> adding a suppression variable for packages to suppress this check.
>
> Unfortunately, I think I agree -- we should probably blacklist, not whitelist.

Or maybe we keep it as-is but with an opt-out var, with documentation
saying not to use it without strong justification.


signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH] lua-utils.eclass: use BROOT or ESYSROOT where appropriate

2024-08-19 Thread James Le Cuirot
On Sun, 2024-08-18 at 14:31 -0400, Mike Gilbert wrote:
> The LUA variable points to a lua binary that is likely to be executed by
> the build system. Use BROOT for this.
> 
> Use ESYSROOT for the pkg-config symlink, since this is likely used for
> linking a library.
> 
> Signed-off-by: Mike Gilbert 
> ---
>  eclass/lua-utils.eclass | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
> index 0ff36734dc8f..c63ec369c1c2 100644
> --- a/eclass/lua-utils.eclass
> +++ b/eclass/lua-utils.eclass
> @@ -1,4 +1,4 @@
> -# Copyright 1999-2023 Gentoo Authors
> +# Copyright 1999-2024 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  
>  # @ECLASS: lua-utils.eclass
> @@ -144,18 +144,18 @@ _lua_wrapper_setup() {
>   _lua_export "${impl}" ELUA LUA
>  
>   # Lua interpreter
> - ln -s "${EPREFIX}"/usr/bin/${ELUA} "${workdir}"/bin/lua || die
> + ln -s "${LUA}" "${workdir}"/bin/lua || die
>  
>   # Lua compiler, or a stub for it in case of luajit
>   if [[ ${ELUA} == luajit ]]; then
>   # Just in case
> - ln -s "${EPREFIX}"/bin/true "${workdir}"/bin/luac || die
> + ln -s "${BROOT}"/bin/true "${workdir}"/bin/luac || die
>   else
> - ln -s "${EPREFIX}"/usr/bin/${ELUA/a/ac} 
> "${workdir}"/bin/luac || die
> + ln -s "${BROOT}"/usr/bin/${ELUA/a/ac} 
> "${workdir}"/bin/luac || die
>   fi
>  
>   # pkg-config
> - ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${ELUA}.pc \
> + ln -s "${ESYSROOT}"/usr/$(get_libdir)/pkgconfig/${ELUA}.pc \
>   "${workdir}"/pkgconfig/lua.pc || die
>   fi
>  
> @@ -264,7 +264,7 @@ _lua_export() {
>   debug-print "${FUNCNAME}: ELUA = ${ELUA}"
>   ;;
>   LUA)
> - export LUA="${EPREFIX}"/usr/bin/${impl}
> + export LUA="${BROOT}"/usr/bin/${impl}
>   debug-print "${FUNCNAME}: LUA = ${LUA}"
>   ;;
>   LUA_CFLAGS)

Looks good!


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] Handling installed tests

2024-08-18 Thread Sam James
Joonas Niilola  writes:

> Hey,
>
> On 9.8.2024 18.43, Sam James wrote:
>> 
>> I'd like to pick some name which is suitable for us to use elsewhere and
>> it's not really a package-specific issue. Thoughts?
>> 
>
> the first simple thought that came to my mind: "install-tests" or
> "install-test-files". Both are available and should be pretty
> self-explanatory.

Thoughts on prefix/suffix?

"test-install", "test-install-files" are more in-keeping with USE=test,
USE=test-full, etc, but maybe that's *bad* because it's not related
at all to what the ebuild does, so we should do install-* like you've
suggested?

It's been in the back of my head so wanted to bring it up before
committing to install-*. I think it's the better option indeed but want
to check.

>
> -- juippis

thanks,
sam


signature.asc
Description: PGP signature


Re: [gentoo-dev] [RFC HELP WANTED 0/9] Mending the Guile ecosystem

2024-08-18 Thread Sam James
Arsen Arsenović  writes:

> Evening!
>
> This patchset brings Gentoo a new set of ecosystem-style packages à la
> Lua or Python.  Now, the trouble with that is that we already have a
> bunch of Guile packages in the Gentoo repositories:
>
>   ~$ qdepends -Qt dev-scheme/guile | wc -l
>   85
>
> ... and more, probably.
>

The series LGTM. I'd already reviewed it as it was being developed as
well.

I think we should get it in and start the porting work, all masked as we
did with Lua, and then handle the grand unmasking in a coordinated
manner later when everything is ready.

> [...]

(big) thanks for doing this,
sam


signature.asc
Description: PGP signature


[gentoo-dev] [COMMITTED PATCH] go-env.eclass: workaround debug info issues

2024-08-15 Thread Sam James
Go can't handle some DWARF produced by GCC but nobody's been able
to produce a simple testcase for it, so add a workaround where we replace
-g3 with -g and -ggdb3 with -ggdb for GCC, like Ionen did in Kitty.

Bug: https://bugs.gentoo.org/847991
Bug: https://bugs.gentoo.org/924436
Bug: https://bugs.gentoo.org/924496
Closes: https://bugs.gentoo.org/929219
Signed-off-by: Sam James 
---
 eclass/go-env.eclass | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index be131133113be..a4394161cb0bc 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -42,6 +42,12 @@ go-env_set_compile_environment() {
# XXX: Hack for checking ICE (bug #912152, gcc PR113204)
has_version -b "sys-devel/gcc[debug]" && filter-lto
 
+   # bug #929219
+   if tc-is-gcc ; then
+   replace-flags -g3 -g
+   replace-flags -ggdb3 -ggdb
+   fi
+
export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
export CGO_CXXFLAGS="${CGO_CXXFLAGS:-$CXXFLAGS}"
-- 
2.46.0




[gentoo-dev] Handling installed tests

2024-08-09 Thread Sam James
Hi,

I'm currently working on packaging dtrace which doesn't (at least
currently, may not ever) support running tests as non-root, but
does support handling installing them for later manual use.

This raises a question: how should we control installing such tests? How
should the user request that?

USE=test isn't suitable because:
a) I generally expect it not to mutate the image;
b) ago, rightly, based on this has a tinderbox check which looks for
added/removed files when tests are enabled.

I'd like to pick some name which is suitable for us to use elsewhere and
it's not really a package-specific issue. Thoughts?

Please assume the tests are large enough to justify conditional install
and have additional dependencies.

(This is arguably related to https://bugs.gentoo.org/867799 and so on
wrt dev-lang/python always installing tests.)

thanks,
sam


signature.asc
Description: PGP signature


[gentoo-dev] Handling optional, expensive variants of test suite

2024-08-09 Thread Sam James
Hi!

Some packages like libffi, gcc support extended, slower versions of
their testsuites. In the past, I've seen both USE="expensive-tests" (I
think) and USE="test-full" (used in a few places in-tree atm) for this.

I sort of hate both suggestions but I'm open to what people think is
best, with a view to then making it a global USE flag then? Thoughts?

Note that I _do_ think there's value in exposing these because some of
the configurations I use, and I know others are deploying Gentoo for,
are where they want to make use of as many opportunities as possible
to find bad runtime behaviour (kernel and toolchain patching).

thanks,
sam


signature.asc
Description: PGP signature


Re: [gentoo-dev] [PATCH 2/2] cargo.eclass: Preserve project-specific [build] flags by reading config

2024-08-07 Thread James Le Cuirot
On Wed, 2024-08-07 at 19:39 +0200, Michał Górny wrote:
> On Wed, 2024-08-07 at 16:52 +0100, James Le Cuirot wrote:
> > The flags we set an a target-specific environment variable override any
> > generic [build] flags set by the project, requiring ebuilds to set these
> > themselves, which is undesirable. Work around this by using tomlq to
> > read the flags from the config files checked by Cargo and prepending
> > them to our environment variable.
> > 
> > Signed-off-by: James Le Cuirot 
> > ---
> >  eclass/cargo.eclass | 28 +---
> >  1 file changed, 17 insertions(+), 11 deletions(-)
> > 
> > diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> > index 6d4cf1b425eb..dea8c49e4585 100644
> > --- a/eclass/cargo.eclass
> > +++ b/eclass/cargo.eclass
> > @@ -36,7 +36,8 @@ esac
> >  
> >  inherit flag-o-matic multiprocessing rust-toolchain toolchain-funcs
> >  
> > -[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"
> > +# app-misc/yq is needed for tomlq.
> > +[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND} app-misc/yq"
> >  
> 
> Doesn't this imply that all ebuilds using CARGO_OPTIONAL will now have
> to explicitly depend on yq?

Good catch, thanks. I can update the eclass docs accordingly. I count 23
ebuilds across 8 packages, and this can be done without a revbump, so it's not
too bad. Even if it were missing, it would just continue without applying
these extra flags.

I have also noticed that yq will need some keywording first.

I considered some inline Python with just tomli instead, but then you get into
the mess of micro-managing the Python versions. I don't think there's a way to
say "use whatever Python tomli is installed for".


signature.asc
Description: This is a digitally signed message part


[gentoo-dev] [PATCH 2/2] cargo.eclass: Preserve project-specific [build] flags by reading config

2024-08-07 Thread James Le Cuirot
The flags we set an a target-specific environment variable override any
generic [build] flags set by the project, requiring ebuilds to set these
themselves, which is undesirable. Work around this by using tomlq to
read the flags from the config files checked by Cargo and prepending
them to our environment variable.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 28 +---
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 6d4cf1b425eb..dea8c49e4585 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -36,7 +36,8 @@ esac
 
 inherit flag-o-matic multiprocessing rust-toolchain toolchain-funcs
 
-[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND}"
+# app-misc/yq is needed for tomlq.
+[[ ! ${CARGO_OPTIONAL} ]] && BDEPEND="${RUST_DEPEND} app-misc/yq"
 
 IUSE="${IUSE} debug"
 
@@ -566,21 +567,26 @@ cargo_env() {
# It has been common for users and ebuilds to set RUSTFLAGS, which would
# have overridden whatever a project sets anyway, so the least-worst 
option
# is to include those RUSTFLAGS in target-specific config here, which 
will
-   # merge with any the project sets. Only flags in generic [build] config 
set
-   # by the project will be lost, and ebuilds will need to add those to
-   # RUSTFLAGS themselves if they are important.
-   #
-   # We could potentially inspect a project's generic [build] config and
-   # reapply those flags ourselves, but that would require a proper toml 
parser
-   # like tomlq, it might lead to confusion where projects also have
-   # target-specific config, and converting arrays to strings may not work
-   # well. Nightly features to inspect the config might help here in 
future.
+   # merge with any the project sets. Flags in generic [build] config set 
by
+   # the project would then be overridden, but we preserve them by reading 
them
+   # from config files and prepending them to RUSTFLAGS.
#
# As of Rust 1.80, it is not possible to set separate flags for the 
build
# host and the target host when cross-compiling. The flags given are 
applied
# to the target host only with no flags being applied to the build 
host. The
# nightly host-config feature will improve this situation later.
-   #
+
+   # Iterate over all the config.toml files that Cargo will read except 
for our
+   # own, prepending any build.rustflags to our environment variable so 
that
+   # they don't get overridden by our other flags. Skip any flags with an
+   # explicit space in them because we cannot handle those via our 
variable.
+   local DIR=${PWD}
+   while true; do
+   RUSTFLAGS="$(tomlq -r '.build.rustflags | if type == "array" 
then map(select(contains(" ") | not)) else [.] end | join(" ")' 
"${DIR}"/.cargo/config.toml 2>/dev/null) ${RUSTFLAGS# }"
+   [[ -d ${DIR} ]] || break
+   DIR=${DIR%/*}
+   done
+
# The default linker is "cc" so override by setting linker to CC in the
# RUSTFLAGS. The given linker cannot include any arguments, so split 
these
# into link-args along with LDFLAGS.
-- 
2.45.2




[gentoo-dev] [PATCH 1/2] cargo.eclass: Change RUSTFLAGS approach following recent build failures

2024-08-07 Thread James Le Cuirot
Cargo turned out to be even worse at handling flags than I thought.
Target-specific flags set by projects were overriding our own, and Cargo
was bailing out when faced with merging a string of flags with an array
of flags.

After weighing up the poor set of options, I've found that it is better
to always set flags via a target-specific environment variable for
reasons set out in comments added here. This approach was previously
just used for cross-compiling, but now we do it unconditionally.

It has the downside of overriding generic [build] flags set by projects,
but these were already being overridden by users and ebuilds setting
RUSTFLAGS themselves.

Closes: https://bugs.gentoo.org/937453
Closes: https://bugs.gentoo.org/937470
Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 65 +++--
 1 file changed, 39 insertions(+), 26 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index c360c2a6c419..6d4cf1b425eb 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -259,19 +259,6 @@ cargo_crate_uris() {
 cargo_gen_config() {
debug-print-function ${FUNCNAME} "$@"
 
-   # The default linker is "cc" so override by setting linker to CC in the
-   # RUSTFLAGS. The given linker cannot include any arguments, so split 
these
-   # into link-args along with LDFLAGS. Also include external RUSTFLAGS.
-   # Note that as of Rust 1.80, the build host RUSTFLAGS are ignored when
-   # cross-compiling unless you use the unstable host-config feature 
available
-   # with USE=nightly. There is no simple way around this.
-   tc-export_build_env
-   local LD_A=( $(tc-getBUILD_CC) ${BUILD_LDFLAGS} )
-   local MY_BUILD_RUSTFLAGS="-C strip=none -C linker=${LD_A[0]}"
-   [[ ${#LD_A[@]} -gt 1 ]] && MY_BUILD_RUSTFLAGS+="$(printf -- ' -C 
link-arg=%s' "${LD_A[@]:1}")"
-   MY_BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${BUILD_RUSTFLAGS}"
-   tc-is-cross-compiler || MY_BUILD_RUSTFLAGS+=" ${TARGET_RUSTFLAGS}"
-
mkdir -p "${ECARGO_HOME}" || die
 
cat > "${ECARGO_HOME}/config.toml" <<- _EOF_ || die "Failed to create 
cargo config"
@@ -286,7 +273,6 @@ cargo_gen_config() {
offline = true
 
[build]
-   rustflags = "${MY_BUILD_RUSTFLAGS}"
jobs = $(makeopts_jobs)
incremental = false
 
@@ -541,10 +527,11 @@ cargo_src_configure() {
 # @USAGE: Command with its arguments
 # @DESCRIPTION:
 # Run the given command under an environment needed for performing tasks with
-# Cargo such as building. RUSTFLAGS is used for both the build and target host.
-# BUILD_RUSTFLAGS and TARGET_RUSTFLAGS are used for just the build host and
-# target host respectively. Ensure these are set consistently between Cargo
-# invocations, otherwise rebuilds will occur.
+# Cargo such as building. RUSTFLAGS are appended to additional flags set here.
+# Ensure these are set consistently between Cargo invocations, otherwise
+# rebuilds will occur. Project-specific rustflags set against [build] will not
+# take affect due to Cargo limitations, so add these to your ebuild's RUSTFLAGS
+# if they seem important.
 cargo_env() {
[[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
@@ -569,14 +556,40 @@ cargo_env() {
HOST_CFLAGS=${BUILD_CFLAGS}
HOST_CXXFLAGS=${BUILD_CXXFLAGS}
 
-   if tc-is-cross-compiler; then
-   local -x CARGO_BUILD_TARGET=$(rust_abi)
-   local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   local TRIPLE=${TRIPLE^^} LD_A=( $(tc-getCC) ${LDFLAGS} )
-   local -x CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS="-C strip=none -C 
linker=${LD_A[0]}"
-   [[ ${#LD_A[@]} -gt 1 ]] && local 
CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
-   local CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+=" ${RUSTFLAGS} 
${TARGET_RUSTFLAGS}"
-   fi
+   # Unfortunately, Cargo is *really* bad at handling flags. In short, it 
uses
+   # the first of the RUSTFLAGS env var, any target-specific config, and 
then
+   # any generic [build] config. It can merge within the latter two types 
from
+   # different sources, but it will not merge across these different 
types, so
+   # if a project sets flags under [target.'cfg(all())'], it will override 
any
+   # flags we set under [build] and vice-versa.
+   #
+   # It has been common for users and ebuilds to set RUSTFLAGS, which would
+   # have overridden whatever a project sets anyway, so the least-worst 
option
+   # is to include those RUSTFLAGS in target-specific config here, which 
will
+   #

[gentoo-dev] [PATCH 0/2] cargo.eclass: Change RUSTFLAGS approach following recent build failures

2024-08-07 Thread James Le Cuirot
Unfortunately, my recent cargo.eclass changes didn't fare so well, despite me
testing it on a good handful of packages. I've had to sharply change tack to
work around Cargo's shortcomings.

The first commit has the main change. I'd like to merge that very soon to put
out the immediate fire.

The second commit tries to address a lingering downside where
project-specific flags may get overridden by our own. This was happening,
even before I changed anything for users or ebuilds setting RUSTFLAGS, but
now it is more likely to happen. I'm unsure of this change because it is a
little controverial, using app-misc/yq's tomlq (a jq wrapper) to read flags
from the project's config files. On the plus side, it should avoid upstreams
complaining that we're not using their flags. See what you think. I've kept
it in a separate commit so that it can easily be backed out.

James Le Cuirot (2):
  cargo.eclass: Change RUSTFLAGS approach following recent build
failures
  cargo.eclass: Preserve project-specific [build] flags by reading
config

 eclass/cargo.eclass | 73 -
 1 file changed, 46 insertions(+), 27 deletions(-)

--
2.45.2



[gentoo-dev] Last rites: media-tv/v4l-utils

2024-07-29 Thread James Le Cuirot
# James Le Cuirot  (2024-07-29)
# Superseded by media-libs/libv4l[utils].
# Removal on 2024-08-29. Bug #936674.
media-tv/v4l-utils


signature.asc
Description: This is a digitally signed message part


[gentoo-dev] [PATCH 8/8] distutils-r1.eclass: Support cross-compiling with PyO3

2024-07-25 Thread James Le Cuirot
Only one variable needs to be set. For details, see
https://pyo3.rs/latest/building-and-distribution.html#cross-compiling.

Signed-off-by: James Le Cuirot 
---
 eclass/distutils-r1.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 743242b2acee8..9289392f84b38 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1390,6 +1390,9 @@ distutils_pep517_install() {
;;
esac

+   # https://pyo3.rs/latest/building-and-distribution.html#cross-compiling
+   tc-is-cross-compiler && local -x 
PYO3_CROSS_LIB_DIR=${SYSROOT}/$(python_get_stdlib)
+
local build_backend=$(_distutils-r1_get_backend)
einfo "  Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}"
cmd+=(
--
2.45.2



[gentoo-dev] [PATCH 7/8] distutils-r1.eclass: Add python_get_stdlib helper function

2024-07-25 Thread James Le Cuirot
This is just like python_get_sitedir, but it returns the stdlib
directory such as /usr/lib/python3.12. This is useful for locating the
sysconfigdata file.

Signed-off-by: James Le Cuirot 
---
 eclass/python-utils-r1.eclass | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index c47565fa1db2a..b544f52312880 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -332,6 +332,17 @@ _python_export() {
export 
PYTHON=${BROOT-${EPREFIX}}/usr/bin/${impl}
debug-print "${FUNCNAME}: PYTHON = ${PYTHON}"
;;
+   PYTHON_STDLIB)
+   [[ -n ${PYTHON} ]] || die "PYTHON needs to be 
set for ${var} to be exported, or requested before it"
+   PYTHON_STDLIB=$(
+   "${PYTHON}" - "${EPREFIX}/usr" <<-EOF 
|| die
+   import sys, sysconfig
+   
print(sysconfig.get_path("stdlib", vars={"installed_base": sys.argv[1]}))
+   EOF
+   )
+   export PYTHON_STDLIB
+   debug-print "${FUNCNAME}: PYTHON_STDLIB = 
${PYTHON_STDLIB}"
+   ;;
PYTHON_SITEDIR)
[[ -n ${PYTHON} ]] || die "PYTHON needs to be 
set for ${var} to be exported, or requested before it"
PYTHON_SITEDIR=$(
@@ -466,6 +477,18 @@ _python_export() {
done
 }

+# @FUNCTION: python_get_stdlib
+# @USAGE: []
+# @DESCRIPTION:
+# Obtain and print the 'stdlib' path for the given implementation. If no
+# implementation is provided, ${EPYTHON} will be used.
+python_get_stdlib() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   _python_export "${@}" PYTHON_STDLIB
+   echo "${PYTHON_STDLIB}"
+}
+
 # @FUNCTION: python_get_sitedir
 # @USAGE: []
 # @DESCRIPTION:
--
2.45.2



[gentoo-dev] [PATCH 6/6] distutils-r1.eclass: Use cargo_env when appropriate for flag handling

2024-07-25 Thread James Le Cuirot
cargo_env handles linker flags and enables cross-compiling. It also
handles LTO filtering, so we can remove that from this eclass.

Signed-off-by: James Le Cuirot 
---
 eclass/distutils-r1.eclass | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index fa8edb5cdfb77..743242b2acee8 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1251,7 +1251,9 @@ distutils_pep517_install() {
die "mydistutilsargs are banned in PEP517 mode (use 
DISTUTILS_ARGS)"
fi
 
-   local config_settings=
+   local cmd=() config_settings=
+   has cargo ${INHERITED} && cmd+=( cargo_env )
+
case ${DISTUTILS_USE_PEP517} in
maturin)
# `maturin pep517 build-wheel --help` for options
@@ -1390,7 +1392,7 @@ distutils_pep517_install() {
 
local build_backend=$(_distutils-r1_get_backend)
einfo "  Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}"
-   local cmd=(
+   cmd+=(
"${EPYTHON}" -m gpep517 build-wheel
--prefix="${EPREFIX}/usr"
--backend "${build_backend}"
@@ -1792,16 +1794,6 @@ distutils-r1_run_phase() {
# bug fixes from Cython (this works only when setup.py is using
# cythonize() but it's better than nothing)
local -x CYTHON_FORCE_REGEN=1
-
-   # Rust extensions are incompatible with C/C++ LTO compiler
-   # see e.g. https://bugs.gentoo.org/910220
-   if has cargo ${INHERITED}; then
-   local x
-   for x in $(all-flag-vars); do
-   local -x "${x}=${!x}"
-   done
-   filter-lto
-   fi
fi
 
# silence warnings when pydevd is loaded on Python 3.11+
-- 
2.45.2




[gentoo-dev] [PATCH 5/6] cargo.eclass: Shadow flag variables so that LTO filtering remains local

2024-07-25 Thread James Le Cuirot
This is currently done for Cargo by distutils-r1.eclass. The next commit
will remove that code, leaving cargo_env responsible for it.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 9 +
 1 file changed, 9 insertions(+)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 84f72168fbb3c..25acf010287d8 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -549,7 +549,16 @@ cargo_env() {
[[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
 
+   # Shadow flag variables so that filtering below remains local.
+   local flag
+   for flag in $(all-flag-vars); do
+   local -x "${flag}=${!flag}"
+   done
+
+   # Rust extensions are incompatible with C/C++ LTO compiler see e.g.
+   # https://bugs.gentoo.org/910220
filter-lto
+
tc-export AR CC CXX PKG_CONFIG
 
# Set vars for cc-rs crate.
-- 
2.45.2




[gentoo-dev] [PATCH 4/6] cargo.eclass: Explicitly tell rustc not to strip binaries

2024-07-25 Thread James Le Cuirot
Most projects don't strip binaries in release mode by default, but there
are exceptions like app-misc/broot.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 6ea37ec5e4e4b..84f72168fbb3c 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -267,7 +267,7 @@ cargo_gen_config() {
# with USE=nightly. There is no simple way around this.
tc-export_build_env
local LD_A=( $(tc-getBUILD_CC) ${BUILD_LDFLAGS} )
-   local BUILD_RUSTFLAGS="-C linker=${LD_A[0]}"
+   local BUILD_RUSTFLAGS="-C strip=none -C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && BUILD_RUSTFLAGS+="$(printf -- ' -C 
link-arg=%s' "${LD_A[@]:1}")"
BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS}"
tc-is-cross-compiler || BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
@@ -564,7 +564,7 @@ cargo_env() {
local -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_}
local TRIPLE=${TRIPLE^^} LD_A=( $(tc-getCC) ${LDFLAGS} )
-   local -x CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS="-C 
linker=${LD_A[0]}"
+   local -x CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS="-C strip=none -C 
linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && local 
CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
local CARGO_TARGET_"${TRIPLE}"_RUSTFLAGS+=" ${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS}"
fi
-- 
2.45.2




[gentoo-dev] [PATCH 3/6] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better

2024-07-25 Thread James Le Cuirot
LDFLAGS are not currently honoured by Cargo builds at all. It would be
particularly advantageous to honour -fuse-ld because alternative linkers
like mold are known to be significantly faster at handling Rust.

As things stand, the eclass sets the linker to CC when cross-compiling,
but it does so erroneously due to a shell quoting issue. If CC includes
arguments, an error occurs when setting the CARGO_TARGET_*_LINKER
variable. Even with the right quoting, Cargo still fails because this
variable is not allowed to include arguments. They have to be specified
via RUSTFLAGS instead.

The build host linker is frequently invoked due to the use of build
scripts by some crates. We would therefore also like to configure the
build host linker properly when cross-compiling, but unfortunately there
is currently no way to do this without using a Rust nightly feature.

The build host linker is now configured in the cargo_gen_config function
because this configuration is static. Conversely, the target host linker
is configured with environment variables in the cargo_env function
because the target may change.

Some ebuilds already set RUSTFLAGS, so some consideration was given to
how to handle these. When set, Cargo prioritises RUSTFLAGS and similar
over specific configuration for the build and target hosts, so these
must be unset. We can still include their contents in that configuration
for convenience though. CARGO_BUILD_RUSTFLAGS can be used by ebuilds to
set flags only for the build host.

It should not be necessary for ebuilds to figure out which Rust ABI is
applicable in order to set flags only for the target host, so the helper
reads from a simple CARGO_TARGET_RUSTFLAGS variable without the triple
for convenience.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 65 +
 1 file changed, 42 insertions(+), 23 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index d598af8825adf..6ea37ec5e4e4b 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -109,7 +109,7 @@ ECARGO_VENDOR="${ECARGO_HOME}/gentoo"
 #
 # If you enable CARGO_OPTIONAL, you have to set BDEPEND on virtual/rust
 # for your package and call at least cargo_gen_config manually before using
-# other src_functions of this eclass.
+# other src_functions or cargo_env of this eclass.
 # Note that cargo_gen_config is automatically called by cargo_src_unpack.
 
 # @ECLASS_VARIABLE: myfeatures
@@ -259,6 +259,19 @@ cargo_crate_uris() {
 cargo_gen_config() {
debug-print-function ${FUNCNAME} "$@"
 
+   # The default linker is "cc" so override by setting linker to CC in the
+   # RUSTFLAGS. The given linker cannot include any arguments, so split 
these
+   # into link-args along with LDFLAGS. Also include external RUSTFLAGS.
+   # Note that as of Rust 1.80, the build host RUSTFLAGS are ignored when
+   # cross-compiling unless you use the unstable host-config feature 
available
+   # with USE=nightly. There is no simple way around this.
+   tc-export_build_env
+   local LD_A=( $(tc-getBUILD_CC) ${BUILD_LDFLAGS} )
+   local BUILD_RUSTFLAGS="-C linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && BUILD_RUSTFLAGS+="$(printf -- ' -C 
link-arg=%s' "${LD_A[@]:1}")"
+   BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS}"
+   tc-is-cross-compiler || BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
+
mkdir -p "${ECARGO_HOME}" || die
 
cat > "${ECARGO_HOME}/config.toml" <<- _EOF_ || die "Failed to create 
cargo config"
@@ -273,6 +286,7 @@ cargo_gen_config() {
offline = true
 
[build]
+   rustflags = "${BUILD_RUSTFLAGS}"
jobs = $(makeopts_jobs)
incremental = false
 
@@ -527,27 +541,41 @@ cargo_src_configure() {
 # @USAGE: Command with its arguments
 # @DESCRIPTION:
 # Run the given command under an environment needed for performing tasks with
-# Cargo such as building.
+# Cargo such as building. RUSTFLAGS is used for both the build and target host.
+# CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_RUSTFLAGS are used for just the build
+# host and target host respectively. Ensure these are set consistently between
+# Cargo invocations, otherwise rebuilds will occur.
 cargo_env() {
+   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
+
filter-lto
tc-export AR CC CXX PKG_CONFIG
 
+   # Set vars for cc-rs crate.
+   local -x \
+   HOST_AR=$(tc-getBUILD_AR)
+   HOST_CC=$(tc-getBUILD_CC)
+   HOST_CXX=$(tc-getBUILD_CXX)
+   HOST_CFLAGS=${BUILD_CFLAGS}
+   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+
if tc-is-cross-compiler; then
-   declare -x CARGO_BUILD_TARGET=$(rust_abi)
+   

[gentoo-dev] [PATCH 2/6] cargo.eclass: Add cargo_env helper and use it in compile, test, install

2024-07-25 Thread James Le Cuirot
Rust packages have a tendency to rebuild parts during test and install.
It is not clear whether this can be addressed. We were therefore relying
on some environment variables set during the compile phase for
cross-compiling to work in the later phases. This is not ideal,
especially if you need to build for multiple targets.

These environment variables can also be useful in other contexts, such
as the build runner in app-misc/anki.

This change moves the setting of these variables into a separate helper
that is now used in all these phases and can be used by ebuilds too. The
variables are now kept local to each invocation of this helper,
preventing leakage.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 37 +++--
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index aab28dbbac167..d598af8825adf 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -523,26 +523,23 @@ cargo_src_configure() {
[[ ${ECARGO_ARGS[@]} ]] && einfo "Configured with: ${ECARGO_ARGS[@]}"
 }
 
-# @FUNCTION: cargo_src_compile
+# @FUNCTION: cargo_env
+# @USAGE: Command with its arguments
 # @DESCRIPTION:
-# Build the package using cargo build.
-cargo_src_compile() {
-   debug-print-function ${FUNCNAME} "$@"
-
-   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
-   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
-
+# Run the given command under an environment needed for performing tasks with
+# Cargo such as building.
+cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG
 
if tc-is-cross-compiler; then
-   export CARGO_BUILD_TARGET=$(rust_abi)
+   declare -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   export CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
 
# Set vars for cc-rs crate.
tc-export_build_env
-   export \
+   declare -x \
HOST_AR=$(tc-getBUILD_AR)
HOST_CC=$(tc-getBUILD_CC)
HOST_CXX=$(tc-getBUILD_CXX)
@@ -550,9 +547,21 @@ cargo_src_compile() {
HOST_CXXFLAGS=${BUILD_CXXFLAGS}
fi
 
+   "${@}"
+}
+
+# @FUNCTION: cargo_src_compile
+# @DESCRIPTION:
+# Build the package using cargo build.
+cargo_src_compile() {
+   debug-print-function ${FUNCNAME} "$@"
+
+   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
+
set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo build failed"
+   cargo_env "${@}" || die "cargo build failed"
 }
 
 # @FUNCTION: cargo_src_install
@@ -573,7 +582,7 @@ cargo_src_install() {
$(usex debug --debug "") \
${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo install failed"
+   cargo_env "${@}" || die "cargo install failed"
 
rm -f "${ED}/usr/.crates.toml" || die
rm -f "${ED}/usr/.crates2.json" || die
@@ -590,7 +599,7 @@ cargo_src_test() {
 
set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo test failed"
+   cargo_env "${@}" || die "cargo test failed"
 }
 
 fi
-- 
2.45.2




[gentoo-dev] [PATCH 1/6] cargo.eclass: Use newer Cargo config file name

2024-07-25 Thread James Le Cuirot
"config" is deprecated and "config.toml" has been valid for ages.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 7db34efb4e174..aab28dbbac167 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -248,7 +248,7 @@ cargo_crate_uris() {
 
 # @FUNCTION: cargo_gen_config
 # @DESCRIPTION:
-# Generate the $CARGO_HOME/config necessary to use our local registry and 
settings.
+# Generate the $CARGO_HOME/config.toml necessary to use our local registry and 
settings.
 # Cargo can also be configured through environment variables in addition to 
the TOML syntax below.
 # For each configuration key below of the form foo.bar the environment 
variable CARGO_FOO_BAR
 # can also be used to define the value.
@@ -261,7 +261,7 @@ cargo_gen_config() {
 
mkdir -p "${ECARGO_HOME}" || die
 
-   cat > "${ECARGO_HOME}/config" <<- _EOF_ || die "Failed to create cargo 
config"
+   cat > "${ECARGO_HOME}/config.toml" <<- _EOF_ || die "Failed to create 
cargo config"
[source.gentoo]
directory = "${ECARGO_VENDOR}"
 
-- 
2.45.2




[gentoo-dev] [PATCH v4 0/6] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better

2024-07-25 Thread James Le Cuirot
Sorry for yet another iteration of this. I noticed that the build host flags
were not being applied to rustc when cross-compiling. Upon investigation, I
found that this isn't actually possible right now. I have reworked it to be
close to what we need when it does become possible.

James Le Cuirot (6):
  cargo.eclass: Use newer Cargo config file name
  cargo.eclass: Add cargo_env helper and use it in compile, test,
install
  cargo.eclass: Handle LDFLAGS and RUSTFLAGS better
  cargo.eclass: Explicitly tell rustc not to strip binaries
  cargo.eclass: Shadow flag variables so that LTO filtering remains
local
  distutils-r1.eclass: Use cargo_env when appropriate for flag handling

 eclass/cargo.eclass| 93 ++
 eclass/distutils-r1.eclass | 16 ++-
 2 files changed, 69 insertions(+), 40 deletions(-)

--
2.45.2



Re: [gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local

2024-07-25 Thread Sam James
James Le Cuirot  writes:

> Signed-off-by: James Le Cuirot 
> ---
>  eclass/cargo.eclass | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> index 44d3f7ee31f59..9f0bffee0e048 100644
> --- a/eclass/cargo.eclass
> +++ b/eclass/cargo.eclass
> @@ -532,7 +532,16 @@ cargo_src_configure() {
>  # host and target host respectively. Ensure these are set consistently 
> between
>  # Cargo invocations, otherwise rebuilds will occur.
>  cargo_env() {
> + # Shadow flag variables so that filtering below remains local.
> + local flag
> + for flag in $(all-flag-vars); do
> + local -x "${flag}=${!flag}"
> + done
> +
> + # Rust extensions are incompatible with C/C++ LTO compiler see e.g.
> + # https://bugs.gentoo.org/910220
>   filter-lto
> +

Maybe mention in the commit message that this is what we do for
distutils-r1 too.



Re: [gentoo-dev] [PATCH 1/5 v3] cargo.eclass: Add cargo_env helper and use it in compile, test, install

2024-07-25 Thread Sam James
James Le Cuirot  writes:

> Rust packages have a tendency to rebuild parts during test and install.
> It is not clear whether this can be addressed. We were therefore relying
> on some environment variables set during the compile phase for
> cross-compiling to work in the later phases. This is not ideal,
> especially if you need to build for multiple targets.
>
> These environment variables can also be useful in other contexts, such
> as the build runner in app-misc/anki.
>
> This change moves the setting of these variables into a separate helper
> that is now used in all these phases and can be used by ebuilds too. The
> variables are now kept local to each invocation of this helper,
> preventing leakage.

The series looks OK but please let Ionen cast an eye over it as well as
mgorny, espec. for distutils-r1.

(Also, remember to CC eclass maints!)

>
> Signed-off-by: James Le Cuirot 
> ---
>  eclass/cargo.eclass | 37 +++--
>  1 file changed, 23 insertions(+), 14 deletions(-)
>
> diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
> index 7db34efb4e174..b6d5fe21f0a7b 100644
> --- a/eclass/cargo.eclass
> +++ b/eclass/cargo.eclass
> @@ -523,26 +523,23 @@ cargo_src_configure() {
>   [[ ${ECARGO_ARGS[@]} ]] && einfo "Configured with: ${ECARGO_ARGS[@]}"
>  }
>
> -# @FUNCTION: cargo_src_compile
> +# @FUNCTION: cargo_env
> +# @USAGE: Command with its arguments
>  # @DESCRIPTION:
> -# Build the package using cargo build.
> -cargo_src_compile() {
> - debug-print-function ${FUNCNAME} "$@"
> -
> - [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
> - die "FATAL: please call cargo_gen_config before using 
> ${FUNCNAME}"
> -
> +# Run the given command under an environment needed for performing tasks with
> +# Cargo such as building.
> +cargo_env() {
>   filter-lto
>   tc-export AR CC CXX PKG_CONFIG
>
>   if tc-is-cross-compiler; then
> - export CARGO_BUILD_TARGET=$(rust_abi)
> + declare -x CARGO_BUILD_TARGET=$(rust_abi)
>   local TRIPLE=${CARGO_BUILD_TARGET//-/_}
> - export CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
> + declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
>
>   # Set vars for cc-rs crate.
>   tc-export_build_env
> - export \
> + declare -x \
>   HOST_AR=$(tc-getBUILD_AR)
>   HOST_CC=$(tc-getBUILD_CC)
>   HOST_CXX=$(tc-getBUILD_CXX)
> @@ -550,9 +547,21 @@ cargo_src_compile() {
>   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
>   fi
>
> + "${@}"
> +}
> +
> +# @FUNCTION: cargo_src_compile
> +# @DESCRIPTION:
> +# Build the package using cargo build.
> +cargo_src_compile() {
> + debug-print-function ${FUNCNAME} "$@"
> +
> + [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
> + die "FATAL: please call cargo_gen_config before using 
> ${FUNCNAME}"
> +
>   set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
>   einfo "${@}"
> - "${@}" || die "cargo build failed"
> + cargo_env "${@}" || die "cargo build failed"
>  }
>
>  # @FUNCTION: cargo_src_install
> @@ -573,7 +582,7 @@ cargo_src_install() {
>   $(usex debug --debug "") \
>   ${ECARGO_ARGS[@]} "$@"
>   einfo "${@}"
> - "${@}" || die "cargo install failed"
> + cargo_env "${@}" || die "cargo install failed"
>
>   rm -f "${ED}/usr/.crates.toml" || die
>   rm -f "${ED}/usr/.crates2.json" || die
> @@ -590,7 +599,7 @@ cargo_src_test() {
>
>   set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
>   einfo "${@}"
> - "${@}" || die "cargo test failed"
> + cargo_env "${@}" || die "cargo test failed"
>  }
>
>  fi



[gentoo-dev] [PATCH 5/5 v3] distutils-r1.eclass: Use cargo_env when appropriate for flag handling

2024-07-25 Thread James Le Cuirot
cargo_env handles linker flags and enables cross-compiling. It also
handles LTO filtering, so we can remove that from this eclass.

Signed-off-by: James Le Cuirot 
---
 eclass/distutils-r1.eclass | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index fa8edb5cdfb77..743242b2acee8 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1251,7 +1251,9 @@ distutils_pep517_install() {
die "mydistutilsargs are banned in PEP517 mode (use 
DISTUTILS_ARGS)"
fi

-   local config_settings=
+   local cmd=() config_settings=
+   has cargo ${INHERITED} && cmd+=( cargo_env )
+
case ${DISTUTILS_USE_PEP517} in
maturin)
# `maturin pep517 build-wheel --help` for options
@@ -1390,7 +1392,7 @@ distutils_pep517_install() {

local build_backend=$(_distutils-r1_get_backend)
einfo "  Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}"
-   local cmd=(
+   cmd+=(
"${EPYTHON}" -m gpep517 build-wheel
--prefix="${EPREFIX}/usr"
--backend "${build_backend}"
@@ -1792,16 +1794,6 @@ distutils-r1_run_phase() {
# bug fixes from Cython (this works only when setup.py is using
# cythonize() but it's better than nothing)
local -x CYTHON_FORCE_REGEN=1
-
-   # Rust extensions are incompatible with C/C++ LTO compiler
-   # see e.g. https://bugs.gentoo.org/910220
-   if has cargo ${INHERITED}; then
-   local x
-   for x in $(all-flag-vars); do
-   local -x "${x}=${!x}"
-   done
-   filter-lto
-   fi
fi

# silence warnings when pydevd is loaded on Python 3.11+
--
2.45.2



[gentoo-dev] [PATCH 4/5 v3] cargo.eclass: Shadow flag variables so that LTO filtering remains local

2024-07-25 Thread James Le Cuirot
Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 9 +
 1 file changed, 9 insertions(+)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 44d3f7ee31f59..9f0bffee0e048 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -532,7 +532,16 @@ cargo_src_configure() {
 # host and target host respectively. Ensure these are set consistently between
 # Cargo invocations, otherwise rebuilds will occur.
 cargo_env() {
+   # Shadow flag variables so that filtering below remains local.
+   local flag
+   for flag in $(all-flag-vars); do
+   local -x "${flag}=${!flag}"
+   done
+
+   # Rust extensions are incompatible with C/C++ LTO compiler see e.g.
+   # https://bugs.gentoo.org/910220
filter-lto
+
tc-export AR CC CXX PKG_CONFIG

# Set vars for cc-rs crate.
--
2.45.2



[gentoo-dev] [PATCH 3/5 v3] cargo.eclass: Explicitly tell rustc not to strip binaries

2024-07-25 Thread James Le Cuirot
Most projects don't strip binaries in release mode by default, but there
are exceptions like app-misc/broot.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 596598ca8585a..44d3f7ee31f59 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -548,13 +548,13 @@ cargo_env() {
# RUSTFLAGS. The given linker cannot include any arguments, so split 
these
# into link-args along with LDFLAGS. Also include external RUSTFLAGS.
local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
-   local -x CARGO_BUILD_RUSTFLAGS="${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS} 
-C linker=${LD_A[0]}"
+   local -x CARGO_BUILD_RUSTFLAGS="-C strip=none ${RUSTFLAGS} 
${CARGO_BUILD_RUSTFLAGS} -C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && local CARGO_BUILD_RUSTFLAGS+="$(printf -- ' 
-C link-arg=%s' "${LD_A[@]:1}")"

if tc-is-cross-compiler; then
local -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
-   local -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
+   local -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="-C strip=none 
${RUSTFLAGS} ${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && local 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
else
CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
--
2.45.2



[gentoo-dev] [PATCH 2/5 v3] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better

2024-07-25 Thread James Le Cuirot
LDFLAGS are not currently honoured by Cargo builds at all. It would be
particularly advantageous to honour -fuse-ld because alternative linkers
like mold are known to be significantly faster at handling Rust.

As things stand, the eclass sets the linker to CC when cross-compiling,
but it does so erroneously due to a shell quoting issue. If CC includes
arguments, an error occurs when setting the CARGO_TARGET_*_LINKER
variable. Even with the right quoting, Cargo still fails because this
variable is not allowed to include arguments. They have to be specified
via RUSTFLAGS instead.

We would also like to configure the build host linker properly when
cross-compiling, but strangely there is no equivalent linker variable
for the build host. It can only be set via RUSTFLAGS. For consistency,
we now use RUSTFLAGS for the target host linker as well.

Some ebuilds already set RUSTFLAGS, so some consideration was given to
how to handle these. When set, Cargo prioritises RUSTFLAGS over
CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_*_RUSTFLAGS, so we need it unset
to allow different flags for the build and target hosts. We can still
include its contents in the latter variables for convenience though.

It should not be necessary for ebuilds to figure out which Rust ABI is
applicable in order to set flags only for the target host, so the helper
reads from a simple CARGO_TARGET_RUSTFLAGS variable without the triple
for convenience.

Unfortunately, I have not yet encountered a package that makes use of
CARGO_BUILD_RUSTFLAGS while cross-compiling, but as far as I can tell,
it should work.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 47 +++--
 1 file changed, 33 insertions(+), 14 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index b6d5fe21f0a7b..596598ca8585a 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -527,27 +527,46 @@ cargo_src_configure() {
 # @USAGE: Command with its arguments
 # @DESCRIPTION:
 # Run the given command under an environment needed for performing tasks with
-# Cargo such as building.
+# Cargo such as building. RUSTFLAGS is used for both the build and target host.
+# CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_RUSTFLAGS are used for just the build
+# host and target host respectively. Ensure these are set consistently between
+# Cargo invocations, otherwise rebuilds will occur.
 cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG

+   # Set vars for cc-rs crate.
+   tc-export_build_env
+   local -x \
+   HOST_AR=$(tc-getBUILD_AR)
+   HOST_CC=$(tc-getBUILD_CC)
+   HOST_CXX=$(tc-getBUILD_CXX)
+   HOST_CFLAGS=${BUILD_CFLAGS}
+   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+
+   # The default linker is "cc" so override by setting linker to CC in the
+   # RUSTFLAGS. The given linker cannot include any arguments, so split 
these
+   # into link-args along with LDFLAGS. Also include external RUSTFLAGS.
+   local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
+   local -x CARGO_BUILD_RUSTFLAGS="${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS} 
-C linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && local CARGO_BUILD_RUSTFLAGS+="$(printf -- ' 
-C link-arg=%s' "${LD_A[@]:1}")"
+
if tc-is-cross-compiler; then
-   declare -x CARGO_BUILD_TARGET=$(rust_abi)
-   local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
-
-   # Set vars for cc-rs crate.
-   tc-export_build_env
-   declare -x \
-   HOST_AR=$(tc-getBUILD_AR)
-   HOST_CC=$(tc-getBUILD_CC)
-   HOST_CXX=$(tc-getBUILD_CXX)
-   HOST_CFLAGS=${BUILD_CFLAGS}
-   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+   local -x CARGO_BUILD_TARGET=$(rust_abi)
+   local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
+   local -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && local 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
+   else
+   CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
fi

-   "${@}"
+   (
+   # Bare RUSTFLAGS will override the above, even if empty, so 
unset it
+   # locally. Do this in a subshell so that it remains set 
afterwards.
+   unset RUSTFLAGS
+
+   "${@}"
+   )
 }

 # @FUNCTION: cargo_src_compile
--
2.45.2



[gentoo-dev] [PATCH 1/5 v3] cargo.eclass: Add cargo_env helper and use it in compile, test, install

2024-07-25 Thread James Le Cuirot
Rust packages have a tendency to rebuild parts during test and install.
It is not clear whether this can be addressed. We were therefore relying
on some environment variables set during the compile phase for
cross-compiling to work in the later phases. This is not ideal,
especially if you need to build for multiple targets.

These environment variables can also be useful in other contexts, such
as the build runner in app-misc/anki.

This change moves the setting of these variables into a separate helper
that is now used in all these phases and can be used by ebuilds too. The
variables are now kept local to each invocation of this helper,
preventing leakage.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 37 +++--
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 7db34efb4e174..b6d5fe21f0a7b 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -523,26 +523,23 @@ cargo_src_configure() {
[[ ${ECARGO_ARGS[@]} ]] && einfo "Configured with: ${ECARGO_ARGS[@]}"
 }

-# @FUNCTION: cargo_src_compile
+# @FUNCTION: cargo_env
+# @USAGE: Command with its arguments
 # @DESCRIPTION:
-# Build the package using cargo build.
-cargo_src_compile() {
-   debug-print-function ${FUNCNAME} "$@"
-
-   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
-   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
-
+# Run the given command under an environment needed for performing tasks with
+# Cargo such as building.
+cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG

if tc-is-cross-compiler; then
-   export CARGO_BUILD_TARGET=$(rust_abi)
+   declare -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   export CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)

# Set vars for cc-rs crate.
tc-export_build_env
-   export \
+   declare -x \
HOST_AR=$(tc-getBUILD_AR)
HOST_CC=$(tc-getBUILD_CC)
HOST_CXX=$(tc-getBUILD_CXX)
@@ -550,9 +547,21 @@ cargo_src_compile() {
HOST_CXXFLAGS=${BUILD_CXXFLAGS}
fi

+   "${@}"
+}
+
+# @FUNCTION: cargo_src_compile
+# @DESCRIPTION:
+# Build the package using cargo build.
+cargo_src_compile() {
+   debug-print-function ${FUNCNAME} "$@"
+
+   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
+
set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo build failed"
+   cargo_env "${@}" || die "cargo build failed"
 }

 # @FUNCTION: cargo_src_install
@@ -573,7 +582,7 @@ cargo_src_install() {
$(usex debug --debug "") \
${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo install failed"
+   cargo_env "${@}" || die "cargo install failed"

rm -f "${ED}/usr/.crates.toml" || die
rm -f "${ED}/usr/.crates2.json" || die
@@ -590,7 +599,7 @@ cargo_src_test() {

set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo test failed"
+   cargo_env "${@}" || die "cargo test failed"
 }

 fi
--
2.45.2



Re: [gentoo-dev] [PATCH 1/3] cargo.eclass: Add cargo_env helper and use it in compile, test, install

2024-07-25 Thread James Le Cuirot
On Wed, 2024-07-24 at 18:14 -0400, Eli Schwartz wrote:
> On 7/24/24 6:07 PM, James Le Cuirot wrote:
> > Rust packages have a tendency to rebuild parts during test and install.
> > It is not clear whether this can be addressed. We were therefore relying
> > on some environment variables set during the compile phase for
> > cross-compiling to work in the later phases. This is not ideal,
> > especially if you need to build for multiple targets.
> 
> 
> Oof, yeah, as I mentioned on Monday in -dev, I have a package that
> actually produces meaningfully different programs if you rebuild it
> during test.
> 
> dev-util/ruff will, when built with FEATURES=test, not show color when
> you run it. Don't know why, feel a bit too freaked out about rebuilding
> for tests *at all* to even think about fixing this in a "src_test
> compatible way".
> 
> So I wonder if maybe we can somehow switch to e.g. doing the test phase
> in a different directory such that it doesn't modify the artifacts we
> actually want to install.

It can happen due to files or environment variables changing. It sounds like
the tests inadvertently cause that in this case. You could copy the
$(cargo_target_dir) to $(cargo_target_dir)-test and then set CARGO_TARGET_DIR
to the latter before running the tests.


signature.asc
Description: This is a digitally signed message part


Re: [gentoo-dev] [PATCH] savedconfig.eclass: Drop support for EAPI 6

2024-07-25 Thread James Le Cuirot
On Thu, 2024-07-25 at 07:35 +0200, Ulrich Müller wrote:
> Signed-off-by: Ulrich Müller 
> ---
>  eclass/savedconfig.eclass | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/eclass/savedconfig.eclass b/eclass/savedconfig.eclass
> index cc5748543078..65a1f3bfd800 100644
> --- a/eclass/savedconfig.eclass
> +++ b/eclass/savedconfig.eclass
> @@ -1,10 +1,10 @@
> -# Copyright 1999-2023 Gentoo Authors
> +# Copyright 1999-2024 Gentoo Authors
>  # Distributed under the terms of the GNU General Public License v2
>  
>  # @ECLASS: savedconfig.eclass
>  # @MAINTAINER:
>  # base-sys...@gentoo.org
> -# @SUPPORTED_EAPIS: 6 7 8
> +# @SUPPORTED_EAPIS: 7 8
>  # @BLURB: common API for saving/restoring complex configuration files
>  # @DESCRIPTION:
>  # It is not uncommon to come across a package which has a very fine
> @@ -31,7 +31,7 @@
>  # build.
>  
>  case ${EAPI} in
> - 6|7|8) ;;
> + 7|8) ;;
>   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
>  esac
>  
> @@ -60,12 +60,12 @@ save_config() {
>   if [[ $# -eq 1 && -f $1 ]] ; then
>   # Just one file, so have the ${configfile} be that config file
>   dodir "${configfile%/*}"
> - cp "$@" "${ED%/}/${configfile}" || die "failed to save $*"
> + cp "$@" "${ED}/${configfile}" || die "failed to save $*"
>   else
>   # A dir, or multiple files, so have the ${configfile} be a dir
>   # with all the saved stuff below it
>   dodir "${configfile}"
> - treecopy "$@" "${ED%/}/${configfile}" || die "failed to save $*"
> + treecopy "$@" "${ED}/${configfile}" || die "failed to save $*"
>   fi
>  
>   elog "Your configuration for ${CATEGORY}/${PF} has been saved in "
> @@ -150,7 +150,7 @@ savedconfig_pkg_postinst() {
>   # are worse :/.
>  
>   if use savedconfig ; then
> - find "${EROOT%/}/etc/portage/savedconfig/${CATEGORY}/${PF}" \
> + find "${EROOT}/etc/portage/savedconfig/${CATEGORY}/${PF}" \
>   -exec touch {} + 2>/dev/null
>   fi
>  }

Ack.


signature.asc
Description: This is a digitally signed message part


[gentoo-dev] [PATCH 3/3 v2] cargo.eclass: Explicitly tell rustc not to strip binaries

2024-07-24 Thread James Le Cuirot
Most projects don't strip binaries in release mode by default, but there
are exceptions like app-misc/broot.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 9ccd482e6b2d1..2a71b6c938fb6 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -548,13 +548,13 @@ cargo_env() {
# RUSTFLAGS. The given linker cannot include any arguments, so split 
these
# into link-args along with LDFLAGS. Also include external RUSTFLAGS.
local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
-   declare -x CARGO_BUILD_RUSTFLAGS="${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS} 
-C linker=${LD_A[0]}"
+   declare -x CARGO_BUILD_RUSTFLAGS="-C strip=none ${RUSTFLAGS} 
${CARGO_BUILD_RUSTFLAGS} -C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && declare CARGO_BUILD_RUSTFLAGS+="$(printf -- 
' -C link-arg=%s' "${LD_A[@]:1}")"

if tc-is-cross-compiler; then
declare -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
-   declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="-C strip=none 
${RUSTFLAGS} ${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && declare 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
else
CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
--
2.45.2



[gentoo-dev] [PATCH 2/3 v2] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better

2024-07-24 Thread James Le Cuirot
LDFLAGS are not currently honoured by Cargo builds at all. It would be
particularly advantageous to honour -fuse-ld because alternative linkers
like mold are known to be significantly faster at handling Rust.

As things stand, the eclass sets the linker to CC when cross-compiling,
but it does so erroneously due to a shell quoting issue. If CC includes
arguments, an error occurs when setting the CARGO_TARGET_*_LINKER
variable. Even with the right quoting, Cargo still fails because this
variable is not allowed to include arguments. They have to be specified
via RUSTFLAGS instead.

We would also like to configure the build host linker properly when
cross-compiling, but strangely there is no equivalent linker variable
for the build host. It can only be set via RUSTFLAGS. For consistency,
we now use RUSTFLAGS for the target host linker as well.

Some ebuilds already set RUSTFLAGS, so some consideration was given to
how to handle these. When set, Cargo prioritises RUSTFLAGS over
CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_*_RUSTFLAGS, so we need it unset
to allow different flags for the build and target hosts. We can still
include its contents in the latter variables for convenience though.

It should not be necessary for ebuilds to figure out which Rust ABI is
applicable in order to set flags only for the target host, so the helper
reads from a simple CARGO_TARGET_RUSTFLAGS variable without the triple
for convenience.

Unfortunately, I have not yet encountered a package that makes use of
CARGO_BUILD_RUSTFLAGS while cross-compiling, but as far as I can tell,
it should work.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 45 -
 1 file changed, 32 insertions(+), 13 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index b6d5fe21f0a7b..9ccd482e6b2d1 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -527,27 +527,46 @@ cargo_src_configure() {
 # @USAGE: Command with its arguments
 # @DESCRIPTION:
 # Run the given command under an environment needed for performing tasks with
-# Cargo such as building.
+# Cargo such as building. RUSTFLAGS is used for both the build and target host.
+# CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_RUSTFLAGS are used for just the build
+# host and target host respectively. Ensure these are set consistently between
+# Cargo invocations, otherwise rebuilds will occur.
 cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG

+   # Set vars for cc-rs crate.
+   tc-export_build_env
+   declare -x \
+   HOST_AR=$(tc-getBUILD_AR)
+   HOST_CC=$(tc-getBUILD_CC)
+   HOST_CXX=$(tc-getBUILD_CXX)
+   HOST_CFLAGS=${BUILD_CFLAGS}
+   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+
+   # The default linker is "cc" so override by setting linker to CC in the
+   # RUSTFLAGS. The given linker cannot include any arguments, so split 
these
+   # into link-args along with LDFLAGS. Also include external RUSTFLAGS.
+   local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
+   declare -x CARGO_BUILD_RUSTFLAGS="${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS} 
-C linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && declare CARGO_BUILD_RUSTFLAGS+="$(printf -- 
' -C link-arg=%s' "${LD_A[@]:1}")"
+
if tc-is-cross-compiler; then
declare -x CARGO_BUILD_TARGET=$(rust_abi)
-   local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
-
-   # Set vars for cc-rs crate.
-   tc-export_build_env
-   declare -x \
-   HOST_AR=$(tc-getBUILD_AR)
-   HOST_CC=$(tc-getBUILD_CC)
-   HOST_CXX=$(tc-getBUILD_CXX)
-   HOST_CFLAGS=${BUILD_CFLAGS}
-   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+   local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS} -C linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && declare 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
+   else
+   CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
fi

-   "${@}"
+   (
+   # Bare RUSTFLAGS will override the above, even if empty, so 
unset it
+   # locally. Do this in a subshell so that it remains set 
afterwards.
+   unset RUSTFLAGS
+
+   "${@}"
+   )
 }

 # @FUNCTION: cargo_src_compile
--
2.45.2



[gentoo-dev] [PATCH 1/3 v2] cargo.eclass: Add cargo_env helper and use it in compile, test, install

2024-07-24 Thread James Le Cuirot
Rust packages have a tendency to rebuild parts during test and install.
It is not clear whether this can be addressed. We were therefore relying
on some environment variables set during the compile phase for
cross-compiling to work in the later phases. This is not ideal,
especially if you need to build for multiple targets.

These environment variables can also be useful in other contexts, such
as the build runner in app-misc/anki.

This change moves the setting of these variables into a separate helper
that is now used in all these phases and can be used by ebuilds too. The
variables are now kept local to each invocation of this helper,
preventing leakage.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 37 +++--
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 7db34efb4e174..b6d5fe21f0a7b 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -523,26 +523,23 @@ cargo_src_configure() {
[[ ${ECARGO_ARGS[@]} ]] && einfo "Configured with: ${ECARGO_ARGS[@]}"
 }

-# @FUNCTION: cargo_src_compile
+# @FUNCTION: cargo_env
+# @USAGE: Command with its arguments
 # @DESCRIPTION:
-# Build the package using cargo build.
-cargo_src_compile() {
-   debug-print-function ${FUNCNAME} "$@"
-
-   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
-   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
-
+# Run the given command under an environment needed for performing tasks with
+# Cargo such as building.
+cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG

if tc-is-cross-compiler; then
-   export CARGO_BUILD_TARGET=$(rust_abi)
+   declare -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   export CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)

# Set vars for cc-rs crate.
tc-export_build_env
-   export \
+   declare -x \
HOST_AR=$(tc-getBUILD_AR)
HOST_CC=$(tc-getBUILD_CC)
HOST_CXX=$(tc-getBUILD_CXX)
@@ -550,9 +547,21 @@ cargo_src_compile() {
HOST_CXXFLAGS=${BUILD_CXXFLAGS}
fi

+   "${@}"
+}
+
+# @FUNCTION: cargo_src_compile
+# @DESCRIPTION:
+# Build the package using cargo build.
+cargo_src_compile() {
+   debug-print-function ${FUNCNAME} "$@"
+
+   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
+
set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo build failed"
+   cargo_env "${@}" || die "cargo build failed"
 }

 # @FUNCTION: cargo_src_install
@@ -573,7 +582,7 @@ cargo_src_install() {
$(usex debug --debug "") \
${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo install failed"
+   cargo_env "${@}" || die "cargo install failed"

rm -f "${ED}/usr/.crates.toml" || die
rm -f "${ED}/usr/.crates2.json" || die
@@ -590,7 +599,7 @@ cargo_src_test() {

set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo test failed"
+   cargo_env "${@}" || die "cargo test failed"
 }

 fi
--
2.45.2



[gentoo-dev] [PATCH 3/3] cargo.eclass: Explicitly tell rustc not to strip binaries

2024-07-24 Thread James Le Cuirot
Most projects don't strip binaries in release mode by default, but there
are exceptions like app-misc/broot.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 65eaee6f84e4b..7ae40608aeb5a 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -550,14 +550,14 @@ cargo_env() {
local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
declare -x CARGO_BUILD_RUSTFLAGS="-C linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && declare CARGO_BUILD_RUSTFLAGS+="$(printf -- 
' -C link-arg=%s' "${LD_A[@]:1}")"
-   declare CARGO_BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS}"
+   declare CARGO_BUILD_RUSTFLAGS+=" -C strip=none ${RUSTFLAGS} 
${CARGO_BUILD_RUSTFLAGS}"
 
if tc-is-cross-compiler; then
declare -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="-C 
linker=${LD_A[0]}"
[[ ${#LD_A[@]} -gt 1 ]] && declare 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
-   declare CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+=" ${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS}"
+   declare CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+=" -C strip=none 
${RUSTFLAGS} ${CARGO_TARGET_RUSTFLAGS}"
else
CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
fi
-- 
2.45.2




[gentoo-dev] [PATCH 2/3] cargo.eclass: Handle LDFLAGS and RUSTFLAGS better

2024-07-24 Thread James Le Cuirot
LDFLAGS are not currently honoured by Cargo builds at all. It would be
particularly advantageous to honour -fuse-ld because alternative linkers
like mold are known to be significantly faster at handling Rust.

As things stand, the eclass sets the linker to CC when cross-compiling,
but it does so erroneously due to a shell quoting issue. If CC includes
arguments, an error occurs when setting the CARGO_TARGET_*_LINKER
variable. Even with the right quoting, Cargo still fails because this
variable is not allowed to include arguments. They have to be specified
via RUSTFLAGS instead.

We would also like to configure the build host linker properly when
cross-compiling, but strangely there is no equivalent linker variable
for the build host. It can only be set via RUSTFLAGS. For consistency,
we now use RUSTFLAGS for the target host linker as well.

Some ebuilds already set RUSTFLAGS, so some consideration was given to
how to handle these. When set, Cargo prioritises RUSTFLAGS over
CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_*_RUSTFLAGS, so we need it unset
to allow different flags for the build and target hosts. We can still
include its contents in the latter variables for convenience though.

It should not be necessary for ebuilds to figure out which Rust ABI is
applicable in order to set flags only for the target host, so the helper
reads from a simple CARGO_TARGET_RUSTFLAGS variable without the triple
for convenience.

Unfortunately, I have not yet encountered a package that makes use of
CARGO_BUILD_RUSTFLAGS while cross-compiling, but as far as I can tell,
it should work.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 47 -
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index b6d5fe21f0a7b..65eaee6f84e4b 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -527,27 +527,48 @@ cargo_src_configure() {
 # @USAGE: Command with its arguments
 # @DESCRIPTION:
 # Run the given command under an environment needed for performing tasks with
-# Cargo such as building.
+# Cargo such as building. RUSTFLAGS is used for both the build and target host.
+# CARGO_BUILD_RUSTFLAGS and CARGO_TARGET_RUSTFLAGS are used for just the build
+# host and target host respectively. Ensure these are set consistently between
+# Cargo invocations, otherwise rebuilds will occur.
 cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG
 
+   # Set vars for cc-rs crate.
+   tc-export_build_env
+   declare -x \
+   HOST_AR=$(tc-getBUILD_AR)
+   HOST_CC=$(tc-getBUILD_CC)
+   HOST_CXX=$(tc-getBUILD_CXX)
+   HOST_CFLAGS=${BUILD_CFLAGS}
+   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+
+   # The default linker is "cc" so override by setting linker to CC in the
+   # RUSTFLAGS. The given linker cannot include any arguments, so split 
these
+   # into link-args along with LDFLAGS. Also include external RUSTFLAGS.
+   local LD_A=( ${HOST_CC} ${BUILD_LDFLAGS} )
+   declare -x CARGO_BUILD_RUSTFLAGS="-C linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && declare CARGO_BUILD_RUSTFLAGS+="$(printf -- 
' -C link-arg=%s' "${LD_A[@]:1}")"
+   declare CARGO_BUILD_RUSTFLAGS+=" ${RUSTFLAGS} ${CARGO_BUILD_RUSTFLAGS}"
+
if tc-is-cross-compiler; then
declare -x CARGO_BUILD_TARGET=$(rust_abi)
-   local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
-
-   # Set vars for cc-rs crate.
-   tc-export_build_env
-   declare -x \
-   HOST_AR=$(tc-getBUILD_AR)
-   HOST_CC=$(tc-getBUILD_CC)
-   HOST_CXX=$(tc-getBUILD_CXX)
-   HOST_CFLAGS=${BUILD_CFLAGS}
-   HOST_CXXFLAGS=${BUILD_CXXFLAGS}
+   local TRIPLE=${CARGO_BUILD_TARGET//-/_} LD_A=( $(tc-getCC) 
${LDFLAGS} )
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS="-C 
linker=${LD_A[0]}"
+   [[ ${#LD_A[@]} -gt 1 ]] && declare 
CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+="$(printf -- ' -C link-arg=%s' 
"${LD_A[@]:1}")"
+   declare CARGO_TARGET_"${TRIPLE^^}"_RUSTFLAGS+=" ${RUSTFLAGS} 
${CARGO_TARGET_RUSTFLAGS}"
+   else
+   CARGO_BUILD_RUSTFLAGS+=" ${CARGO_TARGET_RUSTFLAGS}"
fi
 
-   "${@}"
+   (
+   # Bare RUSTFLAGS will override the above, even if empty, so 
unset it
+   # locally. Do this in a subshell so that it remains set 
afterwards.
+   unset RUSTFLAGS
+
+   "${@}"
+   )
 }
 
 # @FUNCTION: cargo_src_compile
-- 
2.45.2




[gentoo-dev] [PATCH 1/3] cargo.eclass: Add cargo_env helper and use it in compile, test, install

2024-07-24 Thread James Le Cuirot
Rust packages have a tendency to rebuild parts during test and install.
It is not clear whether this can be addressed. We were therefore relying
on some environment variables set during the compile phase for
cross-compiling to work in the later phases. This is not ideal,
especially if you need to build for multiple targets.

These environment variables can also be useful in other contexts, such
as the build runner in app-misc/anki.

This change moves the setting of these variables into a separate helper
that is now used in all these phases and can be used by ebuilds too. The
variables are now kept local to each invocation of this helper,
preventing leakage.

Signed-off-by: James Le Cuirot 
---
 eclass/cargo.eclass | 37 +++--
 1 file changed, 23 insertions(+), 14 deletions(-)

diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
index 7db34efb4e174..b6d5fe21f0a7b 100644
--- a/eclass/cargo.eclass
+++ b/eclass/cargo.eclass
@@ -523,26 +523,23 @@ cargo_src_configure() {
[[ ${ECARGO_ARGS[@]} ]] && einfo "Configured with: ${ECARGO_ARGS[@]}"
 }
 
-# @FUNCTION: cargo_src_compile
+# @FUNCTION: cargo_env
+# @USAGE: Command with its arguments
 # @DESCRIPTION:
-# Build the package using cargo build.
-cargo_src_compile() {
-   debug-print-function ${FUNCNAME} "$@"
-
-   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
-   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
-
+# Run the given command under an environment needed for performing tasks with
+# Cargo such as building.
+cargo_env() {
filter-lto
tc-export AR CC CXX PKG_CONFIG
 
if tc-is-cross-compiler; then
-   export CARGO_BUILD_TARGET=$(rust_abi)
+   declare -x CARGO_BUILD_TARGET=$(rust_abi)
local TRIPLE=${CARGO_BUILD_TARGET//-/_}
-   export CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
+   declare -x CARGO_TARGET_"${TRIPLE^^}"_LINKER=$(tc-getCC)
 
# Set vars for cc-rs crate.
tc-export_build_env
-   export \
+   declare -x \
HOST_AR=$(tc-getBUILD_AR)
HOST_CC=$(tc-getBUILD_CC)
HOST_CXX=$(tc-getBUILD_CXX)
@@ -550,9 +547,21 @@ cargo_src_compile() {
HOST_CXXFLAGS=${BUILD_CXXFLAGS}
fi
 
+   "${@}"
+}
+
+# @FUNCTION: cargo_src_compile
+# @DESCRIPTION:
+# Build the package using cargo build.
+cargo_src_compile() {
+   debug-print-function ${FUNCNAME} "$@"
+
+   [[ ${_CARGO_GEN_CONFIG_HAS_RUN} ]] || \
+   die "FATAL: please call cargo_gen_config before using 
${FUNCNAME}"
+
set -- cargo build $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo build failed"
+   cargo_env "${@}" || die "cargo build failed"
 }
 
 # @FUNCTION: cargo_src_install
@@ -573,7 +582,7 @@ cargo_src_install() {
$(usex debug --debug "") \
${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo install failed"
+   cargo_env "${@}" || die "cargo install failed"
 
rm -f "${ED}/usr/.crates.toml" || die
rm -f "${ED}/usr/.crates2.json" || die
@@ -590,7 +599,7 @@ cargo_src_test() {
 
set -- cargo test $(usex debug "" --release) ${ECARGO_ARGS[@]} "$@"
einfo "${@}"
-   "${@}" || die "cargo test failed"
+   cargo_env "${@}" || die "cargo test failed"
 }
 
 fi
-- 
2.45.2




[gentoo-dev] Last rites: app-accessibility/epos

2024-07-24 Thread Sam James
# Sam James  (2024-07-24)
# Fails to build with GCC 15, several open bugs
# including test failures. Unpackaged by others.
# Removal on 2024-08-23.  Bug #936581.
app-accessibility/epos


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH 8/8] dev-lang/go: Use go-env.eclass in 1.22.5 and 9999

2024-07-09 Thread James Le Cuirot
This deduplicates some helper functions.

Signed-off-by: James Le Cuirot 
---
 dev-lang/go/go-1.22.5.ebuild | 65 +---
 dev-lang/go/go-.ebuild   | 65 +---
 2 files changed, 18 insertions(+), 112 deletions(-)

diff --git a/dev-lang/go/go-1.22.5.ebuild b/dev-lang/go/go-1.22.5.ebuild
index fc36a2d33ae98..b16e86ae904f0 100644
--- a/dev-lang/go/go-1.22.5.ebuild
+++ b/dev-lang/go/go-1.22.5.ebuild
@@ -10,7 +10,7 @@ export CTARGET=${CTARGET:-${CHOST}}
 GO_BOOTSTRAP_MIN=1.20.14
 MY_PV=${PV/_/}
 
-inherit toolchain-funcs
+inherit go-env toolchain-funcs
 
 case ${PV}  in
 **)
@@ -33,7 +33,7 @@ HOMEPAGE="https://go.dev";
 
 LICENSE="BSD"
 SLOT="0/${PV}"
-IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
+IUSE="cpu_flags_x86_sse2"
 
 RDEPEND="
 arm? ( sys-devel/binutils[gold] )
@@ -66,55 +66,8 @@ DOCS=(
SECURITY.md
 )
 
-go_arch() {
-   # By chance most portage arch names match Go
-   local tc_arch=$(tc-arch $@)
-   case "${tc_arch}" in
-   x86)echo 386;;
-   x64-*)  echo amd64;;
-   loong)  echo loong64;;
-   mips) if use abi_mips_o32; then
-   [[ $(tc-endian $@) = big ]] && echo mips || 
echo mipsle
-   elif use abi_mips_n64; then
-   [[ $(tc-endian $@) = big ]] && echo mips64 || 
echo mips64le
-   fi ;;
-   ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo 
ppc64le ;;
-   riscv) echo riscv64 ;;
-   s390) echo s390x ;;
-   *)  echo "${tc_arch}";;
-   esac
-}
-
-go_arm() {
-   case "${1:-${CHOST}}" in
-   armv5*) echo 5;;
-   armv6*) echo 6;;
-   armv7*) echo 7;;
-   *)
-   die "unknown GOARM for ${1:-${CHOST}}"
-   ;;
-   esac
-}
-
-go_os() {
-   case "${1:-${CHOST}}" in
-   *-linux*)   echo linux;;
-   *-darwin*)  echo darwin;;
-   *-freebsd*) echo freebsd;;
-   *-netbsd*)  echo netbsd;;
-   *-openbsd*) echo openbsd;;
-   *-solaris*) echo solaris;;
-   *-cygwin*|*-interix*|*-winnt*)
-   echo windows
-   ;;
-   *)
-   die "unknown GOOS for ${1:-${CHOST}}"
-   ;;
-   esac
-}
-
 go_tuple() {
-   echo "$(go_os $@)_$(go_arch $@)"
+   echo "$(go-env_goos $@)_$(go-env_goarch $@)"
 }
 
 go_cross_compile() {
@@ -140,16 +93,16 @@ src_compile() {
export GOBIN="${GOROOT}/bin"
 
# Go's build script does not use BUILD/HOST/TARGET consistently. :(
-   export GOHOSTARCH=$(go_arch ${CBUILD})
-   export GOHOSTOS=$(go_os ${CBUILD})
+   export GOHOSTARCH=$(go-env_goarch ${CBUILD})
+   export GOHOSTOS=$(go-env_goos ${CBUILD})
export CC=$(tc-getBUILD_CC)
 
-   export GOARCH=$(go_arch)
-   export GOOS=$(go_os)
+   export GOARCH=$(go-env_goarch)
+   export GOOS=$(go-env_goos)
export CC_FOR_TARGET=$(tc-getCC)
export CXX_FOR_TARGET=$(tc-getCXX)
-   use arm && export GOARM=$(go_arm)
-   use x86 && export GO386=$(usex cpu_flags_x86_sse2 '' 'softfloat')
+   use arm && export GOARM=$(go-env_goarm)
+   use x86 && export GO386=$(go-env_go386)
 
cd src
bash -x ./make.bash || die "build failed"
diff --git a/dev-lang/go/go-.ebuild b/dev-lang/go/go-.ebuild
index fc36a2d33ae98..b16e86ae904f0 100644
--- a/dev-lang/go/go-.ebuild
+++ b/dev-lang/go/go-.ebuild
@@ -10,7 +10,7 @@ export CTARGET=${CTARGET:-${CHOST}}
 GO_BOOTSTRAP_MIN=1.20.14
 MY_PV=${PV/_/}
 
-inherit toolchain-funcs
+inherit go-env toolchain-funcs
 
 case ${PV}  in
 **)
@@ -33,7 +33,7 @@ HOMEPAGE="https://go.dev";
 
 LICENSE="BSD"
 SLOT="0/${PV}"
-IUSE="abi_mips_o32 abi_mips_n64 cpu_flags_x86_sse2"
+IUSE="cpu_flags_x86_sse2"
 
 RDEPEND="
 arm? ( sys-devel/binutils[gold] )
@@ -66,55 +66,8 @@ DOCS=(
SECURITY.md
 )
 
-go_arch() {
-   # By chance most portage arch names match Go
-   local tc_arch=$(tc-arch $@)
-   case "${tc_arch}" in
-   x86)echo 386;;
-   x64-*)  echo amd64;;
-   loong)  echo loong64;;
-   mips) if use abi_mips_o32; then
-   [[ $(tc-endian $@) = big ]] && echo mips || 
echo mipsle
-   elif use abi_mips_n64; then
-   [[ $(tc-endian $@) = big ]] && echo mips64 || 
echo mips64le
-

[gentoo-dev] [PATCH 7/8] go-env.eclass: Add the go-env_goos() helper function

2024-07-09 Thread James Le Cuirot
This code is taken from dev-lang/go. No other packages have code like
this, but some erroneously call `go env GOOS`, which is bad for
cross-compiling. They should use this function instead.

Signed-off-by: James Le Cuirot 
---
 eclass/go-env.eclass | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index c839c41be0d7e..be131133113be 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -48,6 +48,24 @@ go-env_set_compile_environment() {
export CGO_LDFLAGS="${CGO_LDFLAGS:-$LDFLAGS}"
 }
 
+# @FUNCTION: go-env_goos
+# @USAGE: [toolchain prefix]
+# @DESCRIPTION:
+# Returns the appropriate GOOS setting for the target operating system.
+go-env_goos() {
+   local target=${1:-${CHOST}}
+   case "${target}" in
+   *-linux*) echo linux ;;
+   *-darwin*) echo darwin ;;
+   *-freebsd*) echo freebsd ;;
+   *-netbsd*) echo netbsd ;;
+   *-openbsd*) echo openbsd ;;
+   *-solaris*) echo solaris ;;
+   *-cygwin*|*-interix*|*-winnt*) echo windows ;;
+   *) die "unknown GOOS for ${target}" ;;
+   esac
+}
+
 # @FUNCTION: go-env_goarch
 # @USAGE: [toolchain prefix]
 # @DESCRIPTION:
-- 
2.45.2




[gentoo-dev] [PATCH 6/8] go-env.eclass: Rewrite the go-env_goarch() logic

2024-07-09 Thread James Le Cuirot
The previous logic was flawed, incomplete, and needlessly made use of
USE flags. We can rely on the tuple instead. Tested against all the
tuples we have in our profiles.

Signed-off-by: James Le Cuirot 
---
 eclass/go-env.eclass | 32 +---
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index c34c634bb6003..c839c41be0d7e 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -53,21 +53,23 @@ go-env_set_compile_environment() {
 # @DESCRIPTION:
 # Returns the appropriate GOARCH setting for the target architecture.
 go-env_goarch() {
-   # By chance most portage arch names match Go
-   local tc_arch=$(tc-arch $@)
-   case "${tc_arch}" in
-   x86)echo 386;;
-   x64-*)  echo amd64;;
-   loong)  echo loong64;;
-   mips) if use abi_mips_o32; then
-   [[ $(tc-endian $@) = big ]] && echo mips || 
echo mipsle
-   elif use abi_mips_n64; then
-   [[ $(tc-endian $@) = big ]] && echo mips64 || 
echo mips64le
-   fi ;;
-   ppc64) [[ $(tc-endian $@) = big ]] && echo ppc64 || echo 
ppc64le ;;
-   riscv) echo riscv64 ;;
-   s390) echo s390x ;;
-   *)  echo "${tc_arch}";;
+   local target=${1:-${CHOST}}
+   # Some Portage arch names match Go.
+   local arch=$(tc-arch "${target}") cpu=${target%%-*}
+   case "${arch}" in
+   x86)echo 386 ;;
+   loong)  echo loong64 ;;
+   *)  case "${cpu}" in
+   aarch64*be) echo arm64be ;;
+   arm64) echo arm64 ;;
+   arm*b*) echo armbe ;;
+   mips64*l*) echo mips64le ;;
+   mips*l*) echo mipsle ;;
+   powerpc64le*) echo ppc64le ;;
+   arm64|s390x) echo "${cpu}" ;;
+   mips64*|riscv64*|sparc64*) echo 
"${arch}64" ;;
+   *) echo "${arch}" ;;
+   esac ;;
esac
 }
 
-- 
2.45.2




[gentoo-dev] [PATCH 5/8] go-env.eclass: Establish EAPI 7 and 8 as supported

2024-07-09 Thread James Le Cuirot
Signed-off-by: James Le Cuirot 
---
 eclass/go-env.eclass | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/eclass/go-env.eclass b/eclass/go-env.eclass
index 1a2c9787a146b..c34c634bb6003 100644
--- a/eclass/go-env.eclass
+++ b/eclass/go-env.eclass
@@ -6,11 +6,17 @@
 # Flatcar Linux Maintainers 
 # @AUTHOR:
 # Flatcar Linux Maintainers 
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: Helper eclass for setting the Go compile environment. Required for 
cross-compiling.
 # @DESCRIPTION:
 # This eclass includes helper functions for setting the compile environment 
for Go ebuilds.
 # Intended to be called by other Go eclasses in an early build stage, e.g. 
src_unpack.
 
+case ${EAPI} in
+   7|8) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
 if [[ -z ${_GO_ENV_ECLASS} ]]; then
 _GO_ENV_ECLASS=1
 
@@ -34,14 +40,7 @@ go-env_set_compile_environment() {
use x86 && export GO386=$(go-env_go386)
 
# XXX: Hack for checking ICE (bug #912152, gcc PR113204)
-   case ${EAPI} in
-   6)
-   has_version "sys-devel/gcc[debug]" && filter-lto
-   ;;
-   *)
-   has_version -b "sys-devel/gcc[debug]" && filter-lto
-   ;;
-   esac
+   has_version -b "sys-devel/gcc[debug]" && filter-lto
 
export CGO_CFLAGS="${CGO_CFLAGS:-$CFLAGS}"
export CGO_CPPFLAGS="${CGO_CPPFLAGS:-$CPPFLAGS}"
-- 
2.45.2




[gentoo-dev] [PATCH 4/8] golang-base.eclass: Drop support for EAPI 5 and 6

2024-07-09 Thread James Le Cuirot
All such usage has gone.

Signed-off-by: James Le Cuirot 
---
 eclass/golang-base.eclass | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/eclass/golang-base.eclass b/eclass/golang-base.eclass
index 4bba00200cfc9..a2996e3b06836 100644
--- a/eclass/golang-base.eclass
+++ b/eclass/golang-base.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: golang-base.eclass
 # @MAINTAINER:
 # William Hubbs 
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 7
 # @BLURB: Eclass that provides base functions for Go packages.
 # @DEPRECATED: go-module.eclass
 # @DESCRIPTION:
@@ -12,12 +12,9 @@
 # programming language; it also provides the build-time dependency on
 # dev-lang/go.
 
-case "${EAPI:-0}" in
-   5|6|7)
-   ;;
-   *)
-   die "${ECLASS}: Unsupported EAPI (EAPI=${EAPI})"
-   ;;
+case ${EAPI} in
+   7) ;;
+   *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
 if [[ -z ${_GOLANG_BASE} ]]; then
-- 
2.45.2




[gentoo-dev] [PATCH 3/8] golang-build.eclass: Drop support for EAPI 6

2024-07-09 Thread James Le Cuirot
All such usage has gone.

Signed-off-by: James Le Cuirot 
---
 eclass/golang-build.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/golang-build.eclass b/eclass/golang-build.eclass
index 235313bd70f5d..b5218ce36572f 100644
--- a/eclass/golang-build.eclass
+++ b/eclass/golang-build.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: golang-build.eclass
 # @MAINTAINER:
 # William Hubbs 
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 7
 # @PROVIDES: golang-base
 # @BLURB: Eclass for compiling go packages.
 # @DEPRECATED: go-module.eclass
@@ -13,7 +13,7 @@
 # functions for software written in the Go programming language.
 
 case ${EAPI} in
-   6|7) ;;
+   7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.45.2




[gentoo-dev] [PATCH 2/8] golang-vcs-snapshot.eclass: Drop support for EAPI 6

2024-07-09 Thread James Le Cuirot
All such usage has gone.

Signed-off-by: James Le Cuirot 
---
 eclass/golang-vcs-snapshot.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/golang-vcs-snapshot.eclass 
b/eclass/golang-vcs-snapshot.eclass
index d34b8a6e913da..a91ddbbe36150 100644
--- a/eclass/golang-vcs-snapshot.eclass
+++ b/eclass/golang-vcs-snapshot.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: golang-vcs-snapshot.eclass
 # @MAINTAINER:
 # William Hubbs 
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 7
 # @PROVIDES: golang-base
 # @BLURB: eclass to unpack VCS snapshot tarballs for Go software
 # @DEPRECATED: go-module.eclass
@@ -45,7 +45,7 @@
 # and add the vendored tarballs to ${WORKDIR}/src/${EGO_PN}/vendor
 
 case ${EAPI} in
-   6|7) ;;
+   7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.45.2




[gentoo-dev] [PATCH 1/8] golang-vcs.eclass: Drop support for EAPI 6

2024-07-09 Thread James Le Cuirot
All such usage has gone.

Signed-off-by: James Le Cuirot 
---
 eclass/golang-vcs.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/golang-vcs.eclass b/eclass/golang-vcs.eclass
index 6f7a837bc15fd..dee040505d237 100644
--- a/eclass/golang-vcs.eclass
+++ b/eclass/golang-vcs.eclass
@@ -1,10 +1,10 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: golang-vcs.eclass
 # @MAINTAINER:
 # William Hubbs 
-# @SUPPORTED_EAPIS: 6 7
+# @SUPPORTED_EAPIS: 7
 # @PROVIDES: golang-base
 # @BLURB: Eclass for fetching and unpacking go repositories.
 # @DEPRECATED: go-module.eclass
@@ -13,7 +13,7 @@
 # of software written in the Go programming language.
 
 case ${EAPI} in
-   6|7) ;;
+   7) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
-- 
2.45.2




Re: [gentoo-dev] Last rites: games-arcade/{spacerider,tuxdash,xsfcave}

2024-07-02 Thread James Le Cuirot
On Tue, 2024-07-02 at 14:39 +0400, Vitaly Zdanevich wrote:
> 
> On 7/2/24 14:12, Sam James wrote:
> > 
> > Vitaly Zdanevich  writes:
> > > > 
> > > > Ancient
> > > 
> > > Oh, ancient games are sooo bad, no ray tracing, no soul.
> > > 
> > Please see https://wiki.gentoo.org/wiki/Project:Council/Code_of_conduct.
>
> Sorry just painful to see when we lose some old cultural artifacts.
> 
> I cannot install it, no screenshots here
>
> Anybody know more about this game? Same screenshots, videos?

You imply that I did this out of hand, simply because they were old, but I
assure you that I did try all of these games first. You could have easily
tried them yourself before sending your message, despite the mask.

I have no problem with having merely old games in our repo. It helps if they
are still actively maintained, but they don't necessarily have to be. In fact,
I have been rather sad to see others drop games in the past. The games still
need to have some merit though. We are not a museum, and I would rather focus
energy on the much better games that still need our attention.

Experiences are subjective, of course, but I seriously doubted I would have
found these games entertaining at the time, let alone now. I'll admit that
TuxDash had some potential. It honoured the look of the original very well,
which I am old enough to have played in the 80s. The maps are entirely random
though, so there is practically no skill involved. A quick search revealed
many other open source clones that are probably much better.

I'll try to be more descriptive in my masks next time.


signature.asc
Description: This is a digitally signed message part


  1   2   3   4   5   6   7   8   9   10   >