Skip to content

Instantly share code, notes, and snippets.

@reening
Created February 21, 2014 17:55
Show Gist options
  • Save reening/9139482 to your computer and use it in GitHub Desktop.
Save reening/9139482 to your computer and use it in GitHub Desktop.

Revisions

  1. reening created this gist Feb 21, 2014.
    31 changes: 31 additions & 0 deletions build.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    #!/bin/sh

    VERSION="0.10.25"
    UPSTREAM="http://nodejs.org/dist/v$VERSION/node-v$VERSION.tar.gz"

    ARCH="$(dpkg --print-architecture)"
    BUILDDIR="$PWD/build-v$VERSION"

    wget $UPSTREAM -O upstream-v$VERSION.tar.gz
    tar xf upstream-v$VERSION.tar.gz

    mkdir $BUILDDIR

    cd node-v$VERSION

    CONFIGFLAGS="--prefix=$BUILDDIR"

    case "$ARCH" in
    armhf|armel)
    CONFIGFLAGS="$CONFIGFLAGS --without-snapshot"
    ;;
    esac

    ./configure $CONFIGFLAGS
    make -j4
    make install

    cd ..

    rm upstream-v$VERSION.tar.gz
    rm -rf node-v$VERSION