Fix intl on Alpine 3.16 by installing icu-data-full (#605)

pull/608/head 1.5.29
Michele Locati 2022-06-24 18:25:44 +02:00 committed by GitHub
parent 0c615b3e33
commit 57009be2b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 4 deletions

View File

@ -608,6 +608,10 @@ buildRequiredPackageLists() {
else
buildRequiredPackageLists_libssldev='libretls-dev'
fi
buildRequiredPackageLists_icuPersistent=''
if test $DISTRO_MAJMIN_VERSION -ge 316; then
buildRequiredPackageLists_icuPersistent='icu-data-full'
fi
;;
debian@9)
buildRequiredPackageLists_libssldev='libssl1.0-dev'
@ -824,7 +828,7 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libidn"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libidn-dev"
else
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs libidn"
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libidn"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev libidn-dev"
fi
;;
@ -870,7 +874,7 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile firebird-dev libib-util"
;;
intl@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs"
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev"
;;
intl@debian)
@ -955,7 +959,7 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libsasl2-dev"
;;
mongodb@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs libsasl $buildRequiredPackageLists_libssl snappy"
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs $buildRequiredPackageLists_icuPersistent libsasl $buildRequiredPackageLists_libssl snappy"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile icu-dev cyrus-sasl-dev snappy-dev $buildRequiredPackageLists_libssldev zlib-dev"
;;
mongodb@debian)
@ -1361,7 +1365,9 @@ buildRequiredPackageLists() {
resetIFS
for buildRequiredPackageLists_package in $buildRequiredPackageLists_packages; do
if ! stringInList "$buildRequiredPackageLists_package" "$PACKAGES_PERSISTENT_NEW"; then
PACKAGES_VOLATILE="$PACKAGES_VOLATILE $buildRequiredPackageLists_package"
if test "$buildRequiredPackageLists_package" != icu-data-en || ! stringInList icu-data-full "$PACKAGES_PERSISTENT_NEW"; then
PACKAGES_VOLATILE="$PACKAGES_VOLATILE $buildRequiredPackageLists_package"
fi
fi
done
PACKAGES_VOLATILE="${PACKAGES_VOLATILE# }"

22
scripts/tests/intl Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php
require_once __DIR__ . '/_bootstrap.php';
$rc = 0;
echo "Checking languages:\n";
foreach ([
'en' => "\xC2\xA4#,##0.00",
'it' => "#,##0.00\xC2\xA0\xC2\xA4",
] as $locale => $expectedCurrencyFormat) {
echo "- {$locale}: ";
$formatter = new NumberFormatter($locale, NumberFormatter::CURRENCY);
$actualCurrencyFormat = $formatter->getPattern();
if ($actualCurrencyFormat === $expectedCurrencyFormat) {
echo "ok\n";
} else {
echo "failed (expected: '{$expectedCurrencyFormat}', actual: '{$actualCurrencyFormat}')\n";
$rc = 1;
}
}
exit($rc);