Update node to use lang/libv8
OK jeremy@
This commit is contained in:
parent
19a48052be
commit
c6737d8b53
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.10 2012/09/28 01:04:14 abieber Exp $
|
||||
# $OpenBSD: Makefile,v 1.11 2012/12/05 00:40:27 abieber Exp $
|
||||
|
||||
# XXX:
|
||||
# - Needs __ARM_NR_cacheflush (or the like) to work on arm-based ports.
|
||||
@ -13,6 +13,8 @@ NODE_VERSION= v0.8.11
|
||||
DISTNAME= node-${NODE_VERSION}
|
||||
PKGNAME= ${DISTNAME:S/v//g}
|
||||
|
||||
REVISION=0
|
||||
|
||||
CATEGORIES= lang devel
|
||||
|
||||
HOMEPAGE= http://nodejs.org/
|
||||
@ -37,7 +39,9 @@ LIB_DEPENDS= devel/libexecinfo
|
||||
|
||||
USE_GMAKE= Yes
|
||||
|
||||
BUILD_DEPENDS= sysutils/flock
|
||||
BUILD_DEPENDS= sysutils/flock \
|
||||
lang/libv8
|
||||
|
||||
# node-gyp uses it at runtime
|
||||
RUN_DEPENDS= devel/gmake \
|
||||
sysutils/flock
|
||||
@ -48,10 +52,12 @@ MODPY_ADJ_FILES= tools/node-waf \
|
||||
REGRESS_TARGET= test
|
||||
CONFIGURE_STYLE= simple
|
||||
CONFIGURE_ARGS= --openssl-use-sys \
|
||||
--shared-zlib
|
||||
--shared-zlib \
|
||||
--shared-v8
|
||||
|
||||
SUBST_VARS+= CFLAGS
|
||||
SUBST_VARS+= PREFIX
|
||||
SUBST_VARS+= LOCALBASE
|
||||
SUBST_VARS+= DISTFILES
|
||||
|
||||
MAKE_ENV+= V=1 CXX=c++ CCFLAGS+="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
|
||||
@ -63,7 +69,8 @@ pre-configure:
|
||||
ln -sf ${LOCALBASE}/bin/python${MODPY_VERSION} ${WRKDIR}/bin/python
|
||||
${SUBST_CMD} ${WRKDIST}/lib/module.js \
|
||||
${WRKDIST}/deps/npm/node_modules/node-gyp/lib/configure.js \
|
||||
${WRKDIST}/deps/npm/node_modules/node-gyp/lib/install.js
|
||||
${WRKDIST}/deps/npm/node_modules/node-gyp/lib/install.js \
|
||||
${WRKDIST}/common.gypi
|
||||
|
||||
post-install:
|
||||
${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py \
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: node.port.mk,v 1.1.1.1 2012/05/23 15:11:43 jasper Exp $
|
||||
# $OpenBSD: node.port.mk,v 1.2 2012/12/05 00:40:28 abieber Exp $
|
||||
|
||||
# node module
|
||||
|
||||
@ -16,8 +16,9 @@ RUN_DEPENDS += lang/node>=0.6.17p2
|
||||
ERRORS += "Fatal: Should not have PKG_ARCH=* when compiling extensions"
|
||||
. endif
|
||||
SHARED_ONLY = Yes
|
||||
# All node extensions appear to link against these two libraries
|
||||
WANTLIB += m stdc++
|
||||
# All node extensions appear to link against these libraries
|
||||
WANTLIB += m stdc++ v8 crypto pthread ssl z
|
||||
LIB_DEPENDS += lang/libv8
|
||||
. else
|
||||
# Node libraries that don't contain C++ extensions should run on
|
||||
# any arch.
|
||||
|
17
lang/node/patches/patch-common_gypi
Normal file
17
lang/node/patches/patch-common_gypi
Normal file
@ -0,0 +1,17 @@
|
||||
$OpenBSD: patch-common_gypi,v 1.3 2012/12/05 00:40:28 abieber Exp $
|
||||
--- common.gypi.orig Thu Sep 27 10:39:23 2012
|
||||
+++ common.gypi Tue Oct 9 13:01:32 2012
|
||||
@@ -161,9 +161,12 @@
|
||||
],
|
||||
}],
|
||||
[ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
|
||||
- 'cflags': [ '-Wall', '-pthread', ],
|
||||
+ 'cflags': [ '-Wall', '-pthread', '-I${LOCALBASE}/include'],
|
||||
'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ],
|
||||
'ldflags': [ '-pthread', '-rdynamic' ],
|
||||
+ 'libraries': [
|
||||
+ '-L${LOCALBASE}/lib'
|
||||
+ ],
|
||||
'conditions': [
|
||||
[ 'target_arch=="ia32"', {
|
||||
'cflags': [ '-m32' ],
|
@ -1,26 +0,0 @@
|
||||
$OpenBSD: patch-deps_v8_SConstruct,v 1.1.1.1 2012/05/23 15:11:43 jasper Exp $
|
||||
|
||||
- Remove extra zoom-zoom!
|
||||
- Don't link with -lpthread but use -pthread instead.
|
||||
|
||||
--- deps/v8/SConstruct.orig Wed Nov 16 13:43:22 2011
|
||||
+++ deps/v8/SConstruct Wed Nov 16 13:44:20 2011
|
||||
@@ -94,7 +94,7 @@ LIBRARY_FLAGS = {
|
||||
'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'],
|
||||
},
|
||||
'mode:release': {
|
||||
- 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections',
|
||||
+ 'CCFLAGS': ['-fomit-frame-pointer', '-fdata-sections',
|
||||
'-ffunction-sections'],
|
||||
},
|
||||
'os:linux': {
|
||||
@@ -358,7 +358,8 @@ MKSNAPSHOT_EXTRA_FLAGS = {
|
||||
'LINKFLAGS': ['-mt']
|
||||
},
|
||||
'os:openbsd': {
|
||||
- 'LIBS': ['execinfo', 'pthread']
|
||||
+ 'LIBS': ['execinfo'],
|
||||
+ 'LINKFLAGS': ['-pthread'],
|
||||
},
|
||||
'os:win32': {
|
||||
'LIBS': ['winmm', 'ws2_32'],
|
@ -1,19 +0,0 @@
|
||||
$OpenBSD: patch-deps_v8_src_atomicops_h,v 1.2 2012/09/18 13:56:09 abieber Exp $
|
||||
|
||||
This patch can be removed when node has has r12522 of v8 as a dep.
|
||||
- https://code.google.com/p/v8/source/detail?r=12522
|
||||
|
||||
--- deps/v8/src/atomicops.h.orig Tue Nov 8 18:37:38 2011
|
||||
+++ deps/v8/src/atomicops.h Tue Nov 8 18:38:53 2011
|
||||
@@ -69,7 +69,11 @@ typedef intptr_t Atomic64;
|
||||
|
||||
// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or
|
||||
// Atomic64 routines below, depending on your architecture.
|
||||
+#if defined(__OpenBSD__) && defined(__i386__)
|
||||
+typedef Atomic32 AtomicWord;
|
||||
+#else
|
||||
typedef intptr_t AtomicWord;
|
||||
+#endif
|
||||
|
||||
// Atomically execute:
|
||||
// result = *ptr;
|
@ -1,34 +0,0 @@
|
||||
$OpenBSD: patch-deps_v8_src_heap_cc,v 1.2 2012/06/28 08:30:28 jasper Exp $
|
||||
--- deps/v8/src/heap.cc.orig Wed Jun 20 09:32:21 2012
|
||||
+++ deps/v8/src/heap.cc Wed Jun 20 09:33:24 2012
|
||||
@@ -5777,6 +5777,30 @@ bool Heap::ConfigureHeap(int max_semispace_size,
|
||||
initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_);
|
||||
external_allocation_limit_ = 10 * max_semispace_size_;
|
||||
|
||||
+ intptr_t max_virtual = OS::MaxVirtualMemory();
|
||||
+
|
||||
+ if (max_virtual > 0) {
|
||||
+ intptr_t half = max_virtual >> 1;
|
||||
+ intptr_t quarter = max_virtual >> 2;
|
||||
+ // If we have limits on the amount of virtual memory we can use then we may
|
||||
+ // be forced to lower the allocation limits. We reserve one quarter of the
|
||||
+ // memory for young space and off-heap data. The rest is distributed as
|
||||
+ // described below.
|
||||
+ if (code_range_size_ > 0) {
|
||||
+ // Reserve a quarter of the memory for the code range. The old space
|
||||
+ // heap gets the remaining half. There is some unavoidable double
|
||||
+ // counting going on here since the heap size is measured in committed
|
||||
+ // virtual memory and the code range is only reserved virtual memory.
|
||||
+ code_range_size_ = Min(code_range_size_, quarter);
|
||||
+ max_old_generation_size_ = Min(max_old_generation_size_, half);
|
||||
+ } else {
|
||||
+ // Reserve three quarters of the memory for the old space heap including
|
||||
+ // the executable code.
|
||||
+ max_old_generation_size_ = Min(max_old_generation_size_, half + quarter);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+
|
||||
// The old generation is paged and needs at least one page for each space.
|
||||
int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
|
||||
max_old_generation_size_ = Max(static_cast<intptr_t>(paged_space_count *
|
@ -1,19 +0,0 @@
|
||||
$OpenBSD: patch-deps_v8_src_platform_h,v 1.2 2012/09/18 13:56:09 abieber Exp $
|
||||
|
||||
This patch can be removed when node has has r12522 of v8 as a dep.
|
||||
- https://code.google.com/p/v8/source/detail?r=12522
|
||||
|
||||
--- deps/v8/src/platform.h.orig Tue Nov 8 18:35:23 2011
|
||||
+++ deps/v8/src/platform.h Tue Nov 8 18:39:05 2011
|
||||
@@ -88,7 +88,11 @@ namespace internal {
|
||||
|
||||
// Use AtomicWord for a machine-sized pointer. It is assumed that
|
||||
// reads and writes of naturally aligned values of this type are atomic.
|
||||
+#if defined(__OpenBSD__) && defined(__i386__)
|
||||
+typedef Atomic32 AtomicWord;
|
||||
+#else
|
||||
typedef intptr_t AtomicWord;
|
||||
+#endif
|
||||
|
||||
class Semaphore;
|
||||
class Mutex;
|
Loading…
Reference in New Issue
Block a user