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 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);