maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [REQUEST] NodeJS for Maemo (https://talk.maemo.org/showthread.php?t=81304)

niloy 2012-01-03 15:23

[REQUEST] NodeJS for Maemo
 
Can someone please build NodeJS for Maemo and put it in the repos. It allows Javascript to be executed as a general purpose programming language outside of the browser using the V8 engine.

niloy 2012-05-30 15:34

Re: [REQUEST] NodeJS for Maemo
 
knock knock
http://nodejs.org

nermaljcat 2012-10-03 23:30

Re: [REQUEST] NodeJS for Maemo
 
You can try installing gcc/g++, make etc and compiling it yourself (or cross-compiling). Getting gcc & g++ installed is a bit of a pain, but there are some good guides on google.

You'll also need to (temporarily) increase your /tmp dir size or redirect TMPDIR for gcc - otherwise you'll run out of space.

I have a build running at the moment, it's been running for a couple of hours - fingers crossed it succeeds.

Cross-compiling is probably the way I'd go if I were to start again from scratch.

Mentalist Traceur 2012-10-04 00:09

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by nermaljcat (Post 1276059)
You can try installing gcc/g++, make etc and compiling it yourself (or cross-compiling). Getting gcc & g++ installed is a bit of a pain, but there are some good guides on google.

What way did you manage to find to install gcc/g++ that's actually painful? On the N900 (if you have the sdk repo added), and on most linuxes, "apt-get install gcc" and "apt-get install g++" works just fine? (Just swap in command for your system's package manager, if it's not apt). Cross-compiling, now THAT does get harder to set up.

Quote:

You'll also need to (temporarily) increase your /tmp dir size or redirect TMPDIR for gcc - otherwise you'll run out of space.
Oh cool, I didn't know you could do that.

Quote:

I have a build running at the moment, it's been running for a couple of hours - fingers crossed it succeeds.

Cross-compiling is probably the way I'd go if I were to start again from scratch.
You are a very patient individual, apparently. I applaud you.

nermaljcat 2012-10-04 00:52

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by Mentalist Traceur (Post 1276071)
What way did you manage to find to install gcc/g++ that's actually painful? On the N900 (if you have the sdk repo added), and on most linuxes, "apt-get install gcc" and "apt-get install g++" works just fine? (Just swap in command for your system's package manager, if it's not apt).

Gaah! really? That would have saved ~3 hours of my life.

I came across the following command, to (temporarily) increase /tmp:
Code:

mount -o remount,size=16M /tmp
http://maemo.org/community/maemo-users/more_tmp_memory/

BTW - compile broke part way through because it was using armv5 config. I used a Raspberry Pi config to set it to armv6 (armv7 wouldn't work for some reason...) - it's now trucking along again.

If it builds, maybe I can tar up the binary and post it somewhere...

nermaljcat 2012-10-04 03:21

Re: [REQUEST] NodeJS for Maemo
 
Looks like binutils is b0rked (ld doesn't like sysroot option).. trying to compile binutils 2.20 with "--with-sysroot" options. Wish me luck....

nermaljcat 2012-10-04 05:38

Re: [REQUEST] NodeJS for Maemo
 
So... it's kinda built - just fails creating some symlinks (st00pid me trying to build from sdcard...). There is a node binary under <node>/out/Release/node which happily returns a version number :-)

Copying to /opt and will try again - will hopefully have something soon.

nermaljcat 2012-10-04 08:40

Re: [REQUEST] NodeJS for Maemo
 
ok, nodeJS is all built and able to serve up the hello world server on my n900 :-)

Mentalist Traceur 2012-10-05 23:01

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by nermaljcat (Post 1276077)
Gaah! really? That would have saved ~3 hours of my life.

Just keep in mind, they're not optified, being meant for the SDK scratchbox environment, rather than the devices directly, so you have to manually optify them if you want to save some rootfs space.

I have scripts that automatically move all the significantly-sized files from them if you'd like. (although I think I have the standard 'include' directory symlinked to /opt by default as part of a different, stuff-that's-on-the-N900-by-default optification script)

Kris Pypen 2012-10-07 16:44

Re: [REQUEST] NodeJS for Maemo
 
Hi, here is how I got NodeJS compiled: http://krispypen.github.com/blog/201...for-your-n900/

nermaljcat 2012-10-07 23:05

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by Mentalist Traceur (Post 1277029)
I have scripts that automatically move all the significantly-sized files from them if you'd like. (although I think I have the standard 'include' directory symlinked to /opt by default as part of a different, stuff-that's-on-the-N900-by-default optification script)

Thanks for the offer - I ended up waiting it out. This may be handy in the future - I'll keep it in mind (rarely need to build from source on my n900). Thanks

Had to rebuild from /, because my SDCard was fat and couldn't execute or (after remounting with umask) support symlinks.

The binary seems to work ok for simple scripts, but has an issue with some NPM packages... may be related to SD issue above - think I'll try formatting as ext3

Kris Pypen 2012-10-09 10:37

Re: [REQUEST] NodeJS for Maemo
 
This is how I compiled nodejs: http://krispypen.github.com/blog/201...for-your-n900/

I did a super-easy performance test on the N900:

for loop from 0 to 100000000 doing a + b each time:

nodejs:
Code:

console.log("start");
var a = 0;
for(var i = 0; i < 100000000; i++) {
  a = a + i;
  a = a - i;
}
console.log("ok");

startup time node: 1s
for loop time: 2,5s

python:
Code:

print "start"
a = 0
for x in range (0, 100000000):
        a = a + x;
        a = a - x;
print "ok"

startup time: 0.2s
for loop time: 620s

nermaljcat 2012-10-12 00:01

Re: [REQUEST] NodeJS for Maemo
 
Thanks Kris, wish I had your guide to follow when I started out :-)

Hopefully this will fix some of the issues I'm seeing in my haqq'd together build.

Are you able to build Twitter Bootrap ok with it? http://twitter.github.com/bootstrap/ (less + some others)

Kris Pypen 2012-10-12 09:35

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by nermaljcat (Post 1279523)
Are you able to build Twitter Bootrap ok with it? http://twitter.github.com/bootstrap/ (less + some others)

Are you trying to build https://github.com/twitter/bootstrap/zipball/master ? Or are your trying to do "npm install twitter-bootstrap" ?

Kris Pypen 2012-10-13 11:12

Re: [REQUEST] NodeJS for Maemo
 
I created a github repository where we can put some testing snippets: https://github.com/krispypen/NodeJSForMaemoSnippets
I already made a working snippet for creating a call and sending an sms :)

taixzo 2012-10-13 12:10

Re: [REQUEST] NodeJS for Maemo
 
Any chance someone could package this up and put it in extras-devel?

Kris Pypen 2012-10-13 12:30

Re: [REQUEST] NodeJS for Maemo
 
AapoRantalainen told me 3 days ago that he's trying to do it. I'm not yet familliar with packaging. I created a zip file with the compiled node and npm in it, so maybe this can help you at the moment. https://github.com/krispypen/NodeJSF.../master/binary

nermaljcat 2012-10-14 22:13

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by Kris Pypen (Post 1279650)
Are you trying to build https://github.com/twitter/bootstrap/zipball/master ? Or are your trying to do "npm install twitter-bootstrap" ?

Trying to build from source. I think my local build is a bit flaky.

AapoRantalainen 2012-10-15 12:00

Re: [REQUEST] NodeJS for Maemo
 
nodejs (0.8.12) on the extras-devel. Fully optified. Run
Code:

/opt/node/bin/node
npm is working, usage example
Code:

/opt/node/bin/npm install socket.io
(Seems npm needs gcc installed as well. Run on directory where you have write access. Tested only on ext2 filesystem.)

There are little bit hacking (=packeting magic) because autobuilders 'python' is python2.3 and it really needs python2.5. (Documentation says it needs python2.6?).

-----
[EDIT]
This is list of upstream bugs affecting Maemo5. Whoever makes next release should check results of these:
https://github.com/joyent/node/issues/2210 : consistently use #!/usr/bin/env python in gyp (maybe)
https://github.com/joyent/node/issues/4076 : simplejson (for python2.5) and LINK=g++ (as flock fails)
https://github.com/joyent/node/issues/4142 : arm_neon (deps/v8/build/common.gypi)
https://github.com/joyent/node/issues/4144 : only --without-snapshot works

This might be useful note too:
Code:

export PYTHON=python2.5
#export PYTHON=python2.7
$PYTHON ./configure

------
Central place for N900 snippets is very good idea, please use it and share your creations.

AapoRantalainen 2012-10-15 12:18

Re: [REQUEST] NodeJS for Maemo
 
Simple www-server for testing nodejs: https://github.com/krispypen/NodeJSF.../www-server.js

Serves static html, css, js, png, jpg, jpeg-files.
Default port is 9002.
Uses socket.io.

nermaljcat 2012-10-17 00:55

Re: [REQUEST] NodeJS for Maemo
 
Quote:

Originally Posted by AapoRantalainen (Post 1280737)
nodejs (0.8.12) on the extras-devel. Fully optified.

Thanks AapoRantalainen and Kris Pypen - the package in extras-devel is great!

impeham 2012-10-19 01:55

Re: [REQUEST] NodeJS for Maemo
 
Nice API reference and examples - i didn't know about this before.

http://nodejs.org/
http://nodejs.org/api/

Thanks for the pacakge :)

shawnjefferson 2014-09-21 00:41

Re: [REQUEST] NodeJS for Maemo
 
Just tried to install peerflix via npm, and it looks like maybe we need a newer version of NodeJS. Any chance to get one compiled and uploaded to Extras-Devel?

Mentalist Traceur 2014-09-21 05:32

Re: [REQUEST] NodeJS for Maemo
 
Some thoughts: I too would love it if we had a more recent Node.js build available.

Furthermore, two more thoughts about the packaging:
1. The original Maemo packaging guidelines recommended optifying to /opt/maemo/[whatever], not /opt/[whatever]. I for one would prefer that the package hold that convention.
2. Does the package symlink from, say, /usr/bin/node to whever the node executable actually is? Seems like a trivial extra addition to do if not. Would probably be very helpful.


All times are GMT. The time now is 10:34.

vBulletin® Version 3.8.8