[buildout]
extends =
  ../mysql-tritonn-5.0/buildout.cfg
  ../mariadb/buildout.cfg
  ../patch/buildout.cfg
  ../perl-Devel-CheckLib/buildout.cfg

parts =
  perl-DBD-MySQL

[perl-DBD-MySQL-common]
<= perl-CPAN-package
module = DBD/DBD-mysql
version = 4.046_01
md5sum = 90f87aec4b7ab95a9543f2dd10969a07
# 4.046_01 is not released on CPAN, so we get it from github
url = https://github.com/perl5-dbi/DBD-mysql/archive/4.046_01.tar.gz

inc = ${perl-DBI:site_perl}:${perl-Devel-CheckLib:site_perl}
patches =
  ${:_profile_base_location_}/DBD-mysql-4.027.rpathsupport.patch#a932982b7725e6621cfce3a3d7917e03
patch-options = -p1
extra-configure-args=--libs "-L${zlib:location}/lib -L${openssl:location}/lib $(mysql_config --libs)"

[perl-DBD-MySQL]
<= perl-DBD-MySQL-common
environment =
  OTHERLDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${mysql-tritonn-5.0:location}/lib/mysql -Wl,-rpath=${openssl:location}/lib
  PATH=${mysql-tritonn-5.0:location}/bin:${patch:location}/bin:%(PATH)s

[perl-DBD-mariadb]
<= perl-DBD-MySQL-common
environment =
  OTHERLDFLAGS=-Wl,-rpath=${zlib:location}/lib -Wl,-rpath=${mariadb:location}/lib -Wl,-rpath=${openssl:location}/lib
  PATH=${mariadb:location}/bin:${patch:location}/bin:%(PATH)s
