Getting Node.js 0.4.2 to build/install on FreeBSD 8.2 amd64

freebsdnode.js

I've tried getting this working a few different ways:

building from ports (/usr/ports/www/node)
git clone -> ./configure, ./make
git clone -> ./configure, ./gmake

But it always ends up breaking in the end.
When using 'make' I simply get one line of output:
Error expanding embedded variable.

When using 'gmake' I get some building, and then:
Waf: Leaving directory '/usr/home/{user}/node/build
Build failed: -> task failed (err #2):
{task: libv8.a SConstruct -> libv8.a}

I did check for a FreeBSD package, but the most recent they have, on ftp2.freebsd.com, is 0.2.6

Does this just not work on 64 bit BSD?

Update:
I've been finding a few posts on the web of people having similar issues with FreeBSD 64 so I figured I'd also try it out on a 32 bit install (on a 32 bit machine, not the 64 being used from my original question)
Same issue with 'make' and the exact same error using 'gmake'

Build failed: -> task failed (err #2):
{task: libv8.a SConstruct -> libv8.a}

I'd love to get this working on my FreeBSD64, but I'm beginning to think that node just doesn't work anymore for FreeBSD 🙁

Best Answer

  • Got It!!

    I first got this working on FreeBSD 32 and after it worked I was then able to get it working on 64.
    The only difference between the two processes was for the 32 bit I simply built v8 using

    $ scons

    and for 64 bit

    $ scons os=freebsd arch=x64

    Here are the steps I used to get a successful build/install of node on FreeBSD amd64:

    • Checked out clean copies of both v8 and node
    • Within the v8 root

      $ scons os=freebsd arch=x64
      ... build output ...
      $ cp libv8* /usr/local/lib

    • Within the node root

      $ ./configure \
          --prefix=/usr/local \
          --shared-v8 \
          --shared-v8-includes=/home/jr/v8-read-only/include \
          --shared-v8-libpath=/usr/local/lib \
          --shared-v8-libname=v8
      $ gmake
      ... build output ...
      $ gmake install
      $ node --version
      v0.5.0-pre

  • Related Question