git.iko.soy/typeable/nixpkgs
on master help sign in
libbsd: update darwin patch

Fixes #27120 Fixes #34989

commitc61a9907141e42129cc912c999b94116c306086d authorMatthew Bauer <mjbauer95@gmail.com> dateWed 14 Feb 2018, 19:51 (9 years ago) parent050810e
1 file changed+56−31
pkgs/development/libraries/libbsd/darwin.patch+56−31
pkgs/development/libraries/libbsd/darwin.patch+56−31
@@ -1,5 +1,5 @@
11diff --git a/configure.ac b/configure.ac
2−index c909878..60c540e 100644
2+index 88ccd91..0857782 100644
33--- a/configure.ac
44+++ b/configure.ac
55@@ -59,7 +59,7 @@ AS_CASE([$host_os],
@@ -31,7 +31,7 @@ index c909878..60c540e 100644
3131+ os_is_macosx=false
3232+ nonLinuxOS=false
3333+ ;;
34−+esac
34++esac
3535+AM_CONDITIONAL([IS_DARWIN], [test x$os_is_macosx = xtrue])
3636+AM_COND_IF([IS_DARWIN],
3737+ [AC_DEFINE([IS_DARWIN], [1], [Get HostOS Type is Darwin])])
@@ -58,7 +58,7 @@ index 45b3b15..d0d4043 100644
5858 #include <sys/types.h>
5959 #include <stdint.h>
6060diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
61−index 4b69983..8e2ac75 100644
61+index 4b69983..c75151b 100644
6262--- a/include/bsd/stdio.h
6363+++ b/include/bsd/stdio.h
6464@@ -48,12 +48,16 @@
@@ -69,37 +69,60 @@ index 4b69983..8e2ac75 100644
6969 /* XXX: The function requires cooperation from the system libc to store the
7070 * line buffer in the FILE struct itself. */
7171 char *fgetln(FILE *fp, size_t *lenp)
72− LIBBSD_DEPRECATED("This functions cannot be safely ported, "
73− "use getline(3) instead, as it is supported "
74− "by GNU and POSIX.1-2008.");
72+- LIBBSD_DEPRECATED("This functions cannot be safely ported, "
73+- "use getline(3) instead, as it is supported "
74+- "by GNU and POSIX.1-2008.");
75++ __attribute__((deprecated("This functions cannot be safely ported, "
76++ "use getline(3) instead, as it is supported "
77++ "by GNU and POSIX.1-2008.")));
7578+#else
7679+char *fgetln(FILE *fp, size_t *lenp);
7780+#endif
7881
7982 /*
8083 * Note: We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations,
84+diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
85+index ebc9638..6cd7943 100644
86+--- a/include/bsd/stdlib.h
87++++ b/include/bsd/stdlib.h
88+@@ -67,9 +67,11 @@ int sradixsort(const unsigned char **base, int nmemb,
89+ const unsigned char *table, unsigned endbyte);
90+
91+ void *reallocf(void *ptr, size_t size);
92+-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
93++#if defined(_GNU_SOURCE) && defined(__GLIBC__) && defined(__GLIBC_PREREQ)
94++#if !__GLIBC_PREREQ(2, 26)
95+ void *reallocarray(void *ptr, size_t nmemb, size_t size);
96+ #endif
97++#endif
98+
99+ long long strtonum(const char *nptr, long long minval, long long maxval,
100+ const char **errstr);
81101diff --git a/include/bsd/string.h b/include/bsd/string.h
82−index ee2f953..a3ab077 100644
102+index 6798bf6..6baaa14 100644
83103--- a/include/bsd/string.h
84104+++ b/include/bsd/string.h
85−@@ -37,11 +37,14 @@
105+@@ -37,6 +37,12 @@
86106 #include <sys/types.h>
87107
88108 __BEGIN_DECLS
89−-size_t strlcpy(char *dst, const char *src, size_t siz);
90−-size_t strlcat(char *dst, const char *src, size_t siz);
91− char *strnstr(const char *str, const char *find, size_t str_len);
92109+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
93110+size_t bsd_strlcpy(char *dst, const char *src, size_t siz);
94111+size_t bsd_strlcat(char *dst, const char *src, size_t siz);
112++char *bsd_strnstr(const char *str, const char *find, size_t str_len);
95113+void bsd_strmode(mode_t mode, char *str);
96114+#else
97− void strmode(mode_t mode, char *str);
98−-
99−+#endif
115+ size_t strlcpy(char *dst, const char *src, size_t siz);
116+ size_t strlcat(char *dst, const char *src, size_t siz);
117+ char *strnstr(const char *str, const char *find, size_t str_len);
118+@@ -45,6 +51,7 @@ void strmode(mode_t mode, char *str);
119+ #if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
100120 void explicit_bzero(void *buf, size_t len);
121+ #endif
122++#endif
101123 __END_DECLS
102124
125+ #endif
103126diff --git a/src/Makefile.am b/src/Makefile.am
104127index ad83dbf..0f2a7ee 100644
105128--- a/src/Makefile.am
@@ -519,18 +542,17 @@ index 462535a..e7eb46f 100644
519542+}
520543 #endif
521544diff --git a/src/funopen.c b/src/funopen.c
522−index 1e05c7e..ed8ce85 100644
545+index 1e05c7e..75e61ea 100644
523546--- a/src/funopen.c
524547+++ b/src/funopen.c
525−@@ -137,7 +137,7 @@ funopen(const void *cookie,
526−
527− return fopencookie(cookiewrap, mode, funcswrap);
528− }
529−-#elif defined(__MUSL__)
530−+#elif defined(__MUSL__) || defined(darwin) || defined(__APPLE__) || defined(MACOSX)
531− /*
532− * This is unimplementable on musl based systems, and upstream has stated
548+@@ -143,6 +143,7 @@ funopen(const void *cookie,
533549 * they will not add the needed support to implement it. Just ignore this
550+ * interface there, as it has never been provided anyway.
551+ */
552++#elif defined(darwin) || defined(__APPLE__) || defined(MACOSX)
553+ #else
554+ #error "Function funopen() needs to be ported or disabled."
555+ #endif
534556diff --git a/src/getentropy.c b/src/getentropy.c
535557index 3f11a1e..8a23a07 100644
536558--- a/src/getentropy.c
@@ -563,13 +585,15 @@ index 4f368a1..ab22fc1 100644
563585 #define SHA512_DIGEST_LENGTH 64
564586
565587diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c
566−index b3c8d5e..4fade0f 100644
588+index b3c8d5e..f69013d 100644
567589--- a/src/hash/sha512c.c
568590+++ b/src/hash/sha512c.c
569−@@ -25,7 +25,11 @@
591+@@ -25,7 +25,13 @@
570592 */
571593
572594 #include <sys/cdefs.h>
595++__FBSDID("$FreeBSD$");
596++
573597+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
574598+#include <machine/endian.h>
575599+#else
@@ -579,24 +603,25 @@ index b3c8d5e..4fade0f 100644
579603
580604 #include <string.h>
581605diff --git a/src/nlist.c b/src/nlist.c
582−index 0932f59..a3ba2be 100644
606+index 0932f59..598a329 100644
583607--- a/src/nlist.c
584608+++ b/src/nlist.c
585−@@ -27,6 +27,8 @@
609+@@ -27,6 +27,10 @@
586610 * SUCH DAMAGE.
587611 */
588612
589613+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
590−+
614++#if defined(LIBC_SCCS) && !defined(lint)
615++static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
616++#endif /* LIBC_SCCS and not lint */
591617 #include <sys/cdefs.h>
592618
593619 #include <sys/param.h>
594−@@ -265,3 +267,5 @@ nlist(const char *name, struct nlist *list)
620+@@ -265,3 +269,4 @@ nlist(const char *name, struct nlist *list)
595621 (void)close(fd);
596622 return (n);
597623 }
598−+
599−+#endif
624++#endif /* _NLIST_DO_ELF */
600625diff --git a/src/setproctitle.c b/src/setproctitle.c
601626index 038ac7d..d0ef01b 100644
602627--- a/src/setproctitle.c