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

Bug#671550: nodejs: building on kfreebsd-* (WIP)



Package: src:nodejs
Version: 0.6.16~dfsg1-2
Severity: wishlist
User: debian-bsd@lists.debian.org
Usertags: kfreebsd
X-Debbugs-Cc: debian-bsd@lists.debian.org

Hi,

Attached are *unfinished* patches for building nodejs on kfreebsd-*

3000_kfreebsd-1.diff is bad, as it patches something meant for FreeBSD
3010_kfreebsd-2.diff just adds GNU/kFreeBSD as a freebsd-like target
3020_kfreebsd-3.diff patches code so that it can build on GNU/kFreeBSD

They are published here so that they can be finished someday or someone
can use them to use nodejs in the meantime.

There are some test failures to note:
* test-fs-watch -- ENOSYS = not supported?
* test-fs-utimes -- not supported?  (was building on ZFS)
* test-http-upgrade-server -- looks like some sort of chunking issue,
works if I change the HTTP request to HTTP/1.0
* test-setproctitle -- currently a no-op in GNU/kFreeBSD's eglibc

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
--- nodejs-0.6.16~dfsg1.orig/deps/uv/src/unix/eio/eio.c
+++ nodejs-0.6.16~dfsg1/deps/uv/src/unix/eio/eio.c
@@ -316,7 +316,7 @@ static int gettimeofday(struct timeval *
 #if HAVE_SENDFILE
 # if __linux
 #  include <sys/sendfile.h>
-# elif __FreeBSD__ || __DragonFly__ || defined __APPLE__
+# elif __FreeBSD__ || __FreeBSD_kernel__ || __DragonFly__ || defined __APPLE__
 #  include <sys/socket.h>
 #  include <sys/uio.h>
 # elif __hpux
--- nodejs-0.6.16~dfsg1.orig/src/platform_freebsd.cc
+++ nodejs-0.6.16~dfsg1/src/platform_freebsd.cc
@@ -34,7 +34,11 @@
 #include <string.h>
 #include <paths.h>
 #include <fcntl.h>
+#if defined(__GLIBC__)
+#include <bsd/unistd.h>
+#else
 #include <unistd.h>
+#endif
 #include <time.h>
 
 
--- nodejs-0.6.16~dfsg1.orig/tools/wafadmin/Tools/ccroot.py	2012-04-30 18:42:50.000000000 +0100
+++ nodejs-0.6.16~dfsg1/tools/wafadmin/Tools/ccroot.py	2012-05-04 23:50:08.767391792 +0100
@@ -66,6 +66,7 @@
 			'__linux__'   : 'linux',
 			'__GNU__'     : 'hurd',
 			'__FreeBSD__' : 'freebsd',
+			'__FreeBSD_kernel__' : 'freebsd',
 			'__NetBSD__'  : 'netbsd',
 			'__OpenBSD__' : 'openbsd',
 			'__sun'       : 'sunos',
--- nodejs-0.6.16~dfsg1.orig/deps/uv/config-unix.mk	2012-05-04 23:45:19.000000000 +0100
+++ nodejs-0.6.16~dfsg1/deps/uv/config-unix.mk	2012-05-04 23:50:10.817219567 +0100
@@ -72,6 +72,15 @@
 OBJS += src/unix/kqueue.o
 endif
 
+ifeq (GNU/kFreeBSD,$(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
+endif
+
 ifeq (DragonFly,$(uname_S))
 EV_CONFIG=config_freebsd.h
 EIO_CONFIG=config_freebsd.h
--- nodejs-0.6.16~dfsg1.orig/wscript	2012-05-04 23:45:19.000000000 +0100
+++ nodejs-0.6.16~dfsg1/wscript	2012-05-04 23:50:05.187249113 +0100
@@ -327,12 +327,12 @@
   if Options.options.efence:
     conf.check(lib='efence', libpath=['/usr/lib', '/usr/local/lib'], uselib_store='EFENCE')
 
-  if 'bsd' in sys.platform:
-     if not conf.check(lib="execinfo",
-                       includes=['/usr/include', '/usr/local/include'],
-                       libpath=['/usr/lib', '/usr/local/lib'],
-                       uselib_store="EXECINFO"):
-       conf.fatal("Install the libexecinfo port from /usr/ports/devel/libexecinfo.")
+#  if 'bsd' in sys.platform:
+#     if not conf.check(lib="execinfo",
+#                       includes=['/usr/include', '/usr/local/include'],
+#                       libpath=['/usr/lib', '/usr/local/lib'],
+#                       uselib_store="EXECINFO"):
+#       conf.fatal("Install the libexecinfo port from /usr/ports/devel/libexecinfo.")
 
   if not Options.options.without_ssl:
     # Don't override explicitly supplied openssl paths with pkg-config results.

Reply to: