From 2d719c9c78427d4a8bd8a3c0b736c15b4fa32a65 Mon Sep 17 00:00:00 2001 From: Bruce MacNaughton Date: Thu, 2 Jan 2014 14:59:46 -0800 Subject: [PATCH] Updated README.md to include instructions for installation on Ubuntu/Debian Linux. --- README.md | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9976378b..ede86bd8 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,11 @@ You can download prebuilt packages from . As of July 2013, the recommended way to install and maintain Paper.js is through Bower for browsers, and through NPM for Node.js. -See for a tutorial explaining how to install Node.js, NPM and Bower on OSX. +For OSX see for a tutorial explaining how to install Node.js, NPM and Bower. + +For Linux see to locate 32-bit and 64-bit nodejs binaries as well as sources. It is recommended that you download directly from the nodejs site; the version available via many OS-supplied package managers is out-of-date and doesn't work with many of the packages paper uses. NPM is now included with the nodejs distribution. Once nodejs (with npm) has been installed you can install bower using the following command: + + npm install -g bower With Bower installed, simply type this command in your project folder: @@ -22,26 +26,41 @@ With Bower installed, simply type this command in your project folder: Upon execution, you will find a `paper` folder inside the project's `component` folder. For more information on Bower and to learn about its features for dependence tracking, see . -## Installing for Node.js +## Installing Paper.js for Node.js Similarly you can use NPM to install Paper.js for Node.js. But before doing so, you need the Cairo Graphics library installed, see . -The easiest way to install Cairo on OSX is through Homebrew . +**For OSX:** + +The easiest way to install Cairo is install Homebrew then issue the command: brew install cairo -Once Homebrew has installed this for you, you can then install the Paper.js module: - - npm install paper - Note that currently there is an issue on OSX with Cairo. If the above causes errors, the following will most likely fix it: - PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm install paper + PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm insetall paper Also, whenever you would like to update the modules, you will need to execute: PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ npm update +**For Debian/Ubuntu Linux:** + + sudo apt-get install libcairo2-dev + +For Debian/Ubuntu you might also need these additional packages if you don't usually build from c++ sources: + + build-essential + libssl-dev + libjpeg8-dev + libgif-dev + +**After cairo has been installed:** + +Then install the Paper.js module: + + npm install paper + ## Development **Get the source (for building):** @@ -57,7 +76,7 @@ If you want to contribute to the project you will have to [make a fork](http://h ### Refreshing Your Clone -To fetch changes from origin, run +To fetch changes from origin (your fork), run git fetch origin @@ -73,11 +92,15 @@ To update the `jsdoc-toolkit` submodule inside the `build` folder, used to gener Paper.js has a couple of dependencies as Bower and NPM modules. See for a tutorial explaining how to install Node.js, NPM and Bower on OSX. -In order to be able to build Paper.js, these dependencies need to be installed first after checking out the repository: +In order to be able to build Paper.js, after checking out the repository, paper has dependencies that need to be installed. Install them by issuing the following commands from the paper.js directory: npm install bower install +You might find that the npm command fails attempting to fetch packages needed for dependencies due to using https (the default protocol to access the npm registry). If that is the case you can switch to using http for registry access with the following command: + + npm config set registry http://registry.npmjs.org/ + Next you need to create minified versions of some of these dependencies. This is handled by the `minify-components.sh` script inside the `build` folder: cd build