Hello,
This diff updates libyajl to version 2.0.1.
It's a major update, so some modifications to both i3 and i3bar are
required (API changes).
Tested on amd64 and sparc64: 58/58 tests successful.
i3 and i3bar seem fine too.
Comments? OK?
ciao
David
Index: devel/libyajl/Makefile
===================================================================
RCS file: /cvs/ports/devel/libyajl/Makefile,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile
--- devel/libyajl/Makefile 27 Apr 2011 21:02:06 -0000 1.4
+++ devel/libyajl/Makefile 2 May 2011 10:32:12 -0000
@@ -2,14 +2,14 @@
COMMENT = small JSON library written in ANSI C
-V = 1.0.12
+V = 2.0.1
PKGNAME = libyajl-${V}
DISTNAME = lloyd-yajl-${V}
CATEGORIES = devel
-SHARED_LIBS = yajl 0.0
+SHARED_LIBS = yajl 1.0 # 2.0
HOMEPAGE = http://lloyd.github.com/yajl/
@@ -30,7 +30,7 @@ MODULES = devel/cmake
SEPARATE_BUILD =simple
-WRKDIST = ${WRKDIR}/lloyd-yajl-17b1790
+WRKDIST = ${WRKDIR}/lloyd-yajl-f4b2b1a
pre-regress:
ln -s ${WRKBUILD} ${WRKSRC}/build
Index: devel/libyajl/distinfo
===================================================================
RCS file: /cvs/ports/devel/libyajl/distinfo,v
retrieving revision 1.3
diff -u -p -r1.3 distinfo
--- devel/libyajl/distinfo 27 Apr 2011 21:02:06 -0000 1.3
+++ devel/libyajl/distinfo 2 May 2011 10:32:12 -0000
@@ -1,5 +1,5 @@
-MD5 (lloyd-yajl-1.0.12.tar.gz) = cNIpFjgjPQqz9f0yOdXtEg==
-RMD160 (lloyd-yajl-1.0.12.tar.gz) = I2sletbGOvhADnBOvr/d1zE6528=
-SHA1 (lloyd-yajl-1.0.12.tar.gz) = 8Bd+OpRtaumgqWNpWywUOgMhm/I=
-SHA256 (lloyd-yajl-1.0.12.tar.gz) =
3ye7IJA/aOQMYs3GFqN4Ftm48rvpQ5AMXa0Wog3F0yY=
-SIZE (lloyd-yajl-1.0.12.tar.gz) = 54819
+MD5 (lloyd-yajl-2.0.1.tar.gz) = 32p1HneXucIYLv2RtdZAFw==
+RMD160 (lloyd-yajl-2.0.1.tar.gz) = MF+Si8L/AeILnDYvMDLef5SP3ME=
+SHA1 (lloyd-yajl-2.0.1.tar.gz) = JzTc/nVOGJJ+WtbQQyRwbx/3G+w=
+SHA256 (lloyd-yajl-2.0.1.tar.gz) = wtkJa6HryaNoNHx8aVz7vHJpBXGl95Vc4ibu2+pbRyE=
+SIZE (lloyd-yajl-2.0.1.tar.gz) = 82102
Index: devel/libyajl/pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/libyajl/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- devel/libyajl/pkg/PLIST 27 Apr 2011 21:02:07 -0000 1.3
+++ devel/libyajl/pkg/PLIST 2 May 2011 10:32:12 -0000
@@ -6,5 +6,6 @@ include/yajl/
include/yajl/yajl_common.h
include/yajl/yajl_gen.h
include/yajl/yajl_parse.h
+include/yajl/yajl_tree.h
include/yajl/yajl_version.h
lib/libyajl_s.a
Index: x11/i3/Makefile
===================================================================
RCS file: /cvs/ports/x11/i3/Makefile,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile
--- x11/i3/Makefile 29 Apr 2011 09:18:53 -0000 1.14
+++ x11/i3/Makefile 2 May 2011 10:32:12 -0000
@@ -4,7 +4,7 @@ COMMENT = improved dynamic tiling window
DISTNAME = i3-3.e-bf2
PKGNAME = i3-3.5.2
-REVISION = 1
+REVISION = 2
CATEGORIES = x11
@@ -25,7 +25,7 @@ WANTLIB += xcb-xinerama yajl
MODULES = converters/libiconv
LIB_DEPENDS = devel/libev \
- devel/libyajl
+ devel/libyajl>=2.0.0
BUILD_DEPENDS = devel/bison
RUN_DEPENDS = x11/dmenu \
devel/p5-IPC-Run \
Index: x11/i3/patches/patch-src_ipc_c
===================================================================
RCS file: /cvs/ports/x11/i3/patches/patch-src_ipc_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_ipc_c
--- x11/i3/patches/patch-src_ipc_c 29 Apr 2011 09:18:53 -0000 1.2
+++ x11/i3/patches/patch-src_ipc_c 2 May 2011 10:32:12 -0000
@@ -1,6 +1,6 @@
$OpenBSD: patch-src_ipc_c,v 1.2 2011/04/29 09:18:53 dcoppa Exp $
--- src/ipc.c.orig Wed Jan 19 21:26:37 2011
-+++ src/ipc.c Wed Apr 27 16:56:21 2011
++++ src/ipc.c Mon May 2 11:35:58 2011
@@ -91,7 +91,7 @@ static void ipc_send_message(int fd, const unsigned ch
char msg[buffer_size];
char *walk = msg;
@@ -10,6 +10,60 @@ $OpenBSD: patch-src_ipc_c,v 1.2 2011/04/
walk += strlen("i3-ipc");
memcpy(walk, &message_size, sizeof(uint32_t));
walk += sizeof(uint32_t);
+@@ -182,7 +182,7 @@ IPC_HANDLER(get_workspaces) {
+ if (last_focused == SLIST_END(&(c_ws->focus_stack)))
+ last_focused = NULL;
+
+- yajl_gen gen = yajl_gen_alloc(NULL, NULL);
++ yajl_gen gen = yajl_gen_alloc(NULL);
+ y(array_open);
+
+ TAILQ_FOREACH(ws, workspaces, workspaces) {
+@@ -226,7 +226,7 @@ IPC_HANDLER(get_workspaces) {
+ y(array_close);
+
+ const unsigned char *payload;
+- unsigned int length;
++ size_t length;
+ y(get_buf, &payload, &length);
+
+ ipc_send_message(fd, payload, I3_IPC_REPLY_TYPE_WORKSPACES, length);
+@@ -241,7 +241,7 @@ IPC_HANDLER(get_workspaces) {
+ IPC_HANDLER(get_outputs) {
+ Output *output;
+
+- yajl_gen gen = yajl_gen_alloc(NULL, NULL);
++ yajl_gen gen = yajl_gen_alloc(NULL);
+ y(array_open);
+
+ TAILQ_FOREACH(output, &outputs, outputs) {
+@@ -276,7 +276,7 @@ IPC_HANDLER(get_outputs) {
+ y(array_close);
+
+ const unsigned char *payload;
+- unsigned int length;
++ size_t length;
+ y(get_buf, &payload, &length);
+
+ ipc_send_message(fd, payload, I3_IPC_REPLY_TYPE_OUTPUTS, length);
+@@ -288,7 +288,7 @@ IPC_HANDLER(get_outputs) {
+ *
+ */
+ static int add_subscription(void *extra, const unsigned char *s,
+- unsigned int len) {
++ size_t len) {
+ ipc_client *client = extra;
+
+ DLOG("should add subscription to extra %p, sub %.*s\n", client, len,
s);
+@@ -338,7 +338,7 @@ IPC_HANDLER(subscribe) {
+ memset(&callbacks, 0, sizeof(yajl_callbacks));
+ callbacks.yajl_string = add_subscription;
+
+- p = yajl_alloc(&callbacks, NULL, NULL, (void*)client);
++ p = yajl_alloc(&callbacks, NULL, (void*)client);
+ stat = yajl_parse(p, (const unsigned char*)message, message_size);
+ if (stat != yajl_status_ok) {
+ unsigned char *err;
@@ -437,7 +437,8 @@ static void ipc_receive_message(EV_P_ struct ev_io *w,
n -= strlen(I3_IPC_MAGIC);
Index: x11/i3bar/Makefile
===================================================================
RCS file: /cvs/ports/x11/i3bar/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- x11/i3bar/Makefile 29 Apr 2011 09:18:53 -0000 1.2
+++ x11/i3bar/Makefile 2 May 2011 10:32:12 -0000
@@ -3,7 +3,7 @@
COMMENT = status and workspace bar for i3
DISTNAME = i3bar-0.6.21
-REVISION = 0
+REVISION = 1
CATEGORIES = x11
MAINTAINER = David Coppa <[email protected]>
@@ -26,7 +26,7 @@ BUILD_DEPENDS = textproc/asciidoc \
x11/i3
LIB_DEPENDS = devel/libev \
- devel/libyajl
+ devel/libyajl>=2.0.0
RUN_DEPENDS = x11/i3
Index: x11/i3bar/patches/patch-src_outputs_c
===================================================================
RCS file: x11/i3bar/patches/patch-src_outputs_c
diff -N x11/i3bar/patches/patch-src_outputs_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ x11/i3bar/patches/patch-src_outputs_c 2 May 2011 10:32:12 -0000
@@ -0,0 +1,50 @@
+$OpenBSD$
+--- src/outputs.c.orig Mon May 2 11:43:00 2011
++++ src/outputs.c Mon May 2 11:46:07 2011
+@@ -59,7 +59,7 @@ static int outputs_boolean_cb(void *params_, bool val)
+ * Parse an integer (current_workspace or the rect)
+ *
+ */
+-static int outputs_integer_cb(void *params_, long val) {
++static int outputs_integer_cb(void *params_, long long val) {
+ struct outputs_json_params *params = (struct outputs_json_params*)
params_;
+
+ if (!strcmp(params->cur_key, "current_workspace")) {
+@@ -99,7 +99,7 @@ static int outputs_integer_cb(void *params_, long val)
+ * Parse a string (name)
+ *
+ */
+-static int outputs_string_cb(void *params_, const unsigned char *val,
unsigned int len) {
++static int outputs_string_cb(void *params_, const unsigned char *val, size_t
len) {
+ struct outputs_json_params *params = (struct outputs_json_params*)
params_;
+
+ if (strcmp(params->cur_key, "name")) {
+@@ -169,7 +169,7 @@ static int outputs_end_map_cb(void *params_) {
+ * Essentially we just save it in the parsing-state
+ *
+ */
+-static int outputs_map_key_cb(void *params_, const unsigned char *keyVal,
unsigned int keyLen) {
++static int outputs_map_key_cb(void *params_, const unsigned char *keyVal,
size_t keyLen) {
+ struct outputs_json_params *params = (struct outputs_json_params*)
params_;
+ FREE(params->cur_key);
+
+@@ -216,10 +216,9 @@ void parse_outputs_json(char *json) {
+ params.json = json;
+
+ yajl_handle handle;
+- yajl_parser_config parse_conf = { 0, 0 };
+ yajl_status state;
+
+- handle = yajl_alloc(&outputs_callbacks, &parse_conf, NULL, (void*)
¶ms);
++ handle = yajl_alloc(&outputs_callbacks, NULL, (void*) ¶ms);
+
+ state = yajl_parse(handle, (const unsigned char*) json, strlen(json));
+
+@@ -228,7 +227,6 @@ void parse_outputs_json(char *json) {
+ case yajl_status_ok:
+ break;
+ case yajl_status_client_canceled:
+- case yajl_status_insufficient_data:
+ case yajl_status_error:
+ ELOG("Could not parse outputs-reply!\n");
+ exit(EXIT_FAILURE);
Index: x11/i3bar/patches/patch-src_workspaces_c
===================================================================
RCS file: x11/i3bar/patches/patch-src_workspaces_c
diff -N x11/i3bar/patches/patch-src_workspaces_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ x11/i3bar/patches/patch-src_workspaces_c 2 May 2011 10:32:12 -0000
@@ -0,0 +1,50 @@
+$OpenBSD$
+--- src/workspaces.c.orig Mon May 2 11:43:04 2011
++++ src/workspaces.c Mon May 2 11:50:16 2011
+@@ -57,7 +57,7 @@ static int workspaces_boolean_cb(void *params_, bool v
+ * Parse an integer (num or the rect)
+ *
+ */
+-static int workspaces_integer_cb(void *params_, long val) {
++static int workspaces_integer_cb(void *params_, long long val) {
+ struct workspaces_json_params *params = (struct workspaces_json_params*)
params_;
+
+ if (!strcmp(params->cur_key, "num")) {
+@@ -98,7 +98,7 @@ static int workspaces_integer_cb(void *params_, long v
+ * Parse a string (name, output)
+ *
+ */
+-static int workspaces_string_cb(void *params_, const unsigned char *val,
unsigned int len) {
++static int workspaces_string_cb(void *params_, const unsigned char *val,
size_t len) {
+
+ struct workspaces_json_params *params = (struct
workspaces_json_params*) params_;
+
+@@ -178,7 +178,7 @@ static int workspaces_start_map_cb(void *params_) {
+ * Essentially we just save it in the parsing-state
+ *
+ */
+-static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal,
unsigned int keyLen) {
++static int workspaces_map_key_cb(void *params_, const unsigned char *keyVal,
size_t keyLen) {
+ struct workspaces_json_params *params = (struct workspaces_json_params*)
params_;
+ FREE(params->cur_key);
+
+@@ -224,10 +224,9 @@ void parse_workspaces_json(char *json) {
+ params.json = json;
+
+ yajl_handle handle;
+- yajl_parser_config parse_conf = { 0, 0 };
+ yajl_status state;
+
+- handle = yajl_alloc(&workspaces_callbacks, &parse_conf, NULL, (void*)
¶ms);
++ handle = yajl_alloc(&workspaces_callbacks, NULL, (void*) ¶ms);
+
+ state = yajl_parse(handle, (const unsigned char*) json, strlen(json));
+
+@@ -236,7 +235,6 @@ void parse_workspaces_json(char *json) {
+ case yajl_status_ok:
+ break;
+ case yajl_status_client_canceled:
+- case yajl_status_insufficient_data:
+ case yajl_status_error:
+ ELOG("Could not parse workspaces-reply!\n");
+ exit(EXIT_FAILURE);