[staging-next] pkgsMusl.libmpeg2: fix build (#479183)

This commit is contained in:
Yureka
2026-01-12 09:45:00 +00:00
committed by GitHub
2 changed files with 31 additions and 0 deletions
@@ -0,0 +1,26 @@
diff --git a/src/getopt.c b/src/getopt.c
index 4744e43..19776f3 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -208,7 +208,7 @@ static char *posixly_correct;
whose names are inconsistent. */
#ifndef getenv
-extern char *getenv ();
+extern char *getenv (const char *);
#endif
static char *
diff --git a/src/getopt.h b/src/getopt.h
index b0147e9..6f1e784 100644
--- a/src/getopt.h
+++ b/src/getopt.h
@@ -133,7 +133,7 @@ struct option
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 ();
+extern int getopt (int, char *const*, const char *);
# endif /* __GNU_LIBRARY__ */
# ifndef __need_getopt
+5
View File
@@ -13,6 +13,11 @@ stdenv.mkDerivation rec {
sha256 = "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny";
};
patches = [
# Fixes mismatching definitions with C23 / GCC15 on non-glibc platforms
./getopt-getenv-signatures.patch
];
# Otherwise clang fails with 'duplicate symbol ___sputc'
buildFlags = lib.optional stdenv.hostPlatform.isDarwin "CFLAGS=-std=gnu89";