[buildout]
extends =
  ../defaults.cfg
  ../git/buildout.cfg
  ../numpy/buildout.cfg

parts = cythonplus_env.sh

[gcc]
min_version = 8.4

[python]
part = python3

# Dependencies for the Cython+ test suite
[eggs]
recipe = zc.recipe.egg
eggs =
  ${numpy:egg}
  coverage
  pycodestyle

[cythonplus-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/cython.git
revision = cythonplus-0.2
git-executable = ${git:location}/bin/git

[cythonplus_env.sh]
recipe = slapos.recipe.template:jinja2
output = ${buildout:directory}/${:_buildout_section_name_}
inline =
  {% set path, python = os.path.split(python) -%}
  {% if 'part' in gcc -%}
  {%   set path = path + ':' + gcc.prefix + '/bin' -%}
  {% endif -%}
  export PATH={{ path }}$${PATH:+:$PATH}
  export PYTHON={{ python }}
  export PYTHONPATH={{ cythonplus_repository }}$${PYTHONPATH:+:$PYTHONPATH}
  export PYTHONPATH={{ ':'.join(easy_install.working_set(eggs['eggs'].split(), [
      eggs['develop-eggs-directory'],
      eggs['eggs-directory'],
    ]).entries) }}$${PYTHONPATH:+:$PYTHONPATH}
  {# Set path to libintl needed for cython EmbedTest #}
  export LD_RUN_PATH={{ gettext }}/lib$${LD_RUN_PATH:+:$LD_RUN_PATH}
  export LIBRARY_PATH={{ gettext }}/lib$${LIBRARY_PATH:+:$LIBRARY_PATH}
context =
  section eggs eggs
  section gcc gcc
  key cythonplus_repository cythonplus-repository:location
  key gettext gettext:location
  key python python:executable
  import os os
  import easy_install zc.buildout.easy_install

[versions]
coverage = 4.5.1
pycodestyle = 2.5.0
