[buildout]
extends =
  ../defaults.cfg
  ../cmake/buildout.cfg
  ../openssl/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../pcre/buildout.cfg
  ../xz-utils/buildout.cfg
  ../zlib/buildout.cfg

parts = libgit2

[libgit2]
recipe  = slapos.recipe.cmmi
url = https://github.com/libgit2/libgit2/archive/refs/tags/v${:version}.tar.gz
md5sum = 9f4ca15249e703ab88cbc929187750cd
version = 1.1.0
shared = true
configure-command =
  cmake
configure-options =
  -Bbuild
  -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_INSTALL_PREFIX=@@LOCATION@@
  -DCMAKE_C_FLAGS="-I${openssl:location}/include -I${zlib:location}/include -I${pcre:location}/include"
  -DCMAKE_INSTALL_RPATH=${zlib:location}/lib:${openssl:location}/lib:${pcre:location}/lib
  -G"Unix Makefiles"
patch-options = -p1
patches =
  ${:_profile_base_location_}/0001-prefer-use-python-3-for-tests.patch#6f2a6e83db45b33fc7da86279f06595b
  ${:_profile_base_location_}/fix-correct-index-has_dir_name-check.patch#e26c84e73b75a1128fe6bd1d400b6ccd

make-options = -C build
environment =
  PKG_CONFIG_PATH=${openssl:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig:${xz-utils:location}/lib/pkgconfig
  PATH=${python3:location}/bin:${pkgconfig:location}/bin:${cmake:location}/bin:%(PATH)s
  LDFLAGS=-L${openssl-1.0:location}/lib -Wl,-rpath=${openssl:location}/lib -L${pcre:location}/lib -Wl,-rpath=${pcre:location}/lib
