aboutsummaryrefslogtreecommitdiff
path: root/examples/nodejs/patches
diff options
context:
space:
mode:
authorIgor Pashev <igor.pashev@nexenta.com>2012-12-19 13:02:54 +0400
committerIgor Pashev <igor.pashev@nexenta.com>2012-12-19 13:05:12 +0400
commit3e567218b60d7f885e769e1a2a07d84d38f11c13 (patch)
treef43668e026c492f304f4c827fc4b567ca85b1963 /examples/nodejs/patches
parentfdcf880b3c8c67f08453f553474a551e9707d29d (diff)
downloadcibs-3e567218b60d7f885e769e1a2a07d84d38f11c13.tar.gz
Update examples
Diffstat (limited to 'examples/nodejs/patches')
-rw-r--r--examples/nodejs/patches/01-shared-c-ares.patch288
-rw-r--r--examples/nodejs/patches/02-rename-node-to-nodejs.patch34
-rw-r--r--examples/nodejs/patches/03-waf.patch16
-rw-r--r--examples/nodejs/patches/04-lib-path.patch24
4 files changed, 362 insertions, 0 deletions
diff --git a/examples/nodejs/patches/01-shared-c-ares.patch b/examples/nodejs/patches/01-shared-c-ares.patch
new file mode 100644
index 0000000..220f2c7
--- /dev/null
+++ b/examples/nodejs/patches/01-shared-c-ares.patch
@@ -0,0 +1,288 @@
+diff -dubr source/configure cares/configure
+--- source/configure 2012-10-26 00:49:32.000000000 +0400
++++ cares/configure 2012-11-01 21:18:15.766658414 +0400
+@@ -460,6 +460,8 @@
+ 'cflags': [],
+ }
+
++output['libraries'] += ['-lcares']
++
+ configure_node(output)
+ configure_libz(output)
+ configure_v8(output)
+diff -dubr source/deps/uv/config-unix.mk cares/deps/uv/config-unix.mk
+--- source/deps/uv/config-unix.mk 2012-10-26 00:49:32.000000000 +0400
++++ cares/deps/uv/config-unix.mk 2012-11-01 21:24:35.522262825 +0400
+@@ -47,7 +47,7 @@
+ ifeq (SunOS,$(uname_S))
+ EV_CONFIG=config_sunos.h
+ EIO_CONFIG=config_sunos.h
+-CPPFLAGS += -Isrc/ares/config_sunos -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
++CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=500
+ LINKFLAGS+=-lsocket -lnsl -lkstat
+ OBJS += src/unix/sunos.o
+ endif
+@@ -65,7 +65,6 @@
+ EV_CONFIG=config_linux.h
+ EIO_CONFIG=config_linux.h
+ CSTDFLAG += -D_GNU_SOURCE
+-CPPFLAGS += -Isrc/ares/config_linux
+ LINKFLAGS+=-ldl -lrt
+ OBJS += src/unix/linux/linux-core.o \
+ src/unix/linux/inotify.o \
+@@ -75,7 +74,6 @@
+ ifeq (FreeBSD,$(uname_S))
+ EV_CONFIG=config_freebsd.h
+ EIO_CONFIG=config_freebsd.h
+-CPPFLAGS += -Isrc/ares/config_freebsd
+ LINKFLAGS+=-lkvm
+ OBJS += src/unix/freebsd.o
+ OBJS += src/unix/kqueue.o
+@@ -84,7 +82,6 @@
+ ifeq (DragonFly,$(uname_S))
+ EV_CONFIG=config_freebsd.h
+ EIO_CONFIG=config_freebsd.h
+-CPPFLAGS += -Isrc/ares/config_freebsd
+ LINKFLAGS+=
+ OBJS += src/unix/freebsd.o
+ OBJS += src/unix/kqueue.o
+@@ -93,7 +90,6 @@
+ ifeq (NetBSD,$(uname_S))
+ EV_CONFIG=config_netbsd.h
+ EIO_CONFIG=config_netbsd.h
+-CPPFLAGS += -Isrc/ares/config_netbsd
+ LINKFLAGS+=
+ OBJS += src/unix/netbsd.o
+ OBJS += src/unix/kqueue.o
+@@ -102,7 +98,6 @@
+ ifeq (OpenBSD,$(uname_S))
+ EV_CONFIG=config_openbsd.h
+ EIO_CONFIG=config_openbsd.h
+-CPPFLAGS += -Isrc/ares/config_openbsd
+ LINKFLAGS+=-lkvm
+ OBJS += src/unix/openbsd.o
+ OBJS += src/unix/kqueue.o
+@@ -113,7 +108,6 @@
+ EIO_CONFIG=config_cygwin.h
+ # We drop the --std=c89, it hides CLOCK_MONOTONIC on cygwin
+ CSTDFLAG = -D_GNU_SOURCE
+-CPPFLAGS += -Isrc/ares/config_cygwin
+ LINKFLAGS+=
+ OBJS += src/unix/cygwin.o
+ endif
+@@ -131,7 +125,7 @@
+ RUNNER_LIBS=
+ RUNNER_SRC=test/runner-unix.c
+
+-uv.a: $(OBJS) src/cares.o src/fs-poll.o src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o $(CARES_OBJS)
++uv.a: $(OBJS) src/cares.o src/fs-poll.o src/uv-common.o src/unix/ev/ev.o src/unix/uv-eio.o src/unix/eio/eio.o
+ $(AR) rcs uv.a $^
+
+ src/%.o: src/%.c include/uv.h include/uv-private/uv-unix.h
+@@ -157,7 +151,6 @@
+
+
+ clean-platform:
+- -rm -f src/ares/*.o
+ -rm -f src/unix/*.o
+ -rm -f src/unix/ev/*.o
+ -rm -f src/unix/eio/*.o
+@@ -165,7 +158,6 @@
+ -rm -rf test/run-tests.dSYM run-benchmarks.dSYM
+
+ distclean-platform:
+- -rm -f src/ares/*.o
+ -rm -f src/unix/*.o
+ -rm -f src/unix/ev/*.o
+ -rm -f src/unix/eio/*.o
+diff -dubr source/deps/uv/include/uv.h cares/deps/uv/include/uv.h
+--- source/deps/uv/include/uv.h 2012-10-26 00:49:32.000000000 +0400
++++ cares/deps/uv/include/uv.h 2012-11-01 21:17:00.331361102 +0400
+@@ -55,7 +55,7 @@
+ #include <stdint.h> /* int64_t */
+ #include <sys/types.h> /* size_t */
+
+-#include "ares.h"
++#include <ares.h>
+
+ #if defined(__unix__) || defined(__POSIX__) || defined(__APPLE__)
+ # include "uv-private/uv-unix.h"
+diff -dubr source/deps/uv/Makefile cares/deps/uv/Makefile
+--- source/deps/uv/Makefile 2012-10-26 00:49:32.000000000 +0400
++++ cares/deps/uv/Makefile 2012-11-01 21:19:24.730021729 +0400
+@@ -26,51 +26,6 @@
+
+ CPPFLAGS += -Iinclude -Iinclude/uv-private
+
+-CARES_OBJS =
+-CARES_OBJS += src/ares/ares__close_sockets.o
+-CARES_OBJS += src/ares/ares__get_hostent.o
+-CARES_OBJS += src/ares/ares__read_line.o
+-CARES_OBJS += src/ares/ares__timeval.o
+-CARES_OBJS += src/ares/ares_cancel.o
+-CARES_OBJS += src/ares/ares_data.o
+-CARES_OBJS += src/ares/ares_destroy.o
+-CARES_OBJS += src/ares/ares_expand_name.o
+-CARES_OBJS += src/ares/ares_expand_string.o
+-CARES_OBJS += src/ares/ares_fds.o
+-CARES_OBJS += src/ares/ares_free_hostent.o
+-CARES_OBJS += src/ares/ares_free_string.o
+-CARES_OBJS += src/ares/ares_gethostbyaddr.o
+-CARES_OBJS += src/ares/ares_gethostbyname.o
+-CARES_OBJS += src/ares/ares_getnameinfo.o
+-CARES_OBJS += src/ares/ares_getopt.o
+-CARES_OBJS += src/ares/ares_getsock.o
+-CARES_OBJS += src/ares/ares_init.o
+-CARES_OBJS += src/ares/ares_library_init.o
+-CARES_OBJS += src/ares/ares_llist.o
+-CARES_OBJS += src/ares/ares_mkquery.o
+-CARES_OBJS += src/ares/ares_nowarn.o
+-CARES_OBJS += src/ares/ares_options.o
+-CARES_OBJS += src/ares/ares_parse_a_reply.o
+-CARES_OBJS += src/ares/ares_parse_aaaa_reply.o
+-CARES_OBJS += src/ares/ares_parse_mx_reply.o
+-CARES_OBJS += src/ares/ares_parse_ns_reply.o
+-CARES_OBJS += src/ares/ares_parse_ptr_reply.o
+-CARES_OBJS += src/ares/ares_parse_srv_reply.o
+-CARES_OBJS += src/ares/ares_parse_txt_reply.o
+-CARES_OBJS += src/ares/ares_process.o
+-CARES_OBJS += src/ares/ares_query.o
+-CARES_OBJS += src/ares/ares_search.o
+-CARES_OBJS += src/ares/ares_send.o
+-CARES_OBJS += src/ares/ares_strcasecmp.o
+-CARES_OBJS += src/ares/ares_strdup.o
+-CARES_OBJS += src/ares/ares_strerror.o
+-CARES_OBJS += src/ares/ares_timeout.o
+-CARES_OBJS += src/ares/ares_version.o
+-CARES_OBJS += src/ares/ares_writev.o
+-CARES_OBJS += src/ares/bitncmp.o
+-CARES_OBJS += src/ares/inet_net_pton.o
+-CARES_OBJS += src/ares/inet_ntop.o
+-
+ ifneq (,$(findstring MINGW,$(uname_S)))
+ include config-mingw.mk
+ else
+@@ -82,9 +37,6 @@
+
+ all: uv.a
+
+-$(CARES_OBJS): %.o: %.c
+- $(CC) -o $*.o -c $(CFLAGS) $(CPPFLAGS) $< -DHAVE_CONFIG_H
+-
+ test/run-tests$(E): test/*.h test/run-tests.c $(RUNNER_SRC) test/runner-unix.c $(TESTS) uv.a
+ $(CC) $(CPPFLAGS) $(RUNNER_CFLAGS) -o test/run-tests test/run-tests.c \
+ test/runner.c $(RUNNER_SRC) $(TESTS) uv.a $(RUNNER_LIBS) $(RUNNER_LINKFLAGS)
+diff -dubr source/deps/uv/src/uv-common.c cares/deps/uv/src/uv-common.c
+--- source/deps/uv/src/uv-common.c 2012-10-26 00:49:32.000000000 +0400
++++ cares/deps/uv/src/uv-common.c 2012-11-01 21:17:00.332151637 +0400
+@@ -28,10 +28,8 @@
+ #include <stdlib.h> /* malloc */
+ #include <string.h> /* memset */
+
+-/* use inet_pton from c-ares if necessary */
+-#include "ares_config.h"
+-#include "ares/inet_net_pton.h"
+-#include "ares/inet_ntop.h"
++#include <ares.h>
++#include <arpa/inet.h>
+
+ #define XX(uc, lc) case UV_##uc: return sizeof(uv_##lc##_t);
+
+@@ -182,20 +180,20 @@
+
+ addr.sin6_family = AF_INET6;
+ addr.sin6_port = htons(port);
+- ares_inet_pton(AF_INET6, ip, &addr.sin6_addr);
++ inet_pton(AF_INET6, ip, &addr.sin6_addr);
+
+ return addr;
+ }
+
+
+ int uv_ip4_name(struct sockaddr_in* src, char* dst, size_t size) {
+- const char* d = ares_inet_ntop(AF_INET, &src->sin_addr, dst, size);
++ const char* d = inet_ntop(AF_INET, &src->sin_addr, dst, size);
+ return d != dst;
+ }
+
+
+ int uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size) {
+- const char* d = ares_inet_ntop(AF_INET6, &src->sin6_addr, dst, size);
++ const char* d = inet_ntop(AF_INET6, &src->sin6_addr, dst, size);
+ return d != dst;
+ }
+
+diff -dubr source/deps/uv/uv.gyp cares/deps/uv/uv.gyp
+--- source/deps/uv/uv.gyp 2012-10-26 00:49:32.000000000 +0400
++++ cares/deps/uv/uv.gyp 2012-11-01 21:17:00.332535345 +0400
+@@ -53,70 +53,6 @@
+ 'src/fs-poll.c',
+ 'src/uv-common.c',
+ 'src/uv-common.h',
+- 'src/ares/ares_cancel.c',
+- 'src/ares/ares__close_sockets.c',
+- 'src/ares/ares_data.c',
+- 'src/ares/ares_data.h',
+- 'src/ares/ares_destroy.c',
+- 'src/ares/ares_dns.h',
+- 'src/ares/ares_expand_name.c',
+- 'src/ares/ares_expand_string.c',
+- 'src/ares/ares_fds.c',
+- 'src/ares/ares_free_hostent.c',
+- 'src/ares/ares_free_string.c',
+- 'src/ares/ares_getenv.h',
+- 'src/ares/ares_gethostbyaddr.c',
+- 'src/ares/ares_gethostbyname.c',
+- 'src/ares/ares__get_hostent.c',
+- 'src/ares/ares_getnameinfo.c',
+- 'src/ares/ares_getopt.c',
+- 'src/ares/ares_getopt.h',
+- 'src/ares/ares_getsock.c',
+- 'src/ares/ares_init.c',
+- 'src/ares/ares_ipv6.h',
+- 'src/ares/ares_library_init.c',
+- 'src/ares/ares_library_init.h',
+- 'src/ares/ares_llist.c',
+- 'src/ares/ares_llist.h',
+- 'src/ares/ares_mkquery.c',
+- 'src/ares/ares_nowarn.c',
+- 'src/ares/ares_nowarn.h',
+- 'src/ares/ares_options.c',
+- 'src/ares/ares_parse_aaaa_reply.c',
+- 'src/ares/ares_parse_a_reply.c',
+- 'src/ares/ares_parse_mx_reply.c',
+- 'src/ares/ares_parse_ns_reply.c',
+- 'src/ares/ares_parse_ptr_reply.c',
+- 'src/ares/ares_parse_srv_reply.c',
+- 'src/ares/ares_parse_txt_reply.c',
+- 'src/ares/ares_platform.h',
+- 'src/ares/ares_private.h',
+- 'src/ares/ares_process.c',
+- 'src/ares/ares_query.c',
+- 'src/ares/ares__read_line.c',
+- 'src/ares/ares_rules.h',
+- 'src/ares/ares_search.c',
+- 'src/ares/ares_send.c',
+- 'src/ares/ares_setup.h',
+- 'src/ares/ares_strcasecmp.c',
+- 'src/ares/ares_strcasecmp.h',
+- 'src/ares/ares_strdup.c',
+- 'src/ares/ares_strdup.h',
+- 'src/ares/ares_strerror.c',
+- 'src/ares/ares_timeout.c',
+- 'src/ares/ares__timeval.c',
+- 'src/ares/ares_version.c',
+- 'src/ares/ares_writev.c',
+- 'src/ares/ares_writev.h',
+- 'src/ares/bitncmp.c',
+- 'src/ares/bitncmp.h',
+- 'src/ares/inet_net_pton.c',
+- 'src/ares/inet_net_pton.h',
+- 'src/ares/inet_ntop.c',
+- 'src/ares/inet_ntop.h',
+- 'src/ares/nameser.h',
+- 'src/ares/setup_once.h',
+- 'src/ares/windows_port.c',
+ ],
+ 'conditions': [
+ [ 'OS=="win"', {
diff --git a/examples/nodejs/patches/02-rename-node-to-nodejs.patch b/examples/nodejs/patches/02-rename-node-to-nodejs.patch
new file mode 100644
index 0000000..8e6c9e5
--- /dev/null
+++ b/examples/nodejs/patches/02-rename-node-to-nodejs.patch
@@ -0,0 +1,34 @@
+diff -dubr source/doc/node.1 rename/doc/node.1
+--- source/doc/node.1 2012-10-26 00:49:56.000000000 +0400
++++ rename/doc/node.1 2012-11-01 21:57:48.271896703 +0400
+@@ -2,12 +2,12 @@
+
+
+ .SH "NAME"
+-node \- Server-side JavaScript
++nodejs \- Server-side JavaScript
+
+ .SH SYNOPSIS
+
+
+-.B node
++.B nodejs
+ [
+ .B \-v
+ ]
+diff -dubr source/tools/wafadmin/Tools/node_addon.py rename/tools/wafadmin/Tools/node_addon.py
+--- source/tools/wafadmin/Tools/node_addon.py 2012-10-26 00:49:32.000000000 +0400
++++ rename/tools/wafadmin/Tools/node_addon.py 2012-11-01 21:59:05.441880615 +0400
+@@ -26,10 +26,10 @@
+ conf.env['PREFIX_NODE'] = get_prefix()
+ prefix = conf.env['PREFIX_NODE']
+ lib = join(prefix, 'lib')
+- nodebin = join(prefix, 'bin', 'node')
++ nodebin = join(prefix, 'bin', 'nodejs')
+
+ conf.env['LIBPATH_NODE'] = lib
+- conf.env['CPPPATH_NODE'] = join(prefix, 'include', 'node')
++ conf.env['CPPPATH_NODE'] = join(prefix, 'include', 'nodejs')
+
+ conf.env.append_value('CPPFLAGS_NODE', '-D_GNU_SOURCE')
+
diff --git a/examples/nodejs/patches/03-waf.patch b/examples/nodejs/patches/03-waf.patch
new file mode 100644
index 0000000..0eda3dc
--- /dev/null
+++ b/examples/nodejs/patches/03-waf.patch
@@ -0,0 +1,16 @@
+diff -dubr source/tools/node-waf waf/tools/node-waf
+--- source/tools/node-waf 2012-10-26 00:49:32.000000000 +0400
++++ waf/tools/node-waf 2012-11-01 23:20:51.438482412 +0400
+@@ -5,7 +5,11 @@
+ join = os.path.join
+ bindir = os.path.dirname(os.path.realpath(__file__))
+ prefix = join(bindir, "..")
+-wafdir = join(prefix, "lib", "node")
++if os.environ.has_key('PREFIX_NODE'):
++ prefix = os.environ['PREFIX_NODE']
++else:
++ prefix = "/usr"
++wafdir = join(prefix, "share", "nodejs")
+
+ w = join(wafdir, 'wafadmin')
+ t = join(w, 'Tools')
diff --git a/examples/nodejs/patches/04-lib-path.patch b/examples/nodejs/patches/04-lib-path.patch
new file mode 100644
index 0000000..c3ff124
--- /dev/null
+++ b/examples/nodejs/patches/04-lib-path.patch
@@ -0,0 +1,24 @@
+diff -dubr source/lib/module.js libpath/lib/module.js
+--- source/lib/module.js 2012-10-26 00:49:32.000000000 +0400
++++ libpath/lib/module.js 2012-11-01 23:30:34.638509805 +0400
+@@ -493,7 +493,7 @@
+ };
+
+ Module._initPaths = function() {
+- var paths = [path.resolve(process.execPath, '..', '..', 'lib', 'node')];
++ var paths = ['/usr/lib/nodejs'];
+
+ if (process.env['HOME']) {
+ paths.unshift(path.resolve(process.env['HOME'], '.node_libraries'));
+diff -dubr source/tools/wafadmin/Tools/node_addon.py libpath/tools/wafadmin/Tools/node_addon.py
+--- source/tools/wafadmin/Tools/node_addon.py 2012-11-01 23:22:54.032306132 +0400
++++ libpath/tools/wafadmin/Tools/node_addon.py 2012-11-01 23:29:37.203544596 +0400
+@@ -70,7 +70,7 @@
+ nodePath = None
+ if not os.environ.has_key('NODE_PATH'):
+ if not os.environ.has_key('HOME'):
+- nodePath = join(get_prefix(), 'lib', 'node')
++ nodePath = join(get_prefix(), 'lib', 'nodejs')
+ else:
+ nodePath = join(os.environ['HOME'], '.node_libraries')
+ else: