[buildout]
extends =
  ../../component/git/buildout.cfg
  ../../component/bash/buildout.cfg
  ../../component/bash-completion/buildout.cfg
  ../../component/fish-shell/buildout.cfg
  ../../component/tmux/buildout.cfg
  ../../component/tig/buildout.cfg
  ../../component/vim/buildout.cfg
  ../../component/curl/buildout.cfg
  ../../component/coreutils/buildout.cfg
  ../../component/fonts/buildout.cfg
  ../../component/theia/buildout.cfg
  ../../component/pygolang/buildout.cfg
  ../../stack/haproxy/default-backend.cfg
  ../../stack/slapos.cfg
  ../../stack/monitor/buildout.cfg
  ../../stack/resilient/buildout.cfg
  ../../component/defaults.cfg
  ./buildout.hash.cfg

parts =
  slapos-cookbook
  instance


# default for slapos-standalone
shared-part-list =


# Versions
# --------
[gcc]
# We keep the gcc part in sync with the one from erp5 software, so that when we install
# erp5 inside theia's slapos parts can be shared.
max_version = 0


[gowork]
install +=
  golang.org/x/tools/gopls@v0.6.6

# Downloads and templates
# -----------------------

[template-base]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:_update_hash_filename_}
output = ${buildout:parts-directory}/${:_buildout_section_name_}

[download-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
destination = ${buildout:directory}/${:_buildout_section_name_}
output = ${:destination}

[slapos.css.in]
<= download-base

[logo.png]
<= download-base

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

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

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

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

[instance-resilient]
<= download-base

[slapos-standalone-script]
<= download-base
destination = ${buildout:directory}/slapos_standalone_script.py.jinja

[theia-common]
<= download-base
destination = ${buildout:directory}/theia_common.py

[theia-export]
<= download-base
destination = ${buildout:directory}/theia_export.py
depends = ${theia-common:recipe}

[theia-import]
<= download-base
destination = ${buildout:directory}/theia_import.py
depends = ${theia-common:recipe}


# Utilities
# ---------

[supervisor]
recipe = zc.recipe.egg
eggs =
  supervisor
  setuptools


[cli-utilities]
PATH = ${jq:location}/bin:${nodejs:location}/bin:${bash:location}/bin:${fish-shell:location}/bin:${tig:location}/bin:${vim:location}/bin:${tmux:location}/bin:${git:location}/bin:${curl:location}/bin:${python:location}/bin:${buildout:bin-directory}

[python-with-eggs]
recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_}
# Only generate the interpreter script to avoid conflicts with scripts
# for eggs that are also generated by another section, like slapos.toolbox
scripts = ${:interpreter}
executable = ${buildout:bin-directory}/${:interpreter}

[python-for-resiliency]
<= python-with-eggs
eggs =
  ${slapos-toolbox:eggs}
  six
  zc.buildout
  requests

[python-for-standalone]
<= python-with-eggs
eggs =
  slapos.core
needs-these-eggs-scripts-in-path =
  ${supervisor:recipe}
  ${slapos-command:recipe}

[python-for-buildout-languageserver]
<= python-interpreter
interpreter = ${:_buildout_section_name_}
executable = ${:exe}
eggs +=
  zc.buildout.languageserver

[software-info]
slapos = ${buildout:bin-directory}/slapos
python-for-resiliency = ${python-for-resiliency:executable}
python = ${python:location}/bin/python
rsync = ${rsync:location}/bin/rsync
sqlite3 = ${sqlite3:location}/bin/sqlite3
bash = ${bash:location}/bin/bash
supervisorctl = ${buildout:bin-directory}/supervisorctl
theia-export = ${theia-export:output}
theia-import = ${theia-import:output}
