[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 = 9caeac82317bdf8e9942fd17676325234cfadac8
repository = https://github.com/ajaxorg/cloud9.git
location = ${buildout:parts-directory}/${:_buildout_section_name_}
environment = export GIT_SSL_NO_VERIFY=true; export PATH=${git:location}/bin:${nodejs:location}/bin:${node-sm:location}/node_modules/sm/bin:$PATH; export CPPFLAGS="-I${libxml2:location}/include -I${nodejs:location}/include"; export LDFLAGS="-L${libxml2:location}/lib -Wl,-rpath=${libxml2:location}/lib"; export HOME=${:location};
command = ${:environment} (git clone --quiet ${:repository} ${:location} && cd ${:location} && git 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