Add support for sodium on PHP 5.6, 7.0 and 7.1 (#562)

pull/563/head
Michele Locati 2022-04-05 14:37:14 +02:00 committed by GitHub
parent 3714ceb51a
commit a73248ed6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 0 deletions

View File

@ -3,6 +3,7 @@ memprof !alpine
parallel zts parallel zts
pdo_sqlsrv !alpine3.7 !alpine3.8 pdo_sqlsrv !alpine3.7 !alpine3.8
pthreads zts pthreads zts
sodium !jessie
sqlsrv !alpine3.7 !alpine3.8 !7.1-alpine3.9 !7.1-alpine3.10 sqlsrv !alpine3.7 !alpine3.8 !7.1-alpine3.9 !7.1-alpine3.10
tensor !alpine3.15 tensor !alpine3.15
vips !alpine3.7 !alpine3.8 !alpine3.9 !jessie vips !alpine3.7 !alpine3.8 !alpine3.9 !jessie

View File

@ -85,6 +85,7 @@ snmp 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
snuffleupagus 7.0 7.1 7.2 7.3 7.4 8.0 8.1 snuffleupagus 7.0 7.1 7.2 7.3 7.4 8.0 8.1
soap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 soap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
sockets 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 sockets 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1
sodium 5.6 7.0 7.1
solr 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 solr 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
sourceguardian 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 sourceguardian 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0
spx 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 spx 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1

View File

@ -139,6 +139,16 @@ normalizePHPModuleName() {
zend\ opcache) zend\ opcache)
normalizePHPModuleName_name='opcache' normalizePHPModuleName_name='opcache'
;; ;;
libsodium)
if test $PHP_MAJMIN_VERSION -ge 700; then
normalizePHPModuleName_name='sodium'
fi
;;
sodium)
if test $PHP_MAJMIN_VERSION -lt 700; then
normalizePHPModuleName_name='libsodium'
fi
;;
*\ *) *\ *)
printf '### WARNING Unrecognized module name: %s ###\n' "$1" >&2 printf '### WARNING Unrecognized module name: %s ###\n' "$1" >&2
;; ;;
@ -159,6 +169,9 @@ getPeclModuleName() {
http) http)
normalizePHPModuleName_name=pecl_http normalizePHPModuleName_name=pecl_http
;; ;;
sodium)
normalizePHPModuleName_name=libsodium
;;
esac esac
printf '%s' "$normalizePHPModuleName_name" printf '%s' "$normalizePHPModuleName_name"
} }
@ -1081,6 +1094,14 @@ buildRequiredPackageLists() {
soap@debian) soap@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libxml2-dev"
;; ;;
sodium@alpine | libsodium@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsodium"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev"
;;
sodium@debian | libsodium@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libsodium[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libsodium-dev"
;;
solr@alpine) solr@alpine)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev libxml2-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev libxml2-dev"
;; ;;
@ -2893,6 +2914,13 @@ installRemoteModule() {
installRemoteModule_ini_extra="$(printf '%ssp.configuration_file=%s\n' "$installRemoteModule_ini_extra" "$PHP_INI_DIR/conf.d/snuffleupagus.rules")" installRemoteModule_ini_extra="$(printf '%ssp.configuration_file=%s\n' "$installRemoteModule_ini_extra" "$PHP_INI_DIR/conf.d/snuffleupagus.rules")"
installRemoteModule_manuallyInstalled=1 installRemoteModule_manuallyInstalled=1
;; ;;
sodium | libsodium)
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -lt 700; then
installRemoteModule_version=1.0.7
fi
fi
;;
solr) solr)
if test -z "$installRemoteModule_version"; then if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -le 506; then if test $PHP_MAJMIN_VERSION -le 506; then

View File

@ -7,6 +7,11 @@ $nameMap = [
'apcu_bc' => 'apc', 'apcu_bc' => 'apc',
'ioncube_loader' => 'ionCube Loader', 'ioncube_loader' => 'ionCube Loader',
]; ];
if (PHP_VERSION_ID < 70000) {
$nameMap['sodium'] = 'libsodium';
} else {
$nameMap['libsodium'] = 'sodium';
}
$testsDir = __DIR__ . '/tests'; $testsDir = __DIR__ . '/tests';
function runTest($testFile) function runTest($testFile)
{ {