diff options
author | kamil <kamil@pkgsrc.org> | 2019-10-24 21:50:08 +0000 |
---|---|---|
committer | kamil <kamil@pkgsrc.org> | 2019-10-24 21:50:08 +0000 |
commit | 851ff3167646faf40e967ff407af3d7b9e92bdb0 (patch) | |
tree | 3312f48c08d2e6f1c267d428caae8d7847105c77 /audio | |
parent | a5bee8b6f37bc31a5f105eaed2b6be5c54f5d2d0 (diff) | |
download | pkgsrc-851ff3167646faf40e967ff407af3d7b9e92bdb0.tar.gz |
ncmpc: Fix build on NetBSD 9.99.17
Adapt the local patch for the POSIX iconv(3) API change in new NetBSD.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/ncmpc/distinfo | 4 | ||||
-rw-r--r-- | audio/ncmpc/patches/patch-src_charset.cxx | 39 |
2 files changed, 29 insertions, 14 deletions
diff --git a/audio/ncmpc/distinfo b/audio/ncmpc/distinfo index f7a872d74db..4e97975c89a 100644 --- a/audio/ncmpc/distinfo +++ b/audio/ncmpc/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.18 2019/10/06 16:15:51 nia Exp $ +$NetBSD: distinfo,v 1.19 2019/10/24 21:50:08 kamil Exp $ SHA1 (ncmpc-0.35.tar.xz) = af728f27674a9b33db555bfad663c1b831d5c08f RMD160 (ncmpc-0.35.tar.xz) = d8a0c1a2e953cc1e8ffc685b89c5be8f1d292979 @@ -6,5 +6,5 @@ SHA512 (ncmpc-0.35.tar.xz) = 64f56730b0439c23c4a833d3b65da769d5123a1613a6b565201 Size (ncmpc-0.35.tar.xz) = 232828 bytes SHA1 (patch-doc_meson.build) = c19102b6f7f069a2a147b66e6ed4b4585332ac8e SHA1 (patch-meson.build) = b16babee9f8e5799a600bf029b3bb606e32a265a -SHA1 (patch-src_charset.cxx) = 0925365535ca35de73e94c1fa3737c8c71eee101 +SHA1 (patch-src_charset.cxx) = c8e06c936657819060c6539a3726e03fda7da54a SHA1 (patch-src_ncu.cxx) = 0a4516a7c5a9819977873a78d5078a22f0414356 diff --git a/audio/ncmpc/patches/patch-src_charset.cxx b/audio/ncmpc/patches/patch-src_charset.cxx index 4e118bd728d..2a083bbc980 100644 --- a/audio/ncmpc/patches/patch-src_charset.cxx +++ b/audio/ncmpc/patches/patch-src_charset.cxx @@ -1,34 +1,49 @@ -$NetBSD: patch-src_charset.cxx,v 1.1 2019/09/14 12:19:40 nia Exp $ +$NetBSD: patch-src_charset.cxx,v 1.2 2019/10/24 21:50:08 kamil Exp $ -Don't strip constness for the iconv input on SunOS and NetBSD, -which continue to have the input as const. +Don't strip constness for the iconv input on SunOS and old NetBSD. ---- src/charset.cxx.orig 2019-04-10 09:08:34.000000000 +0000 +--- src/charset.cxx.orig 2019-09-14 12:24:35.000000000 +0000 +++ src/charset.cxx -@@ -64,9 +64,13 @@ Iconv(iconv_t i, +@@ -20,6 +20,15 @@ + #include "charset.hxx" + #include "util/ScopeExit.hxx" + ++#if defined(__NetBSD__) ++#include <sys/param.h> ++#if __NetBSD_Prereq__(9,99,17) ++#define NETBSD_POSIX_ICONV 1 ++#else ++#define NETBSD_POSIX_ICONV 0 ++#endif ++#endif ++ + #include <algorithm> + + #include <assert.h> +@@ -64,9 +73,13 @@ Iconv(iconv_t i, --dest_size; /* reserve once byte for the null terminator */ while (src_length > 0) { -+#if !defined(__NetBSD__) && !defined(__sun) ++#if (defined(__NetBSD__) && !NETBSD_POSIX_ICONV) || defined(__sun) ++ size_t err = iconv(i, &src, &src_length, &dest, &dest_size); ++#else size_t err = iconv(i, const_cast<char **>(&src), &src_length, &dest, &dest_size); -+#else -+ size_t err = iconv(i, &src, &src_length, &dest, &dest_size); +#endif if (err == (size_t)-1) { switch (errno) { case EILSEQ: -@@ -130,9 +134,13 @@ Iconv(iconv_t i, +@@ -130,9 +143,13 @@ Iconv(iconv_t i, char buffer[1024], *outbuf = buffer; size_t outbytesleft = sizeof(buffer); -+#if !defined(__NetBSD__) && !defined(__sun) ++#if (defined(__NetBSD__) && !NETBSD_POSIX_ICONV) || defined(__sun) ++ size_t err = iconv(i, &src, &src_length, &outbuf, &outbytesleft); ++#else size_t err = iconv(i, const_cast<char **>(&src), &src_length, &outbuf, &outbytesleft); -+#else -+ size_t err = iconv(i, &src, &src_length, &outbuf, &outbytesleft); +#endif dest.append(buffer, outbuf); if (err == (size_t)-1) { |