summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfhajny <fhajny>2017-01-04 12:44:59 +0000
committerfhajny <fhajny>2017-01-04 12:44:59 +0000
commite5623582e1a737846da3dbfb055e0badd1d02646 (patch)
treebe0493f5f581db7e7d80bb43d1e89aeb5499ccb1
parentf3c50e8fe855e7025e5ae28cf19babd32bc04e4f (diff)
downloadpkgsrc-e5623582e1a737846da3dbfb055e0badd1d02646.tar.gz
Fix build on SunOS platforms.
-rw-r--r--textproc/jo/Makefile7
-rw-r--r--textproc/jo/distinfo3
-rw-r--r--textproc/jo/patches/patch-json.c100
3 files changed, 107 insertions, 3 deletions
diff --git a/textproc/jo/Makefile b/textproc/jo/Makefile
index ca9a876fe53..96ce8e4233e 100644
--- a/textproc/jo/Makefile
+++ b/textproc/jo/Makefile
@@ -1,15 +1,18 @@
-# $NetBSD: Makefile,v 1.3 2016/09/11 15:59:29 kamil Exp $
+# $NetBSD: Makefile,v 1.4 2017/01/04 12:44:59 fhajny Exp $
DISTNAME= jo-1.0
CATEGORIES= textproc
MASTER_SITES= ${MASTER_SITE_GITHUB:=jpmens/}
-GITHUB_RELEASE= ${DISTNAME}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://github.com/jpmens/jo
COMMENT= JSON output from a shell
LICENSE= gnu-gpl-v2
+GITHUB_RELEASE= ${DISTNAME}
+
GNU_CONFIGURE= yes
+USE_LANGUAGES= c c99
+
.include "../../mk/bsd.pkg.mk"
diff --git a/textproc/jo/distinfo b/textproc/jo/distinfo
index 00ee74d5f7d..eae4ce4dfa2 100644
--- a/textproc/jo/distinfo
+++ b/textproc/jo/distinfo
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.1 2016/07/26 17:29:22 kamil Exp $
+$NetBSD: distinfo,v 1.2 2017/01/04 12:44:59 fhajny Exp $
SHA1 (jo-1.0.tar.gz) = 2d06cf35b1dc71e5fdbe420ac4057cf508313e08
RMD160 (jo-1.0.tar.gz) = bff13c4e4689eb85a581e7383dc38d5cbd0052b5
SHA512 (jo-1.0.tar.gz) = bab15de7a01e9a70f43b50d0bb5eff4724bf9d38b0b56a6fff5768756073a5956e3a5a08c7a4e4a2c88107950a4c1721a09b60868b10a441c1a4c6fec7748036
Size (jo-1.0.tar.gz) = 112488 bytes
+SHA1 (patch-json.c) = 7ac3e1013c28c5b7b51c547e5417fdbfb13cd155
diff --git a/textproc/jo/patches/patch-json.c b/textproc/jo/patches/patch-json.c
new file mode 100644
index 00000000000..a93f3293239
--- /dev/null
+++ b/textproc/jo/patches/patch-json.c
@@ -0,0 +1,100 @@
+$NetBSD: patch-json.c,v 1.1 2017/01/04 12:44:59 fhajny Exp $
+
+Backport a namespace conflict fix from trunk.
+
+https://github.com/jpmens/jo/commit/2bedfd486f8f4a79b1865e370e6c858eb04257f5
+
+--- json.c.orig 2016-03-10 10:49:34.000000000 +0000
++++ json.c
+@@ -131,7 +131,7 @@ static void sb_free(SB *sb)
+ * Type for Unicode codepoints.
+ * We need our own because wchar_t might be 16 bits.
+ */
+-typedef uint32_t uchar_t;
++typedef uint32_t js_uchar_t;
+
+ /*
+ * Validate a single UTF-8 character starting at @s.
+@@ -228,7 +228,7 @@ static bool utf8_validate(const char *s)
+ * This function assumes input is valid UTF-8,
+ * and that there are enough characters in front of @s.
+ */
+-static int utf8_read_char(const char *s, uchar_t *out)
++static int utf8_read_char(const char *s, js_uchar_t *out)
+ {
+ const unsigned char *c = (const unsigned char*) s;
+
+@@ -240,21 +240,21 @@ static int utf8_read_char(const char *s,
+ return 1;
+ } else if (c[0] <= 0xDF) {
+ /* C2..DF (unless input is invalid) */
+- *out = ((uchar_t)c[0] & 0x1F) << 6 |
+- ((uchar_t)c[1] & 0x3F);
++ *out = ((js_uchar_t)c[0] & 0x1F) << 6 |
++ ((js_uchar_t)c[1] & 0x3F);
+ return 2;
+ } else if (c[0] <= 0xEF) {
+ /* E0..EF */
+- *out = ((uchar_t)c[0] & 0xF) << 12 |
+- ((uchar_t)c[1] & 0x3F) << 6 |
+- ((uchar_t)c[2] & 0x3F);
++ *out = ((js_uchar_t)c[0] & 0xF) << 12 |
++ ((js_uchar_t)c[1] & 0x3F) << 6 |
++ ((js_uchar_t)c[2] & 0x3F);
+ return 3;
+ } else {
+ /* F0..F4 (unless input is invalid) */
+- *out = ((uchar_t)c[0] & 0x7) << 18 |
+- ((uchar_t)c[1] & 0x3F) << 12 |
+- ((uchar_t)c[2] & 0x3F) << 6 |
+- ((uchar_t)c[3] & 0x3F);
++ *out = ((js_uchar_t)c[0] & 0x7) << 18 |
++ ((js_uchar_t)c[1] & 0x3F) << 12 |
++ ((js_uchar_t)c[2] & 0x3F) << 6 |
++ ((js_uchar_t)c[3] & 0x3F);
+ return 4;
+ }
+ }
+@@ -267,7 +267,7 @@ static int utf8_read_char(const char *s,
+ *
+ * This function will write up to 4 bytes to @out.
+ */
+-static int utf8_write_char(uchar_t unicode, char *out)
++static int utf8_write_char(js_uchar_t unicode, char *out)
+ {
+ unsigned char *o = (unsigned char*) out;
+
+@@ -304,10 +304,10 @@ static int utf8_write_char(uchar_t unico
+ * @uc should be 0xD800..0xDBFF, and @lc should be 0xDC00..0xDFFF.
+ * If they aren't, this function returns false.
+ */
+-static bool from_surrogate_pair(uint16_t uc, uint16_t lc, uchar_t *unicode)
++static bool from_surrogate_pair(uint16_t uc, uint16_t lc, js_uchar_t *unicode)
+ {
+ if (uc >= 0xD800 && uc <= 0xDBFF && lc >= 0xDC00 && lc <= 0xDFFF) {
+- *unicode = 0x10000 + ((((uchar_t)uc & 0x3FF) << 10) | (lc & 0x3FF));
++ *unicode = 0x10000 + ((((js_uchar_t)uc & 0x3FF) << 10) | (lc & 0x3FF));
+ return true;
+ } else {
+ return false;
+@@ -319,9 +319,9 @@ static bool from_surrogate_pair(uint16_t
+ *
+ * @unicode must be U+10000..U+10FFFF.
+ */
+-static void to_surrogate_pair(uchar_t unicode, uint16_t *uc, uint16_t *lc)
++static void to_surrogate_pair(js_uchar_t unicode, uint16_t *uc, uint16_t *lc)
+ {
+- uchar_t n;
++ js_uchar_t n;
+
+ assert(unicode >= 0x10000 && unicode <= 0x10FFFF);
+
+@@ -844,7 +844,7 @@ bool parse_string(const char **sp, char
+ case 'u':
+ {
+ uint16_t uc, lc;
+- uchar_t unicode;
++ js_uchar_t unicode;
+
+ if (!parse_hex16(&s, &uc))
+ goto failed;