From: Pascal de Bruijn
Date: Fri, 8 Nov 2019 09:17:00 +0000 (+0100)
Subject: package/php: add option to enable libsodium support
X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d842d5ded320a4351650c3633b6eb70a4f33243;p=buildroot.git
package/php: add option to enable libsodium support
Signed-off-by: Pascal de Bruijn
Signed-off-by: Thomas Petazzoni
---
diff --git a/package/php/Config.ext b/package/php/Config.ext
index c7f0332fd8..0c6ed4b401 100644
--- a/package/php/Config.ext
+++ b/package/php/Config.ext
@@ -70,6 +70,12 @@ config BR2_PACKAGE_PHP_EXT_HASH
help
HASH message digest framework
+config BR2_PACKAGE_PHP_EXT_LIBSODIUM
+ bool "libsodium"
+ select BR2_PACKAGE_LIBSODIUM
+ help
+ libsodium support
+
config BR2_PACKAGE_PHP_EXT_MCRYPT
bool "mcrypt"
select BR2_PACKAGE_LIBMCRYPT
diff --git a/package/php/php.mk b/package/php/php.mk
index b679531238..85bf2075ae 100644
--- a/package/php/php.mk
+++ b/package/php/php.mk
@@ -122,6 +122,11 @@ PHP_CONF_OPTS += \
$(if $(BR2_PACKAGE_PHP_EXT_MBSTRING),--enable-mbstring) \
$(if $(BR2_PACKAGE_PHP_EXT_PHAR),--enable-phar)
+ifeq ($(BR2_PACKAGE_PHP_EXT_LIBSODIUM),y)
+PHP_CONF_OPTS += --with-sodium=$(STAGING_DIR)/usr
+PHP_DEPENDENCIES += libsodium
+endif
+
ifeq ($(BR2_PACKAGE_PHP_EXT_MCRYPT),y)
PHP_CONF_OPTS += --with-mcrypt=$(STAGING_DIR)/usr
PHP_DEPENDENCIES += libmcrypt