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

This commit is contained in:
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
pdo_sqlsrv !alpine3.7 !alpine3.8
pthreads zts
sodium !jessie
sqlsrv !alpine3.7 !alpine3.8 !7.1-alpine3.9 !7.1-alpine3.10
tensor !alpine3.15
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
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
sodium 5.6 7.0 7.1
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
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)
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
;;
@ -159,6 +169,9 @@ getPeclModuleName() {
http)
normalizePHPModuleName_name=pecl_http
;;
sodium)
normalizePHPModuleName_name=libsodium
;;
esac
printf '%s' "$normalizePHPModuleName_name"
}
@ -1081,6 +1094,14 @@ buildRequiredPackageLists() {
soap@debian)
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)
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_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)
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -le 506; then

View File

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