[buildout]
extends =
  buildout.hash.cfg
  ../../component/git/buildout.cfg
  ../../component/matiec/buildout.cfg
  ../../component/open62541/buildout.cfg
  ../../component/numpy/buildout.cfg
  ../../component/lxml-python/buildout.cfg
  ../../stack/slapos.cfg

parts =
  slapos-cookbook
  instance-profile
  python-interpreter
  matiec
  open62541

[gcc]
# we want this SR to use a fixed gcc (so that we have the same gcc as open62541 component)
max_version = 0

[open62541]
configure-options =
  -DBUILD_SHARED_LIBS=OFF
  -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_INSTALL_PREFIX=@@LOCATION@@
  -DUA_ENABLE_PUBSUB=ON
  -DUA_ENABLE_SUBSCRIPTIONS=ON
  -DUA_NAMESPACE_ZERO=REDUCED
  -DUA_ENABLE_ENCRYPTION=OPENSSL
  -DOPENSSL_ROOT_DIR=${openssl:location}

# Beremiz need it to be in folder parts/open62541
# as Beremiz search for open62541 to BEREMIZ_PATH/../open62541
shared = false
post-install =
  mkdir -p @@LOCATION@@/build/bin
  ln -sf @@LOCATION@@/lib/libopen62541.a @@LOCATION@@/build/bin/libopen62541.a

[beremiz-source]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/beremiz/beremiz.git
revision = 9eb53af
git-executable = ${git:location}/bin/git

[nevow-py3-source]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/beremiz/nevow-py3.git
revision = 6deba72
git-executable = ${git:location}/bin/git

[Nevow]
recipe  = zc.recipe.egg:develop
egg     = Nevow
setup   = ${nevow-py3-source:location}

[python-interpreter]
recipe = zc.recipe.egg
interpreter = pythonwitheggs
eggs = aiofiles
       aiosqlite
       click
       erpc
       ifaddr
       zeroconf
       ${Nevow:egg}
       msgpack
       autobahn
       ${numpy:egg}
       ${lxml-python:egg}
       cycler
       asyncua
       Twisted
       fonttools
       pycountry
extra-paths = ${beremiz-source:location}

[instance-profile]
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
  section buildout  buildout
  key openssl_location openssl:location
  key gcc_location gcc:prefix
