[buildout]
parts = apache-php

extends =
  ../apache/buildout.cfg
  ../argon2/buildout.cfg
  ../bzip2/buildout.cfg
  ../cclient/buildout.cfg
  ../curl/buildout.cfg
  ../freetype/buildout.cfg
  ../gettext/buildout.cfg
  ../libiconv/buildout.cfg
  ../libjpeg/buildout.cfg
  ../libpng/buildout.cfg
  ../libtool/buildout.cfg
  ../mariadb/buildout.cfg
  ../openldap/buildout.cfg
  ../pkgconfig/buildout.cfg
  ../zlib/buildout.cfg
  ../libzip/buildout.cfg
  ../autoconf/buildout.cfg
  ../automake/buildout.cfg
  ../imagemagick/buildout.cfg
  ../icu/buildout.cfg
  ../openssl/buildout.cfg
  ../libnsl/buildout.cfg
  ../libsodium/buildout.cfg
  ../sqlite3/buildout.cfg
  ../oniguruma/buildout.cfg
  ../xz-utils/buildout.cfg

[php-redis]
recipe = slapos.recipe.cmmi
url = https://github.com/phpredis/phpredis/archive/refs/tags/6.0.1.tar.gz
md5sum = 99dd5f16bac2b0c2ec049ce21e346705
configure-command =
  phpize && ./configure
environment =
  PATH=${autoconf:location}/bin:${automake:location}/bin:${m4:location}/bin:${apache-php:location}/bin:%(PATH)s

[php-imagick]
recipe = slapos.recipe.cmmi
url = https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz
md5sum = 4dbe07a2ef15d3c9e4c54d5685bdfbc9
configure-command =
  phpize && ./configure
environment =
  PKG_CONFIG_PATH=${imagemagick:location}/lib/pkgconfig
  PATH=${pkgconfig:location}/bin:${imagemagick:location}/bin:${autoconf:location}/bin:${automake:location}/bin:${m4:location}/bin:${apache-php:location}/bin:%(PATH)s
  IM_IMAGEMAGICK_PREFIX=${imagemagick:location}

[php-apcu]
recipe = slapos.recipe.cmmi
url = https://github.com/krakjoe/apcu/archive/refs/tags/v5.1.22.tar.gz
md5sum = 3c4c70004d1ac0e56487fcdcbb045ff6
configure-command =
  phpize && ./configure
configure-options =
  --with-php-config=${apache-php:location}/bin/php-config
environment =
  PATH=${autoconf:location}/bin:${automake:location}/bin:${m4:location}/bin:${apache-php:location}/bin:%(PATH)s


[apache]
# apache-php will write in apache folder, so we cannot share apache if apache-php is used.
shared = false

[apache-php]
recipe = slapos.recipe.cmmi
url = https://www.php.net/distributions/php-8.2.11.tar.xz
md5sum = 8e7f61ff53fd36be68643080c5114df9
configure-options =
  --disable-static
  --disable-zend-test
  --enable-exif
  --enable-ftp
  --enable-gd
  --enable-intl
  --enable-mbstring
  --enable-pcntl
  --enable-session
  --enable-sysvsem
  --with-apxs2=${apache:location}/bin/apxs
  --with-bz2=${bzip2:location}
  --with-curl
  --with-freetype
  --with-jpeg
  --with-gettext=${gettext:location}
  --with-imap-ssl
  --with-imap=${cclient:location}
  --with-ldap=${openldap:location}
  --with-mysqli=mysqlnd
  --with-openssl=${openssl:location}
  --with-pdo-mysql=mysqlnd
  --with-sodium=${libsodium:location}
  --with-zip
  --with-zlib

# Changing TMPDIR is required for PEAR installation.
# It will create a pear/temp directory under the SR instead of a shared /tmp/pear/temp.
# XXX we could mkdir tmp there
environment =
  PKG_CONFIG_PATH=${libxml2:location}/lib/pkgconfig:${openssl:location}/lib/pkgconfig:${libzip:location}/lib/pkgconfig:${sqlite3:location}/lib/pkgconfig:${curl:location}/lib/pkgconfig:${icu:location}/lib/pkgconfig:${oniguruma:location}/lib/pkgconfig:${argon2:location}/lib/pkgconfig:${zlib:location}/lib/pkgconfig:${mariadb:location}/lib/pkgconfig:${libjpeg:location}/lib/pkgconfig:${libpng:location}/lib/pkgconfig:${freetype:location}/lib/pkgconfig:${libiconv:location}/lib/pkgconfig:${libzip:location}/lib/pkgconfig:${libsodium:location}/lib/pkgconfig
  PATH=${pkgconfig:location}/bin:${bzip2:location}/bin:${libxml2:location}/bin:${xz-utils:location}/bin:%(PATH)s
  CPPFLAGS=-I${libzip:location}/include
  LDFLAGS=-L${bzip2:location}/lib -Wl,-rpath -Wl,${bzip2:location}/lib -Wl,-rpath -Wl,${curl:location}/lib -L${libtool:location}/lib -Wl,-rpath -Wl,${libtool:location}/lib -L${mariadb:location}/lib -Wl,-rpath -Wl,${mariadb:location}/lib -L${zlib:location}/lib -Wl,-rpath -Wl,${zlib:location}/lib -L${libzip:location}/lib -Wl,-rpath -Wl,${libzip:location}/lib -L${argon2:location}/lib/x86_64-linux-gnu -Wl,-rpath -Wl,${argon2:location}/lib/x86_64-linux-gnu -Wl,-rpath -Wl,${zstd:location}/lib -L${libnsl:location}/lib -Wl,-rpath -Wl,${libnsl:location}/lib -L${sqlite3:location}/lib -Wl,-rpath -Wl,${sqlite3:location}/lib
  TMPDIR=@@LOCATION@@
  HOME=${apache:location}

[xml-rpc]
recipe = slapos.recipe.cmmi
url = https://github.com/gggeek/phpxmlrpc/releases/download/2.2.2/xmlrpc-2.2.2.tar.gz
md5sum = 59a644c636c6d98267d0c99b406ae9e8
