[buildout]
extends =
  ../dcron/buildout.cfg
  ../libxml2/buildout.cfg
  ../logrotate/buildout.cfg
  ../rdiff-backup/buildout.cfg
  ../nodejs/buildout.cfg

parts =
  nodejs
  npm
  cloud9

[cloud9]
<= cloud9-git

[node-sm]
recipe = slapos.recipe.build:npm
packages = sm

[cloud9-git]
# Online IDE written in javascript/node.js
# URL : c9.io
# You can use it using the following command :
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location} 
recipe = plone.recipe.command
stop-on-error = true
commit = 4bde3206ac0dc1e5736cb18a42851e203a6cc68f
repository = https://github.com/ajaxorg/cloud9.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
git-binary = ${git:location}/bin/git
npm-binary = ${nodejs-0.6:location}/bin/node ${nodejs-0.6:location}/bin/npm
command = export GIT_SSL_NO_VERIFY=true; (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${node-sm:location}/bin/sm install && PATH=${nodejs-0.6:location}/bin:$PATH LDFLAGS=-L${libxml2:location}/lib ${:npm-binary} install) || (rm -fr ${:location}; exit 1)
update-command =

[cloud9-npm]
# Online IDE written in javascript/node.js
# URL : c9.io 
# You can use it using the following command :
# NODE_PATH=${:destination}/node_modules ${nodejs:node_location} ${:cloud9_js_location} 
recipe = slapos.recipe.npm
# Node part has to be specified, otherwise system node is used.
node = nodejs-0.6
# List of packages to install
packages =
  cloud9==0.7
# Specify environment jsDAV (dependency of cloud9) needs libxml2
environment = 
  LDFLAGS=-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib