Kris Pypen

Blog

Compile NodeJS for Your N900

This is how you can compile NodeJS on your N900 Maemo Mobile Phone. The Nokia N900 is an ARMv7 device, so this tutorial will maybe also help to build it for other ARMv7 devices (like the Galaxy S3 Tizen version).

First you need to have the Maemo SDK.

Then you can login into it:

1
2
$ > /scratchbox/login
[sbox-FREMANTLE_X86: ~] > sb-conf select FREMANTLE_ARMEL

Make sure you have python 2.5 (or higher):
In your scratchbox:

1
[sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install python2.5

Then outside the scratchbox I needed to remove the python symlink to make python2.5 the default:

1
$ > sudo rm /scratchbox/devkits/python-legacy/bin/python

Download the latest NodeJS

1
2
3
[sbox-FREMANTLE_ARMEL: ~] > wget "http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz"
[sbox-FREMANTLE_ARMEL: ~] > tar -xvf node-v0.8.11.tar.gz
[sbox-FREMANTLE_ARMEL: ~] > cd node-v0.8.11

Add these 2 lines at the top inside the variables section in “deps/v8/build/common.gypi”:

1
2
 'armv7%':'1',
 'arm_neon%':'1',

Compile:

1
2
3
[sbox-FREMANTLE_ARMEL: ~] > export LINK=g++
[sbox-FREMANTLE_ARMEL: ~] > ./configure --without-snapshot
[sbox-FREMANTLE_ARMEL: ~] > make

Now you can copy “out/Release/node” to your N900 and start having fun with NodeJS!

I created a github repository where we can put some code snippets: https://github.com/krispypen/NodeJSForMaemoSnippets

Comments