[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
node = nodejs
environment =
  PATH=${nodejs:location}/bin:%(PATH)s

[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 = ab689c5d3cc29d02d788506c0f1b2ab0742a0f05
repository = https://github.com/ajaxorg/cloud9.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
git-binary = ${git:location}/bin/git
npm-binary = ${nodejs:location}/bin/node ${nodejs:location}/bin/npm
environment = export GIT_SSL_NO_VERIFY=true; export PATH=${nodejs:location}/bin:${node-sm:location}/node_modules/sm/bin/:$PATH; export LDFLAGS=-L${libxml2:location}/lib; export HOME=${:location};
command = ${:environment} (${:git-binary} clone --quiet ${:repository} ${:location} && cd ${:location} && ${:git-binary} reset --hard ${:commit} && ${node-sm:location}/node_modules/.bin/sm 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
# 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