From e3bb24923e8f88c93a0f012ddbb74c1d959f7518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Oth=C3=B3n=20Mart=C3=ADnez=20Vera?= Date: Thu, 29 Jan 2026 17:29:49 -0600 Subject: [PATCH] app-text/enscript: fix compilation for musl + gcc15 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These compilation errors didn't appear before, because the buggy code is only compiled and linked with musl. The old Autotools included with enscript assume that, if you don't have GLIBC, you can't link it with external gettext libraries, and it must use the included gettext/libintl code. Signed-off-by: Cristian Othón Martínez Vera Part-of: https://github.com/gentoo/gentoo/pull/45577 Closes: https://github.com/gentoo/gentoo/pull/45577 Signed-off-by: Sam James --- app-text/enscript/enscript-1.6.6-r2.ebuild | 1 + .../enscript/files/enscript-1.6.6-musl.patch | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 app-text/enscript/files/enscript-1.6.6-musl.patch diff --git a/app-text/enscript/enscript-1.6.6-r2.ebuild b/app-text/enscript/enscript-1.6.6-r2.ebuild index abe917fa37ecf..ce5da86a9fd85 100644 --- a/app-text/enscript/enscript-1.6.6-r2.ebuild +++ b/app-text/enscript/enscript-1.6.6-r2.ebuild @@ -28,6 +28,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.6.4-fsf-gcc-darwin.patch "${FILESDIR}"/${PN}-1.6.2-implicit-function-decl.patch "${FILESDIR}"/${PN}-1.6.6-gcc15.patch + "${FILESDIR}"/${PN}-1.6.6-musl.patch ) src_prepare() { diff --git a/app-text/enscript/files/enscript-1.6.6-musl.patch b/app-text/enscript/files/enscript-1.6.6-musl.patch new file mode 100644 index 0000000000000..43b7f2ad956b7 --- /dev/null +++ b/app-text/enscript/files/enscript-1.6.6-musl.patch @@ -0,0 +1,39 @@ +--- a/intl/dcigettext.c ++++ b/intl/dcigettext.c +@@ -152,7 +152,7 @@ + # if VMS + # define getcwd(buf, max) (getcwd) (buf, max, 0) + # else +-char *getcwd (); ++char *getcwd (char *buf, size_t size); + # endif + # endif + # ifndef HAVE_STPCPY +--- a/compat/getopt.c ++++ b/compat/getopt.c +@@ -210,7 +210,7 @@ + /* Avoid depending on library functions or files + whose names are inconsistent. */ + +-char *getenv (); ++char *getenv (const char *name); + + static char * + my_index (str, chr) +--- a/compat/getopt.h ++++ b/compat/getopt.h +@@ -99,14 +99,7 @@ + #define optional_argument 2 + + #if defined (__STDC__) && __STDC__ +-#ifdef __GNU_LIBRARY__ +-/* Many other libraries have conflicting prototypes for getopt, with +- differences in the consts, in stdlib.h. To avoid compilation +- errors, only prototype getopt for the GNU C library. */ + extern int getopt (int argc, char *const *argv, const char *shortopts); +-#else /* not __GNU_LIBRARY__ */ +-extern int getopt (); +-#endif /* __GNU_LIBRARY__ */ + extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); + extern int getopt_long_only (int argc, char *const *argv,