From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/rpm/, app-arch/rpm/files/
Date: Fri, 2 Feb 2024 03:58:22 +0000 (UTC) [thread overview]
Message-ID: <1706846216.191bd72e6913e1c56736e801e0fb9e1f7262cfb2.sam@gentoo> (raw)
commit: 191bd72e6913e1c56736e801e0fb9e1f7262cfb2
Author: Takuya Wakazono <pastalian46 <AT> gmail <DOT> com>
AuthorDate: Thu Jan 18 15:00:44 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 2 03:56:56 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=191bd72e
app-arch/rpm: fix musl build
Closes: https://bugs.gentoo.org/888954
Closes: https://bugs.gentoo.org/922286
Signed-off-by: Takuya Wakazono <pastalian46 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-arch/rpm/files/rpm-4.18.1-musl-nls.patch | 42 ++++++++++++++++++
app-arch/rpm/files/rpm-4.19.1-musl-compat.patch | 59 +++++++++++++++++++++++++
app-arch/rpm/rpm-4.18.1.ebuild | 1 +
app-arch/rpm/rpm-4.19.1.ebuild | 2 +
4 files changed, 104 insertions(+)
diff --git a/app-arch/rpm/files/rpm-4.18.1-musl-nls.patch b/app-arch/rpm/files/rpm-4.18.1-musl-nls.patch
new file mode 100644
index 000000000000..7d1fde28bacf
--- /dev/null
+++ b/app-arch/rpm/files/rpm-4.18.1-musl-nls.patch
@@ -0,0 +1,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);
diff --git a/app-arch/rpm/files/rpm-4.19.1-musl-compat.patch b/app-arch/rpm/files/rpm-4.19.1-musl-compat.patch
new file mode 100644
index 000000000000..ca9f97257c70
--- /dev/null
+++ b/app-arch/rpm/files/rpm-4.19.1-musl-compat.patch
@@ -0,0 +1,59 @@
+musl doesn't implement GLOB_BRACE, simply disable it.
+
+https://bugs.gentoo.org/922286
+https://github.com/rpm-software-management/rpm/issues/2844
+--- a/rpmio/rpmglob.c
++++ b/rpmio/rpmglob.c
+@@ -33,6 +33,10 @@
+
+ #include "debug.h"
+
++#ifndef GLOB_BRACE
++#define GLOB_BRACE 0
++#endif
++
+ /* Return 1 if pattern contains a magic char, see glob(7) for a list */
+ static int ismagic(const char *pattern)
+ {
+
+From 57f3711846f44da0f37cbc5dd66e8fba80a3bee1 Mon Sep 17 00:00:00 2001
+From: Panu Matilainen <pmatilai@redhat.com>
+Date: Mon, 18 Dec 2023 12:25:04 +0200
+Subject: [PATCH] Fix unconditional dependency on non-POSIX GLOB_ONLYDIR flag
+
+This regressed when we axed our internal glob copy in commit
+66fa46c006bae0f28d93238b8f7f1c923645eee5. Luckily GLOB_ONLYDIR is only
+an optimization so we can just skip it if not available.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -350,6 +350,7 @@ if (LIBDW_FOUND)
+ set(HAVE_LIBDW 1)
+ endif()
+
++check_symbol_exists(GLOB_ONLYDIR "glob.h" HAVE_GLOB_ONLYDIR)
+ check_symbol_exists(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
+ if (NOT MAJOR_IN_SYSMACROS)
+ check_symbol_exists(major "sys/mkdev.h" MAJOR_IN_MKDEV)
+--- a/config.h.in
++++ b/config.h.in
+@@ -100,6 +100,7 @@
+ #cmakedefine HAVE_ZSTD @HAVE_ZSTD@
+ #cmakedefine HAVE___PROGNAME @HAVE___PROGNAME@
+ #cmakedefine HAVE___SECURE_GETENV @HAVE___SECURE_GETENV@
++#cmakedefine HAVE_GLOB_ONLYDIR @HAVE_GLOB_ONLYDIR@
+ #cmakedefine MAJOR_IN_MKDEV @MAJOR_IN_MKDEV@
+ #cmakedefine MAJOR_IN_SYSMACROS @MAJOR_IN_SYSMACROS@
+ #cmakedefine RUNDIR @rundir@
+--- a/rpmio/rpmglob.c
++++ b/rpmio/rpmglob.c
+@@ -84,8 +84,10 @@ int rpmGlobPath(const char * pattern, rpmglobFlags flags,
+ gflags |= GLOB_BRACE;
+ if (home != NULL && strlen(home) > 0)
+ gflags |= GLOB_TILDE;
++#if HAVE_GLOB_ONLYDIR
+ if (dir_only)
+ gflags |= GLOB_ONLYDIR;
++#endif
+ if (flags & RPMGLOB_NOCHECK)
+ gflags |= GLOB_NOCHECK;
+
diff --git a/app-arch/rpm/rpm-4.18.1.ebuild b/app-arch/rpm/rpm-4.18.1.ebuild
index 8695d7cf06c8..5054bab122a8 100644
--- a/app-arch/rpm/rpm-4.18.1.ebuild
+++ b/app-arch/rpm/rpm-4.18.1.ebuild
@@ -65,6 +65,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-4.8.1-db-path.patch
"${FILESDIR}"/${PN}-4.8.1-clang.patch
"${FILESDIR}"/${PN}-4.17.0-libdir.patch
+ "${FILESDIR}"/${PN}-4.18.1-musl-nls.patch
)
pkg_pretend() {
diff --git a/app-arch/rpm/rpm-4.19.1.ebuild b/app-arch/rpm/rpm-4.19.1.ebuild
index 3459be5ac5f3..a011006febb8 100644
--- a/app-arch/rpm/rpm-4.19.1.ebuild
+++ b/app-arch/rpm/rpm-4.19.1.ebuild
@@ -62,7 +62,9 @@ RDEPEND="
"
PATCHES=(
+ "${FILESDIR}"/${PN}-4.18.1-musl-nls.patch
"${FILESDIR}"/${PN}-4.19.0-libdir.patch
+ "${FILESDIR}"/${PN}-4.19.1-musl-compat.patch
)
pkg_pretend() {
next reply other threads:[~2024-02-02 3:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 3:58 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-10 2:25 [gentoo-commits] repo/gentoo:master commit in: app-arch/rpm/, app-arch/rpm/files/ Sam James
2024-11-23 16:10 Sam James
2024-03-04 7:53 Joonas Niilola
2024-03-04 7:53 Joonas Niilola
2023-12-15 6:24 Sam James
2022-04-10 10:11 Sam James
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1706846216.191bd72e6913e1c56736e801e0fb9e1f7262cfb2.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox