mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
Fix gettext on locale bug (#634)
* Fix gettext locale sanity check failure bug * Fix phpstan * Add tests * Add additional attr build configure args * Remove windows test * Fix attr configure arg * Fix attr configure bug on gnu docker and alpine docker * Add gettext-devel for doctor * weird change for gnu docker container (#643) Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de> --------- Co-authored-by: Marc <m@pyc.ac> Co-authored-by: Marc Henderkes <m.henderkes@pc-college.de>
This commit is contained in:
parent
39a66daf04
commit
4cc985a39b
@ -61,7 +61,8 @@ RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
|
|||||||
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
|
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
|
||||||
RUN yum clean all && \
|
RUN yum clean all && \
|
||||||
yum makecache && \
|
yum makecache && \
|
||||||
yum update -y
|
yum update -y && \
|
||||||
|
localedef -c -i en_US -f UTF-8 en_US.UTF-8
|
||||||
|
|
||||||
RUN yum install -y centos-release-scl
|
RUN yum install -y centos-release-scl
|
||||||
|
|
||||||
@ -137,7 +138,7 @@ MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/source:/app/source"
|
|||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/app/dist"
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/downloads:/app/downloads"
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/pkgroot:/app/pkgroot"
|
||||||
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/dist:/frankenphp/dist"
|
MOUNT_LIST="$MOUNT_LIST -v ""$(pwd)""/frankenphp-dist:/frankenphp/dist"
|
||||||
|
|
||||||
# Apply env in temp env file
|
# Apply env in temp env file
|
||||||
echo 'SPC_SKIP_DOCTOR_CHECK_ITEMS=if musl-wrapper is installed,if musl-cross-make is installed' > /tmp/spc-gnu-docker.env
|
echo 'SPC_SKIP_DOCTOR_CHECK_ITEMS=if musl-wrapper is installed,if musl-cross-make is installed' > /tmp/spc-gnu-docker.env
|
||||||
@ -145,7 +146,7 @@ echo 'CC=/opt/rh/devtoolset-10/root/usr/bin/gcc' >> /tmp/spc-gnu-docker.env
|
|||||||
echo 'CXX=/opt/rh/devtoolset-10/root/usr/bin/g++' >> /tmp/spc-gnu-docker.env
|
echo 'CXX=/opt/rh/devtoolset-10/root/usr/bin/g++' >> /tmp/spc-gnu-docker.env
|
||||||
echo 'AR=/opt/rh/devtoolset-10/root/usr/bin/ar' >> /tmp/spc-gnu-docker.env
|
echo 'AR=/opt/rh/devtoolset-10/root/usr/bin/ar' >> /tmp/spc-gnu-docker.env
|
||||||
echo 'LD=/opt/rh/devtoolset-10/root/usr/bin/ld' >> /tmp/spc-gnu-docker.env
|
echo 'LD=/opt/rh/devtoolset-10/root/usr/bin/ld' >> /tmp/spc-gnu-docker.env
|
||||||
echo 'SPC_DEFAULT_C_FLAGS=-fPIE' >> /tmp/spc-gnu-docker.env
|
echo 'SPC_DEFAULT_C_FLAGS=-fPIE -fPIC' >> /tmp/spc-gnu-docker.env
|
||||||
echo 'SPC_NO_MUSL_PATH=yes' >> /tmp/spc-gnu-docker.env
|
echo 'SPC_NO_MUSL_PATH=yes' >> /tmp/spc-gnu-docker.env
|
||||||
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"' >> /tmp/spc-gnu-docker.env
|
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS_PROGRAM="-Wl,-O1 -pie"' >> /tmp/spc-gnu-docker.env
|
||||||
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil -lrt"' >> /tmp/spc-gnu-docker.env
|
echo 'SPC_CMD_VAR_PHP_MAKE_EXTRA_LIBS="-ldl -lpthread -lm -lresolv -lutil -lrt"' >> /tmp/spc-gnu-docker.env
|
||||||
|
|||||||
@ -81,7 +81,9 @@ RUN apk update; \
|
|||||||
make \
|
make \
|
||||||
pkgconfig \
|
pkgconfig \
|
||||||
wget \
|
wget \
|
||||||
xz
|
xz \
|
||||||
|
gettext-dev \
|
||||||
|
binutils-gold
|
||||||
|
|
||||||
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
|
RUN curl -#fSL https://dl.static-php.dev/static-php-cli/bulk/php-8.4.4-cli-linux-\$(uname -m).tar.gz | tar -xz -C /usr/local/bin && \
|
||||||
chmod +x /usr/local/bin/php
|
chmod +x /usr/local/bin/php
|
||||||
|
|||||||
@ -57,7 +57,8 @@ RUN sed -i 's/mirror.centos.org/vault.centos.org/g' /etc/yum.repos.d/*.repo && \
|
|||||||
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
|
sed -i 's/^mirrorlist=http/#mirrorlist=http/g' /etc/yum.repos.d/*.repo
|
||||||
RUN yum clean all && \
|
RUN yum clean all && \
|
||||||
yum makecache && \
|
yum makecache && \
|
||||||
yum update -y
|
yum update -y && \
|
||||||
|
localedef -c -i en_US -f UTF-8 en_US.UTF-8
|
||||||
|
|
||||||
RUN yum install -y centos-release-scl
|
RUN yum install -y centos-release-scl
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@
|
|||||||
},
|
},
|
||||||
"ffi": {
|
"ffi": {
|
||||||
"support": {
|
"support": {
|
||||||
"Linux": "no",
|
"Linux": "partial",
|
||||||
"BSD": "wip"
|
"BSD": "wip"
|
||||||
},
|
},
|
||||||
"notes": true,
|
"notes": true,
|
||||||
|
|||||||
@ -18,8 +18,10 @@ trait attr
|
|||||||
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags()),
|
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags()),
|
||||||
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
|
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
|
||||||
'LIBS' => $this->getLibExtraLibs(),
|
'LIBS' => $this->getLibExtraLibs(),
|
||||||
])->execWithEnv('./autogen.sh')
|
])
|
||||||
->execWithEnv('./configure --prefix= --enable-static --disable-shared --disable-nls')
|
->execWithEnv('libtoolize --force --copy')
|
||||||
|
->execWithEnv('./autogen.sh')
|
||||||
|
->execWithEnv('./configure --prefix= --enable-static --disable-shared --with-pic --disable-nls')
|
||||||
->execWithEnv("make -j {$this->builder->concurrency}")
|
->execWithEnv("make -j {$this->builder->concurrency}")
|
||||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ trait libacl
|
|||||||
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
|
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
|
||||||
'LIBS' => $this->getLibExtraLibs(),
|
'LIBS' => $this->getLibExtraLibs(),
|
||||||
])
|
])
|
||||||
|
->execWithEnv('libtoolize --force --copy')
|
||||||
->execWithEnv('./autogen.sh')
|
->execWithEnv('./autogen.sh')
|
||||||
->execWithEnv('./configure --prefix= --enable-static --disable-shared --disable-tests --disable-nls')
|
->execWithEnv('./configure --prefix= --enable-static --disable-shared --disable-tests --disable-nls')
|
||||||
->execWithEnv("make -j {$this->builder->concurrency}")
|
->execWithEnv("make -j {$this->builder->concurrency}")
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class LinuxToolCheckList
|
|||||||
'git', 'autoconf', 'automake',
|
'git', 'autoconf', 'automake',
|
||||||
'tar', 'unzip', 'gzip', 'gcc',
|
'tar', 'unzip', 'gzip', 'gcc',
|
||||||
'bzip2', 'cmake', 'patch',
|
'bzip2', 'cmake', 'patch',
|
||||||
'xz', 'libtool',
|
'xz', 'libtool', 'gettext-devel',
|
||||||
];
|
];
|
||||||
|
|
||||||
public const TOOLS_ARCH = [
|
public const TOOLS_ARCH = [
|
||||||
@ -47,6 +47,7 @@ class LinuxToolCheckList
|
|||||||
private const PROVIDED_COMMAND = [
|
private const PROVIDED_COMMAND = [
|
||||||
'binutils-gold' => 'ld.gold',
|
'binutils-gold' => 'ld.gold',
|
||||||
'base-devel' => 'automake',
|
'base-devel' => 'automake',
|
||||||
|
'gettext-devel' => 'gettext',
|
||||||
];
|
];
|
||||||
|
|
||||||
/** @noinspection PhpUnused */
|
/** @noinspection PhpUnused */
|
||||||
|
|||||||
@ -14,7 +14,7 @@ if (!file_exists('locale/en_US/LC_MESSAGES/test.mo')) {
|
|||||||
file_put_contents('locale/en_US/LC_MESSAGES/test.mo', base64_decode($mo));
|
file_put_contents('locale/en_US/LC_MESSAGES/test.mo', base64_decode($mo));
|
||||||
}
|
}
|
||||||
putenv('LANG=en_US');
|
putenv('LANG=en_US');
|
||||||
setlocale(LC_ALL, 'en_US');
|
assert(setlocale(LC_ALL, 'en_US.utf-8') === 'en_US.utf-8');
|
||||||
|
|
||||||
$domain = 'test';
|
$domain = 'test';
|
||||||
bindtextdomain($domain, 'locale/');
|
bindtextdomain($domain, 'locale/');
|
||||||
|
|||||||
@ -21,7 +21,7 @@ $test_php_version = [
|
|||||||
|
|
||||||
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
|
// test os (macos-13, macos-14, ubuntu-latest, windows-latest are available)
|
||||||
$test_os = [
|
$test_os = [
|
||||||
// 'macos-13',
|
'macos-13',
|
||||||
'macos-14',
|
'macos-14',
|
||||||
'ubuntu-latest',
|
'ubuntu-latest',
|
||||||
// 'windows-latest',
|
// 'windows-latest',
|
||||||
@ -40,7 +40,7 @@ $prefer_pre_built = false;
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'imagick',
|
'Linux', 'Darwin' => 'gettext',
|
||||||
'Windows' => 'bcmath',
|
'Windows' => 'bcmath',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user