commit: 84b00f370a9c8cd4ad26a1757200e106768469d0 Author: Evgeny Grin (Karlson2k) <k2k <AT> drgrin <DOT> dev> AuthorDate: Thu Jun 12 08:32:37 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Jun 12 11:33:34 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84b00f37
net-misc/r8125: fixed build with kernel >=6.15 Closes: https://bugs.gentoo.org/957883 Signed-off-by: Evgeny Grin (Karlson2k) <k2k <AT> drgrin.dev> Part-of: https://github.com/gentoo/gentoo/pull/42556 Closes: https://github.com/gentoo/gentoo/pull/42556 Signed-off-by: Sam James <sam <AT> gentoo.org> net-misc/r8125/r8125-9.013.02-r1.ebuild | 13 ++++++++++++- net-misc/r8125/r8125-9.014.01.ebuild | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/net-misc/r8125/r8125-9.013.02-r1.ebuild b/net-misc/r8125/r8125-9.013.02-r1.ebuild index 37bb1267d83b..58cb8135aa04 100644 --- a/net-misc/r8125/r8125-9.013.02-r1.ebuild +++ b/net-misc/r8125/r8125-9.013.02-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -19,6 +19,17 @@ IUSE="+multi-tx-q ptp +rss use-firmware" CONFIG_CHECK="~!R8169" WARNING_R8169="CONFIG_R8169 is enabled. ${PN} will not be loaded unless kernel driver Realtek 8169 PCI Gigabit Ethernet (CONFIG_R8169) is DISABLED." +src_prepare() { + default + + # Replace wrong EXTRA_CFLAGS (stopped working with kernels >= 6.15) + # with proper CFLAGS_MODULE (available since 2.6.36). + # Bug 957883 + sed -E -i'' \ + -e 's/(^|[^A-Za-z0-9_])EXTRA_CFLAGS([^A-Za-z0-9_]|$)/\1CFLAGS_MODULE\2/g' \ + src/Makefile || die +} + src_compile() { local modlist=( ${PN}=kernel/drivers/net/ethernet/realtek:src ) local modargs=( diff --git a/net-misc/r8125/r8125-9.014.01.ebuild b/net-misc/r8125/r8125-9.014.01.ebuild index c03c4b4de53e..5dc53cd5e0a9 100644 --- a/net-misc/r8125/r8125-9.014.01.ebuild +++ b/net-misc/r8125/r8125-9.014.01.ebuild @@ -23,6 +23,17 @@ PATCHES=( CONFIG_CHECK="~!R8169" WARNING_R8169="CONFIG_R8169 is enabled. ${PN} will not be loaded unless kernel driver Realtek 8169 PCI Gigabit Ethernet (CONFIG_R8169) is DISABLED." +src_prepare() { + default + + # Replace wrong EXTRA_CFLAGS (stopped working with kernels >= 6.15) + # with proper CFLAGS_MODULE (available since 2.6.36). + # Bug 957883 + sed -E -i'' \ + -e 's/(^|[^A-Za-z0-9_])EXTRA_CFLAGS([^A-Za-z0-9_]|$)/\1CFLAGS_MODULE\2/g' \ + src/Makefile || die +} + src_compile() { local modlist=( ${PN}=kernel/drivers/net/ethernet/realtek:src ) local modargs=(