[buildout]
extends =
  ../../stack/slapos.cfg
  ../../stack/nodejs.cfg
  ../../component/bzip2/buildout.cfg
  ../../component/coreutils/buildout.cfg
  ../../component/git/buildout.cfg
  ../../component/xorg/buildout.cfg
  ../../component/fontconfig/buildout.cfg
  ../../component/fonts/buildout.cfg
  ../../component/firefox/buildout.cfg
  ../../component/dash/buildout.cfg
  ../../component/nginx/buildout.cfg
  ../../component/openssl/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/selenium/buildout.cfg
  ./buildout.hash.cfg

parts =
  slapos-cookbook
  nodejs
  git
  eggs
  xserver
  firefox
  xwd
  renderjs-install
  jio-install
  nginx
  openssl
  instance

[nodejs]
<= nodejs-14.16.0

[eggs]
recipe = zc.recipe.egg
eggs =
  erp5.util
  ${selenium:egg}
  certifi
  ${lxml-python:egg}
interpreter = pythonwitheggs

[renderjs-repository.git]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/renderjs.git
branch = master
git-executable = ${git:location}/bin/git
develop = true

[renderjs-install]
recipe = plone.recipe.command
stop-on-error = true
command = set -e
  cd ${renderjs-repository.git:location}
  PATH=${git:location}/bin:${nodejs:location}/bin:${bzip2:location}/bin:$PATH
  npm install .
  ./node_modules/grunt-cli/bin/grunt
update-command = ${:command}

[jio-repository.git]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/jio.git
branch = master
git-executable = ${git:location}/bin/git
develop = true

[jio-install]
recipe = plone.recipe.command
stop-on-error = true
command = set -e
  cd ${jio-repository.git:location}
  PATH=${git:location}/bin:${nodejs:location}/bin:$PATH
  ${nodejs:location}/bin/npm install jslint@0.9.2 jison@0.4.16 https://github.com/qunitjs/node-qunit.git#v0.9.3 sinon@1.7.3
  make
update-command = ${:command}

[rsvp-repository.git]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/rsvp.js.git
branch = master
git-executable = ${git:location}/bin/git
develop = true

[rsvp-install]
recipe = plone.recipe.command
stop-on-error = true
command = set -e
  cd ${rsvp-repository.git:location}
  PATH=${git:location}/bin:${nodejs:location}/bin:$PATH
  npm install .
update-command = ${:command}

[uritemplate-repository.git]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/uritemplate-js.git
branch = master
git-executable = ${git:location}/bin/git
develop = true

[uritemplate-install]
recipe = plone.recipe.command
stop-on-error = true
command = set -e
  cd ${uritemplate-repository.git:location}
  PATH=${git:location}/bin:${nodejs:location}/bin:$PATH
  npm install .
update-command = ${:command}

[macro-template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}

[instance]
<= macro-template
output = ${buildout:directory}/instance.cfg

[template-nginx-service]
<= macro-template
output = ${buildout:directory}/template-nginx-service.sh.in

[template-nginx-configuration]
<= macro-template
output = ${buildout:directory}/template-nginx.cfg.in

[template-runTestSuite]
<= macro-template
output = ${buildout:directory}/runTestSuite.in
