From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from webbox1416.server-home.net ([77.236.96.61]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1Xyi1c-00037N-7m for ptxdist@pengutronix.de; Wed, 10 Dec 2014 15:13:57 +0100 From: Alexander Stein Date: Wed, 10 Dec 2014 15:15:59 +0100 Message-ID: <4961360.eNN5MKTsZz@ws-stein> In-Reply-To: <9af5f7d36de7a1b496ce9431df9c1702@miromico.ch> References: <546EE97A.40102@miromico.ch> <254E6C49-779D-41BB-ABF6-13F482F16823@emailplus.org> <9af5f7d36de7a1b496ce9431df9c1702@miromico.ch> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1581741.1aAjY35VAY" Content-Transfer-Encoding: 7Bit Subject: Re: [ptxdist] Integration of node.js Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Alexander Raimondi This is a multi-part message in MIME format. --nextPart1581741.1aAjY35VAY Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hello Alexander :), On Wednesday 10 December 2014 09:38:58, Alexander Raimondi wrote: > Hi Jean-Claude > > Yes, I can give you my current work state. It is attached as tar.gz Thanks for your current work. By coincidence I need to take a look at nodejs myself :) > You will find: > - A patch that will add support for node.js to a local project (not > into ptxdist itself) > - A local_src directory with a build script > > Everything is based on ptxdist 14.1.0 (from phytec) > > Some comments > - I only tested node +ssl +npm (no ssl doesn't compile for some reason) Thanks for your effor so far. I've done some work based on it, e.g. compile without ssl is patched. I also cleaned up the rules a bit, including moving to cross. Feel free to try and comment. Best regards, Alexander -- Dipl.-Inf. Alexander Stein SYS TEC electronic GmbH Am Windrad 2 08468 Heinsdorfergrund Tel.: 03765 38600-1156 Fax: 03765 38600-4100 Email: alexander.stein@systec-electronic.com Website: www.systec-electronic.com Managing Director: Dipl.-Phys. Siegmar Schmidt Commercial registry: Amtsgericht Chemnitz, HRB 28082 --nextPart1581741.1aAjY35VAY Content-Disposition: attachment; filename="0001-Add-node.js.patch" Content-Transfer-Encoding: quoted-printable Content-Type: text/x-patch; charset="UTF-8"; name="0001-Add-node.js.patch" >From 118e006c128ff7c873b898bf3869bd7e0c3c9cd7 Mon Sep 17 00:00:00 2001 From: Alexander Stein Date: Wed, 10 Dec 2014 15:09:40 +0100 Subject: [PATCH 1/1] Add node.js Signed-off-by: Alexander Stein --- .../0001-node.cc-Fix-without-ssl-compilation.patch | 38 +++++ patches/node-v0.10.33/series | 4 + rules/cross-node.in | 13 ++ rules/cross-node.make | 31 +++++ rules/node.in | 30 ++++ rules/node.make | 154 +++++++++++++= ++++++++ 6 files changed, 270 insertions(+) create mode 100644 patches/node-v0.10.33/0001-node.cc-Fix-without-ssl-= compilation.patch create mode 100644 patches/node-v0.10.33/series create mode 100644 rules/cross-node.in create mode 100644 rules/cross-node.make create mode 100644 rules/node.in create mode 100644 rules/node.make diff --git a/patches/node-v0.10.33/0001-node.cc-Fix-without-ssl-compila= tion.patch b/patches/node-v0.10.33/0001-node.cc-Fix-without-ssl-compila= tion.patch new file mode 100644 index 0000000..c7ac4d5 --- /dev/null +++ b/patches/node-v0.10.33/0001-node.cc-Fix-without-ssl-compilation.pa= tch @@ -0,0 +1,38 @@ +From: Alexander Stein +Date: Wed, 10 Dec 2014 11:56:59 +0100 +Subject: [PATCH] node.cc: Fix --without-ssl compilation + +The SSL parts of code were not encapsulated correctly. + +Signed-off-by: Alexander Stein = +--- + src/node.cc | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/node.cc b/src/node.cc +index 18c743f..0d67745 100644 +--- a/src/node.cc ++++ b/src/node.cc +@@ -82,7 +82,6 @@ typedef int mode_t; + #include "node_script.h" + #include "v8_typed_array.h" +=20 +-#include "node_crypto.h" + #include "util.h" +=20 + using namespace v8; +@@ -2579,12 +2578,14 @@ static void ParseArgs(int argc, char **argv) {= + p =3D 1 + strchr(arg, '=3D'); + max_stack_size =3D atoi(p); + argv[i] =3D const_cast(""); ++#if HAVE_OPENSSL + } else if (strcmp(arg, "--enable-ssl2") =3D=3D 0) { + SSL2_ENABLE =3D true; + argv[i] =3D const_cast(""); + } else if (strcmp(arg, "--enable-ssl3") =3D=3D 0) { + SSL3_ENABLE =3D true; + argv[i] =3D const_cast(""); ++#endif + } else if (strcmp(arg, "--help") =3D=3D 0 || strcmp(arg, "-h") =3D= =3D 0) { + PrintHelp(); + exit(0); diff --git a/patches/node-v0.10.33/series b/patches/node-v0.10.33/serie= s new file mode 100644 index 0000000..a75a360 --- /dev/null +++ b/patches/node-v0.10.33/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-node.cc-Fix-without-ssl-compilation.patch +# 43e6493f1a10493aadadef4852982922 - git-ptx-patches magic diff --git a/rules/cross-node.in b/rules/cross-node.in new file mode 100644 index 0000000..5e467e0 --- /dev/null +++ b/rules/cross-node.in @@ -0,0 +1,13 @@ +## SECTION=3Dcrosstools + +config CROSS_NODE +=09bool +=09help +=09 Fast, scalable network application scripting environment + +=09 Node.js=C2=AE is a platform built on Chrome's JavaScript runtime = for +=09 easily building fast, scalable network applications. Node.js uses= +=09 an event-driven, non-blocking I/O model that makes it lightweight= +=09 and efficient, perfect for data-intensive real-time applications +=09 that run across distributed devices. + diff --git a/rules/cross-node.make b/rules/cross-node.make new file mode 100644 index 0000000..5077742 --- /dev/null +++ b/rules/cross-node.make @@ -0,0 +1,31 @@ +# -*-makefile-*- +# +# Copyright (C) 2014 by Alex Raimondi +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license condit= ions +# see the README file. +# + +# +# We provide this package +# +CROSS_PACKAGES-$(PTXCONF_CROSS_NODE) +=3D cross-node + +# +# autoconf +# +CROSS_NODE_CONF_OPT=09:=3D --prefix=3D/usr \ +=09=09 =09--without-snapshot \ +=09=09 =09--dest-os=3Dlinux + +$(STATEDIR)/host-node.prepare: +=09@$(call targetinfo) +=09@$(call clean, $(CROSS_NODE_DIR)/config.cache) +=09cd $(CROSS_NODE_DIR) && \ +=09=09$(CROSS_NODE_PATH) $(CROSS_NODE_ENV) \ +=09=09./configure $(CROSS_NODE_CONF_OPT) +=09@$(call touch) + +# vim: syntax=3Dmake diff --git a/rules/node.in b/rules/node.in new file mode 100644 index 0000000..47fe839 --- /dev/null +++ b/rules/node.in @@ -0,0 +1,30 @@ +## SECTION=3Dnetworking + +menuconfig NODE +=09tristate +=09prompt "node " +=09select CROSS_NODE +=09help +=09 Fast, scalable network application scripting environment + +=09 Node.js=C2=AE is a platform built on Chrome's JavaScript runtime = for +=09 easily building fast, scalable network applications. Node.js uses= +=09 an event-driven, non-blocking I/O model that makes it lightweight= +=09 and efficient, perfect for data-intensive real-time applications +=09 that run across distributed devices. + +if NODE + +config NODE_SSL +=09tristate +=09prompt "SSL support" +=09help +=09 Enable support for ssl + +config NODE_NPM +=09tristate +=09prompt "Include npm packet manager" +=09help +=09 Include packet manager + +endif diff --git a/rules/node.make b/rules/node.make new file mode 100644 index 0000000..b711eec --- /dev/null +++ b/rules/node.make @@ -0,0 +1,154 @@ +# -*-makefile-*- +# +# Copyright (C) 2014 by Alex Raimondi +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license condit= ions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_NODE) +=3D node + +# +# Paths and names +# +NODE_VERSION=09:=3D 0.10.33 +NODE_MD5=09:=3D 626ca8a4f8fec4df49c78ed53d46f1f7 +NODE=09=09:=3D node-v$(NODE_VERSION) +NODE_SUFFIX=09:=3D tar.gz +NODE_URL=09:=3D http://nodejs.org/dist/v$(NODE_VERSION)/$(NODE).$(NODE= _SUFFIX) +NODE_SOURCE=09:=3D $(SRCDIR)/$(NODE).$(NODE_SUFFIX) +NODE_DIR=09:=3D $(BUILDDIR)/$(NODE) +NODE_LICENSE=09:=3D MIT + +# --------------------------------------------------------------------= -------- +# Get +# --------------------------------------------------------------------= -------- + +#$(NODE_SOURCE): +#=09@$(call targetinfo) +#=09@$(call get, NODE) + +# --------------------------------------------------------------------= -------- +# Prepare +# --------------------------------------------------------------------= -------- + +#NODE_PATH :=3D PATH=3D$(CROSS_PATH) +NODE_ENV :=3D $(CROSS_ENV) + +# +# autoconf +# +#NODE_AUTOCONF :=3D \ +# $(CROSS_AUTOCONF_USR)=20 +# --libdir=3D/usr/lib/lighttpd \ +# --$(call ptx/endis, PTXCONF_GLOBAL_LARGE_FILE)-lfs \ +# $(GLOBAL_IPV6_OPTION) \ +# --without-libev \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_MYSQL)-mysql \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_LDAP)-ldap \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_ATTR)-attr \ +# --without-valgrind \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_OPENSSL)-openssl \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_KERBEROS)-kerberos5 \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_PCRE)-pcre \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_ZLIB)-zlib \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_BZ2LIB)-bzip2 \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_FAM)-fam \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_WEBDAV_PROPS)-webdav-props= \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_WEBDAV_LOCKS)-webdav-locks= \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_GDBM)-gdbm \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_MEMCACHE)-memcache \ +# --$(call ptx/wwo, PTXCONF_LIGHTTPD_LUA)-lua + +#NODE_CONF_ENV=09:=3D $(CROSS_ENV) + +# +# autoconf +# +#NODE_CONF_TOOL=09:=3D autoconf +NODE_CONF_OPT=09:=3D --prefix=3D/usr \ +=09=09 --without-snapshot \ +=09=09 --dest-cpu=3Darm \ +=09=09 --dest-os=3Dlinux + +ifndef PTXCONF_NODE_SSL +NODE_CONF_OPT +=3D --without-ssl +endif + +ifndef PTXCONF_NODE_NPM +NODE_CONF_OPT +=3D --without-npm +endif + +$(STATEDIR)/node.prepare: +=09@echo $(NODE_CONF_OPT) +=09@$(call targetinfo) +=09@$(call clean, $(NODE_DIR)/config.cache) +=09cd $(NODE_DIR) && \ +=09=09$(NODE_PATH) $(NODE_ENV) \ +=09=09./configure $(NODE_CONF_OPT) +=09@$(call touch) + +# --------------------------------------------------------------------= -------- +# Compile +# --------------------------------------------------------------------= -------- + +#$(STATEDIR)/node.compile: +#=09@$(call targetinfo) +#=09@$(call world/compile, NODE) +#=09@$(call touch) + +# --------------------------------------------------------------------= -------- +# Install +# --------------------------------------------------------------------= -------- + +#$(STATEDIR)/node.install: +#=09@$(call targetinfo) +#=09@$(call world/install, NODE) +#=09@$(call touch) + +# --------------------------------------------------------------------= -------- +# Target-Install +# --------------------------------------------------------------------= -------- + +$(STATEDIR)/node.targetinstall: +=09@$(call targetinfo) + +=09@$(call install_init, node) +=09@$(call install_fixup, node,PRIORITY,optional) +=09@$(call install_fixup, node,SECTION,base) +=09@$(call install_fixup, node,AUTHOR,"Alex Raimondi ") +=09@$(call install_fixup, node,DESCRIPTION,missing) + +=09@$(call install copy, node, 0, 0, 0755, /usr/share/nodejs) +=09@$(call install_copy, node, 0, 0, 0755, $(NODE_DIR)/node, /usr/bin/= node) +=09@$(call install_copy, node, 0, 0, 0755, $(NODE_DIR)/node, /usr/bin/= nodejs) +=09@$(call install_link, node, ../lib/node_modules/npm/bin/npm-cli.js,= /usr/bin/npm) + +=09@$(call install_tree, node, 0, 0, $(NODE_DIR)/deps/npm/node_modules= , /usr/lib/node_modules/npm/node_modules) +=09@$(call install_tree, node, 0, 0, $(NODE_DIR)/deps/npm/lib, /usr/li= b/node_modules/npm/lib) +=09@$(call install_tree, node, 0, 0, $(NODE_DIR)/deps/npm/bin, /usr/li= b/node_modules/npm/bin) +=09@$(call install_tree, node, 0, 0, $(NODE_DIR)/lib, /usr/lib/nodejs)= +=09@$(call install_tree, node, 0, 0, $(NODE_DIR)/deps/npm/scripts, /us= r/lib/node_modules/npm/scripts) + +=09@for i in $(shell cd $(NODE_DIR)/deps && find npm -maxdepth 1 -type= f); do \ +=09 $(call install_copy, node, 0, 0, 0755, -, /usr/lib/node_modules= /$$i); \ +=09done + +=09@$(call install_finish, node) + +=09@$(call touch) + +# --------------------------------------------------------------------= -------- +# Clean +# --------------------------------------------------------------------= -------- + +#$(STATEDIR)/node.clean: +#=09@$(call targetinfo) +#=09@$(call clean_pkg, NODE) + +# vim: syntax=3Dmake --=20 2.0.4 --nextPart1581741.1aAjY35VAY Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --nextPart1581741.1aAjY35VAY--