Change:
/* XXX: The function requires cooperation from the system libc to store the * line buffer in the FILE struct itself. */ char *fgetln(FILE *fp, size_t *lenp) <del> LIBBSD_DEPRECATED("This functions cannot be safely ported, " "use getline(3) instead, as it is supported " "by GNU and POSIX.1-2008."); </del> <ins> -	LIBBSD_DEPRECATED("This functions cannot be safely ported, " -	                  "use getline(3) instead, as it is supported " -	                  "by GNU and POSIX.1-2008."); +	__attribute__((deprecated("This functions cannot be safely ported, " +	                          "use getline(3) instead, as it is supported " +	                          "by GNU and POSIX.1-2008."))); </ins> +#else +char *fgetln(FILE *fp, size_t *lenp); +#endif /* * Note: We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations, <ins> diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h index ebc9638..6cd7943 100644 --- a/include/bsd/stdlib.h +++ b/include/bsd/stdlib.h @@ -67,9 +67,11 @@ int sradixsort(const unsigned char **base, int nmemb, const unsigned char *table, unsigned endbyte); void *reallocf(void *ptr, size_t size); -#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26) +#if defined(_GNU_SOURCE) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) +#if !__GLIBC_PREREQ(2, 26) void *reallocarray(void *ptr, size_t nmemb, size_t size); #endif +#endif long long strtonum(const char *nptr, long long minval, long long maxval, const char **errstr); </ins> diff --git a/include/bsd/string.h b/include/bsd/string.h <del> index ee2f953..a3ab077 100644 </del> <ins> index 6798bf6..6baaa14 100644 </ins> --- a/include/bsd/string.h +++ b/include/bsd/string.h <del> @@ -37,11 +37,14 @@ </del> <ins> @@ -37,6 +37,12 @@ </ins> #include <sys/types.h> __BEGIN_DECLS <del> -size_t strlcpy(char *dst, const char *src, size_t siz); -size_t strlcat(char *dst, const char *src, size_t siz); char *strnstr(const char *str, const char *find, size_t str_len); </del> +#if defined(darwin) || defined(__APPLE__) || defined(MACOSX) +size_t bsd_strlcpy(char *dst, const char *src, size_t siz); +size_t bsd_strlcat(char *dst, const char *src, size_t siz); <ins> +char *bsd_strnstr(const char *str, const char *find, size_t str_len); </ins> +void bsd_strmode(mode_t mode, char *str); +#else <del> void strmode(mode_t mode, char *str); - +#endif </del> <ins> size_t strlcpy(char *dst, const char *src, size_t siz); size_t strlcat(char *dst, const char *src, size_t siz); char *strnstr(const char *str, const char *find, size_t str_len); @@ -45,6 +51,7 @@ void strmode(mode_t mode, char *str); #if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25) </ins> void explicit_bzero(void *buf, size_t len); <ins> #endif +#endif </ins> __END_DECLS <ins> #endif </ins> diff --git a/src/Makefile.am b/src/Makefile.am index ad83dbf..0f2a7ee 100644 --- a/src/Makefile.am

Discussion:
cc system: host os: multi-user?: sandbox: version: channels(davidak): channels(root): nixpkgs:
Thanks!

Not sure how difficult it'd be to fix this, but thought I'd note it somewhere. We recently bumped to 0.8.5 but I don't see any reason that would make the patch apply again (although I can't confirm this myself :)). If it can't be resolved reasonably perhaps the patch should be dropped and "darwin" removed from ? EDIT: Looks like libbsd has a separate "port" for OSX: which I've filed an issue on (like was done previously, apparently): Try to build libbsd on Darwin; look at Hydra/Travis build failures. System: (NixOS: , Ubuntu/Fedora: , ...) Nix version: (run ) Nixpkgs version: (run ) Sandboxing enabled: (run )
Yeah, I have just been manually updating the patch since v0.8.3. The "correct" thing to do would be to get the patch applied upstream in libbsd. Perhaps freedesktop doesn't want it though. /cc