[buildout]
extends =
  ../numpy/buildout.cfg
  ../cmake/buildout.cfg
  ../curl/buildout.cfg
  ../geos/buildout.cfg
  ../giflib/buildout.cfg
  ../libexpat/buildout.cfg
  ../libjpeg/buildout.cfg
  ../libtiff/buildout.cfg
  ../libxml2/buildout.cfg
  ../openjpeg/buildout.cfg
  ../pcre/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../proj/buildout.cfg
  ../sqlite3/buildout.cfg
  ../xz-utils/buildout.cfg

parts =
  gdal-python

[gdal]
recipe = slapos.recipe.cmmi
shared = true
version = 3.2.3
url = http://download.osgeo.org/gdal/${:version}/gdal-${:version}.tar.xz
md5sum = 6c276978d625d23a091bac9fdddb99db
location = @@LOCATION@@
configure-options =
  --with-curl=${curl:location}/bin/curl-config
  --with-expat=${libexpat:location}
  --with-geos=${geos:location}/bin/geos-config
  --with-gif=${giflib:location}
  --with-openjpeg=${openjpeg:location}
  --with-jpeg=${libjpeg:location}
  --with-libtiff=${libtiff:location}
  --with-libz=${zlib:location}
  --with-png=${libpng:location}
  --with-proj=${proj:location}
  --with-sqlite3=${sqlite3:location}
  --with-xml2=yes
  --without-webp
environment =
  PATH=${pkgconfig:location}/bin:${xz-utils:location}/bin:%(PATH)s
  CPPFLAGS=-I${pcre:location}/include
  LDFLAGS=-L${pcre:location}/lib -Wl,-rpath=${:location}/lib -Wl,-rpath=${proj:location}/lib -Wl,-rpath=${curl:location}/lib -Wl,-rpath=${geos:location}/lib -Wl,-rpath=${giflib:location}/lib -Wl,-rpath=${openjpeg:location}/lib -Wl,-rpath=${jbigkit:location}/lib -Wl,-rpath=${libexpat:location}/lib -Wl,-rpath=${libjpeg:location}/lib -Wl,-rpath=${libpng:location}/lib -Wl,-rpath=${libtiff:location}/lib -Wl,-rpath=${libxml2:location}/lib -Wl,-rpath=${openssl:location}/lib -Wl,-rpath=${pcre:location}/lib -Wl,-rpath=${sqlite3:location}/lib -Wl,-rpath=${zlib:location}/lib
  PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${curl:pkgconfig}

[gdal-python]
recipe = zc.recipe.egg:custom
egg = GDAL ==${gdal:version}+SlapOSPatched001
setup-eggs = ${numpy:egg}
patches = https://github.com/OSGeo/gdal/commit/166ee6fee9c5e2356605e89abf72c23f3bd0cb74.patch?full_index=1#878ccd1b33e03a5d7445e8d4ff9b6746
patch-options = -p3
rpath = ${:library-dirs}
include-dirs =
  ${gdal:location}/include
library-dirs =
  ${gdal:location}/lib
environment = gdal-python-env

[gdal-python-env]
PATH = ${gdal:location}/bin:%(PATH)s
