pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/audio/ncmpc ncmpc: Fix build on NetBSD 9.99.17



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0704f86cef93
branches:  trunk
changeset: 403270:0704f86cef93
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Thu Oct 24 21:50:08 2019 +0000

description:
ncmpc: Fix build on NetBSD 9.99.17

Adapt the local patch for the POSIX iconv(3) API change in new NetBSD.

diffstat:

 audio/ncmpc/distinfo                      |   4 +-
 audio/ncmpc/patches/patch-src_charset.cxx |  41 +++++++++++++++++++++---------
 2 files changed, 30 insertions(+), 15 deletions(-)

diffs (82 lines):

diff -r 2836c0393009 -r 0704f86cef93 audio/ncmpc/distinfo
--- a/audio/ncmpc/distinfo      Thu Oct 24 21:42:30 2019 +0000
+++ b/audio/ncmpc/distinfo      Thu Oct 24 21:50:08 2019 +0000
@@ -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 @@
 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 -r 2836c0393009 -r 0704f86cef93 audio/ncmpc/patches/patch-src_charset.cxx
--- a/audio/ncmpc/patches/patch-src_charset.cxx Thu Oct 24 21:42:30 2019 +0000
+++ b/audio/ncmpc/patches/patch-src_charset.cxx Thu Oct 24 21:50:08 2019 +0000
@@ -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 old NetBSD.
 
-Don't strip constness for the iconv input on SunOS and NetBSD,
-which continue to have the input as const.
-
---- 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) {



Home | Main Index | Thread Index | Old Index