Skip to content

Commit

Permalink
Merge pull request RobotWebTools#120 from megawac/install
Browse files Browse the repository at this point in the history
[Attempt] Install all the cario dependencies during npm install
  • Loading branch information
rctoris committed Oct 21, 2014
2 parents 3316713 + 43c2064 commit 0f5ca60
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
doc
node_modules
*.out
*.log
*.log
*.tar.gz
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unsafe-perm = true
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ addons:
os:
- linux
before_install:
# node-canvas dependency
- sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
# ROS deps for examples
- sudo sh -c 'echo "deb http://packages.ros.org/ros-shadow-fixed/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
Expand Down
18 changes: 18 additions & 0 deletions misc/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

set -e
if type 'apt-get' > /dev/null; then
{
sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++ -qq &&
exit 0
}
elif type 'yum' > /dev/null; then
{
sudo yum erase cairo &&
sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel &&
exit 0
}
fi

# Build from source (official build steps)
curl https://raw.githubusercontent.com/Automattic/node-canvas/1.1.6/install | sh
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"test": "grunt test",
"test-examples": "grunt mochaTest:examples && karma start test/examples/karma.conf.js",
"test-tcp": "grunt mochaTest:tcp",
"publish": "grunt build"
"publish": "grunt build",
"preinstall": "sh misc/install.sh"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 0f5ca60

Please sign in to comment.