[oe] [PATCH] added a .bb for node.js
AJ ONeal
coolaj86 at gmail.com
Thu Aug 19 06:07:48 UTC 2010
---
recipes/node/files/libev-arm-cross.patch | 45 ++++++++++++++++++++++++++++++
recipes/node/files/node-arm-cross.patch | 31 ++++++++++++++++++++
recipes/node/node_0.1.104.bb | 28 ++++++++++++++++++
recipes/node/node_v0.1.104.bb | 23 +++++++++++++++
4 files changed, 127 insertions(+), 0 deletions(-)
create mode 100644 recipes/node/files/libev-arm-cross.patch
create mode 100644 recipes/node/files/node-arm-cross.patch
create mode 100644 recipes/node/node_0.1.104.bb
create mode 100644 recipes/node/node_v0.1.104.bb
diff --git a/recipes/node/files/libev-arm-cross.patch b/recipes/node/files/libev-arm-cross.patch
new file mode 100644
index 0000000..340dd98
--- /dev/null
+++ b/recipes/node/files/libev-arm-cross.patch
@@ -0,0 +1,45 @@
+diff --git node-v0.1.104/deps/libev/wscript.orig node-v0.1.104/deps/libev/wscript
+index 19e7bb2..a62f418 100644
+--- node-v0.1.104/deps/libev/wscript.orig
++++ node-v0.1.104/deps/libev/wscript
+@@ -40,20 +40,27 @@ def configure(conf):
+ if conf.check_cc(header_name="sys/eventfd.h"):
+ conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd")
+
++ # TODO find a way to determine this from the environment
++ CROSS = True
++ TARGET_OS = "linux"
+
+- code = """
+- #include <syscall.h>
+- #include <time.h>
+- #include <stdio.h>
+-
+- int main() {
+- struct timespec ts;
+- int status = syscall(SYS_clock_gettime, CLOCK_REALTIME, &ts);
+- return 0;
+- }
+- """
+- conf.check_cc(fragment=code, define_name="HAVE_CLOCK_SYSCALL", execute=True,
+- msg="Checking for SYS_clock_gettime")
++ if CROSS:
++ if TARGET_OS == 'linux':
++ conf.define("HAVE_CLOCK_SYSCALL", 1)
++ else:
++ code = """
++ #include <syscall.h>
++ #include <time.h>
++ #include <stdio.h>
++
++ int main() {
++ struct timespec ts;
++ int status = syscall(SYS_clock_gettime, CLOCK_REALTIME, &ts);
++ return 0;
++ }
++ """
++ conf.check_cc(fragment=code, define_name="HAVE_CLOCK_SYSCALL", execute=True,
++ msg="Checking for SYS_clock_gettime")
+
+ have_librt = conf.check(lib='rt', uselib_store='RT')
+ if have_librt:
diff --git a/recipes/node/files/node-arm-cross.patch b/recipes/node/files/node-arm-cross.patch
new file mode 100644
index 0000000..8ee6c18
--- /dev/null
+++ b/recipes/node/files/node-arm-cross.patch
@@ -0,0 +1,31 @@
+diff --git node-v0.1.104/wscript.orig node-v0.1.104/wscript
+index ba60514..d6a54fe 100644
+--- node-v0.1.104/wscript.orig
++++ node-v0.1.104/wscript
+@@ -313,17 +313,25 @@ def v8_cmd(bld, variant):
+ # cannot see symbols in the executable which are hidden, even if the
+ # executable is statically linked together...
+
++ HOST_CPU = 'not-arm' # TODO probe for this
++ snapshot = 'snapshot=on'
++
+ # XXX Remove this when v8 defaults x86_64 to native builds
+ arch = ""
+ if bld.env['DEST_CPU'] == 'x86_64':
+ arch = "arch=x64"
++ elif bld.env['DEST_CPU'] == 'arm':
++ arch = "arch=arm"
++
++ if bld.env['DEST_CPU'] != HOST_CPU:
++ snapshot = ""
+
+ if variant == "default":
+ mode = "release"
+ else:
+ mode = "debug"
+
+- cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static snapshot=on'
++ cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static ' + snapshot
+
+ cmd = cmd_R % ( scons
+ , Options.options.jobs
diff --git a/recipes/node/node_0.1.104.bb b/recipes/node/node_0.1.104.bb
new file mode 100644
index 0000000..a99eaff
--- /dev/null
+++ b/recipes/node/node_0.1.104.bb
@@ -0,0 +1,28 @@
+DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
+PR = "r0"
+DEPENDS = "openssl"
+SRC_URI = " \
+http://nodejs.org/dist/node-v${PV}.tar.gz \
+file://libev-arm-cross.patch;apply=yes \
+file://node-arm-cross.patch;apply=yes \
+"
+SRC_URI[md5sum] = "907fa1e0a2f1f0c3df5efc97fd05a7d2"
+SRC_URI[sha256sum] = "a1c776f44bc07305dc0e56df17cc3260eaafa0394c3b06c27448ad85bec272df"
+S = "${WORKDIR}/node-v${PV}"
+do_configure () {
+export DEST_CPU=arm
+./configure
+# skip complaints about 'config.log'
+cat /dev/null > ${S}/build/config.log
+}
+do_qa_configure () {
+}
+do_compile () {
+export DEST_CPU=arm
+make
+}
+do_install () {
+install -d ${D}${bindir}/
+install -m 0755 ${S}/node ${D}${bindir}/
+}
+FILES_${PN} = "${bindir}/node"
diff --git a/recipes/node/node_v0.1.104.bb b/recipes/node/node_v0.1.104.bb
new file mode 100644
index 0000000..368b8fb
--- /dev/null
+++ b/recipes/node/node_v0.1.104.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
+PR = "r0"
+DEPENDS = "openssl"
+SRC_URI = " \
+http://nodejs.org/dist/node-v${PV}.tar.gz \
+"
+#libev-cross.patch
+#node-cross.patch
+SRC_URI[md5sum] = "907fa1e0a2f1f0c3df5efc97fd05a7d2"
+SRC_URI[sha256sum] = "a1c776f44bc07305dc0e56df17cc3260eaafa0394c3b06c27448ad85bec272df"
+S = "${WORKDIR}/node-v${PV}"
+do_configure () {
+./configure
+}
+do_compile () {
+export DEST_CPU=arm
+make
+}
+do_install () {
+install -d ${D}${bindir}/
+install -m 0755 ${S}/node ${D}${bindir}/
+}
+FILES_${PN} = "${bindir}/node"
--
1.6.0.4
More information about the Openembedded-devel
mailing list