mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Alexander Raimondi <raimondi@miromico.ch>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Integration of node.js
Date: Wed, 10 Dec 2014 09:38:58 +0100	[thread overview]
Message-ID: <9af5f7d36de7a1b496ce9431df9c1702@miromico.ch> (raw)
In-Reply-To: <254E6C49-779D-41BB-ABF6-13F482F16823@emailplus.org>

[-- Attachment #1: Type: text/plain, Size: 3312 bytes --]

Hi Jean-Claude

Yes, I can give you my current work state. It is attached as tar.gz

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)
- It will also add a host node package. This is necessary to build 
node_modules for the target on the host. This should probably be moved 
into cross section.
- npm on the target works, as long as it doesn't want to compile 
anything.
- My procedure to get node_modules on the target is: extract local_src 
from tar.gz into your project. Use the ./build_module.sh with a list of 
module required on target (e.g. ./build_module.sh can socket.io ejs) and 
move the node_modules directory to the target

This currently works for me. Things to do:
- Creation of node modules withing ptxdist (E.g. through node 
application in ptxdist with a dependency list)
- More important: How to strip down node.js and node_modules (Remove 
documentation, sources, ... not needed on a embedded target)

Hope this helps. Any feedback is appreciated.

Alex

On 2014-12-09 11:04, Jean-Claude Monnin wrote:
> Hi Alex,
>
> I would like to integrate node.js in my image.
> Would it be possible to share your existing rules (even if it’s in a
> unfinished state)?
>
> Thanks,
> Jean-Claude
>
>> On 21 Nov 2014, at 08:27, Alex Raimondi <raimondi@miromico.ch> 
>> wrote:
>>
>> Hi
>>
>> I am working on adding nodejs to ptxdist. I use ptxdist to 
>> crosscompile my ARM based linux.
>>
>> I already succeeded in crosscompiling the nodejs base package and it 
>> works on the target.
>>
>> Node.js is special in some kind. To add extra modules it uses its 
>> own packet manager "npm". Some packages will build some binaries right 
>> on the target system upon installing. This will not work on a cross 
>> compiled target (with no compilers installed)
>>
>> So my approach is to allow the user to select additional modules and 
>> cross compile these modules on the host.
>>
>> So I guess I also need to build nodejs for the host to get my hands 
>> on the npm package manager. I created a host-node package and it 
>> successfully compiles.
>>
>> About the next steps I am unsure how to do that:
>>
>> - My host-node package currently does fetch/prepare/compile. What do 
>> I need to do in install or targetinstall? Currently my host-node gets 
>> installed into platform-XXX/sysroot-host
>>
>> - I need to use host built npm in (target) node to fetch modules. 
>> How do I correctly access the npm package manager?
>>
>> Is there any documentation about host tools usage? What is the 
>> meaning of cross tools?
>>
>> Thanks for any hint
>>
>> Best regards
>> Alex Raimondi
>>
>>
>> --
>> ptxdist mailing list
>> ptxdist@pengutronix.de

-- 
Mit freundlichen Grüssen

Alex Raimondi

--
------------------------------------------------------------------
Miromico AG
Alexander Raimondi            phone : +41 43 222 57 00
Senior Design Engineer        direct: +41 43 222 57 12
Gallusstrasse 4               email : alex.raimondi@miromico.ch
CH-8006 Zurich, Switzerland   www   : www.miromico.ch
------------------------------------------------------------------

[-- Attachment #2: patch.tar.gz --]
[-- Type: application/octet-stream, Size: 2862 bytes --]

[-- Attachment #3: Type: text/plain, Size: 48 bytes --]

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2014-12-10  8:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21  7:27 Alex Raimondi
2014-11-24  8:08 ` Juergen Borleis
2014-12-09 10:04 ` Jean-Claude Monnin
2014-12-10  8:38   ` Alexander Raimondi [this message]
2014-12-10 14:15     ` Alexander Stein

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=9af5f7d36de7a1b496ce9431df9c1702@miromico.ch \
    --to=raimondi@miromico.ch \
    --cc=ptxdist@pengutronix.de \
    /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