summaryrefslogtreecommitdiff
blob: 7d1fde28bacf5a99cd746bf69cbab72c4ac0cc97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
https://bugs.gentoo.org/888954
https://github.com/rpm-software-management/rpm/commit/f401979a4c4829d68e9614860644bdb74b6dda66

From da222f0d82721d17e57d491d2749a4bc44754b9d Mon Sep 17 00:00:00 2001
From: Takuya Wakazono <pastalian46@gmail.com>
Date: Thu, 18 Jan 2024 18:41:11 +0900
Subject: [PATCH] Don't use _nl_msg_cat_cntr if __GLIC__ is not defined

musl doesn't need to use libintl from GNU gettext because it has its
own NLS implementation. Assuming _nl_msg_cat_cntr exists breaks the
build against the musl system.
--- a/lib/tagexts.c
+++ b/lib/tagexts.c
@@ -532,7 +532,7 @@ static int filerequireTag(Header h, rpmtd td, headerGetFlags hgflags)
 
 /* I18N look aside diversions */
 
-#if defined(ENABLE_NLS)
+#if defined(ENABLE_NLS) && (defined(__GLIBC__) || !defined(__linux__))
 extern int _nl_msg_cat_cntr;	/* XXX GNU gettext voodoo */
 #endif
 static const char * const language = "LANGUAGE";
@@ -569,7 +569,9 @@ static int i18nTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags)
 	/* change to en_US for msgkey -> msgid resolution */
 	langval = getenv(language);
 	(void) setenv(language, "en_US", 1);
+#if defined(__GLIBC__) || !defined(__linux__)
         ++_nl_msg_cat_cntr;
+#endif
 
 	msgid = NULL;
 	for (domain = dstring; domain != NULL; domain = de) {
@@ -584,7 +586,9 @@ static int i18nTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags)
 	    (void) setenv(language, langval, 1);
 	else
 	    unsetenv(language);
+#if defined(__GLIBC__) || !defined(__linux__)
         ++_nl_msg_cat_cntr;
+#endif
 
 	if (domain && msgid) {
 	    td->data = dgettext(domain, msgid);