Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Koen Kooi <k.kooi@student.utwente.nl>
To: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH] added a .bb for node.js
Date: Thu, 19 Aug 2010 10:43:52 +0200	[thread overview]
Message-ID: <i4iqs8$kpd$1@dough.gmane.org> (raw)
In-Reply-To: <1282198068-25415-1-git-send-email-coolaj86@gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

And the PN should be nodejs


On 19-08-10 08:07, AJ ONeal wrote:
> ---
>  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"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFMbO7IMkyGM64RGpERAutSAJ4rEznKqUERzRw63i45U5HKZDzn8wCfWwbp
GrHdH6tC0/HZ6/kCY+wxExQ=
=GrlM
-----END PGP SIGNATURE-----




      parent reply	other threads:[~2010-08-19  8:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19  6:07 [PATCH] added a .bb for node.js AJ ONeal
2010-08-19  6:15 ` AJ ONeal
2010-08-23  9:40   ` Paul Menzel
2010-08-23 21:25     ` AJ ONeal
2010-08-23 22:18       ` Paul Menzel
2010-08-23 23:20         ` AJ ONeal
2010-08-23 23:55           ` J. L. 
2010-08-23 21:27     ` AJ ONeal
2010-08-23 22:22       ` Paul Menzel
2010-08-19  7:41 ` Frans Meulenbroeks
2010-08-19  8:37 ` Koen Kooi
2010-08-22  3:04   ` AJ ONeal
2010-08-22  7:55     ` Frans Meulenbroeks
2010-08-23  0:59       ` AJ ONeal
2010-08-23  5:45         ` Frans Meulenbroeks
2010-08-23  9:41           ` Paul Menzel
2010-08-23  8:50     ` Koen Kooi
2010-08-23 21:29       ` AJ ONeal
2010-08-19  8:43 ` Koen Kooi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='i4iqs8$kpd$1@dough.gmane.org' \
    --to=k.kooi@student.utwente.nl \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox