commit:     23ec705c9293c26ed2f6ae88c5191f7df3d12410
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 21 00:27:41 2025 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Feb 21 00:28:39 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=23ec705c

sys-power/powertop: Fix build with gettext >= 0.23

Closes: https://bugs.gentoo.org/945828
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 .../powertop/files/powertop-2.15-gettext.patch     | 49 ++++++++++++++++++++++
 sys-power/powertop/powertop-2.15.ebuild            |  1 +
 2 files changed, 50 insertions(+)

diff --git a/sys-power/powertop/files/powertop-2.15-gettext.patch 
b/sys-power/powertop/files/powertop-2.15-gettext.patch
new file mode 100644
index 000000000000..243cb11dd9ba
--- /dev/null
+++ b/sys-power/powertop/files/powertop-2.15-gettext.patch
@@ -0,0 +1,49 @@
+https://bugs.gentoo.org/945828
+
+From bd1c81e3e5e5f0af348fed5881c550432a275075 Mon Sep 17 00:00:00 2001
+From: Matt Turner <[email protected]>
+Date: Tue, 3 Dec 2024 19:42:33 -0500
+Subject: [PATCH] build: Use AM_GNU_GETTEXT_REQUIRE_VERSION and require 0.19.6
+
+This bumps the version requirement from 0.19 (from 2014) to 0.19.6
+(2015).
+
+Using only the old AM_GNU_GETTEXT_VERSION results in old gettext
+infrastructure being placed in the package. By using both macros we get
+the latest gettext files while the other programs in the Autotools
+family can still see the old macro.
+
+Otherwise, with gettext-0.23 we get
+
+```
+*** error: gettext infrastructure mismatch: using a Makefile.in.in from 
gettext version 0.18 but the autoconf macros are from gettext version 0.22
+```
+
+Equivalent to the commit to xz.git here:
+https://git.tukaani.org/?p=xz.git;a=commit;h=3d576cf92158d62790017ad7f2dd6dc1dd6b42bb
+---
+ configure.ac | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git ./configure.ac ./configure.ac
+index c698818..2349c3c 100644
+--- ./configure.ac
++++ ./configure.ac
+@@ -24,8 +24,13 @@ AC_CONFIG_HEADERS([config.h])
+ GETTEXT_PACKAGE=powertop
+ AC_SUBST([GETTEXT_PACKAGE])
+ AM_SILENT_RULES([yes])
++
++dnl Support for _REQUIRE_VERSION was added in gettext 0.19.6. If both
++dnl _REQUIRE_VERSION and _VERSION are present, the _VERSION is ignored.
++dnl We use both for compatibility with other programs in the Autotools family.
+ AM_GNU_GETTEXT([external])
+-AM_GNU_GETTEXT_VERSION([0.18.2])
++AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
++AM_GNU_GETTEXT_VERSION([0.19.6])
+ 
+ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+ AX_REQUIRE_DEFINED([AX_ADD_FORTIFY_SOURCE])
+-- 
+2.45.3
+

diff --git a/sys-power/powertop/powertop-2.15.ebuild 
b/sys-power/powertop/powertop-2.15.ebuild
index 91149b6a6d1b..e3c075a2ce6f 100644
--- a/sys-power/powertop/powertop-2.15.ebuild
+++ b/sys-power/powertop/powertop-2.15.ebuild
@@ -40,6 +40,7 @@ RDEPEND="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.8-ncurses_tinfo.patch
+       "${FILESDIR}"/${PN}-2.15-gettext.patch
 )
 
 pkg_setup() {

Reply via email to