mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-06 00:05:42 +08:00
add ext-ldap (openldap) support
This commit is contained in:
@@ -36,11 +36,18 @@ class LinuxMuslCheck
|
||||
#[AsFixItem('fix-musl')]
|
||||
public function fixMusl(array $distro): bool
|
||||
{
|
||||
$rhel_install = 'dnf install tar wget git zip bison flex bzip2 cmake patch && \
|
||||
wget https://musl.libc.org/releases/musl-1.2.4.tar.gz && tar -zxvf musl-1.2.4.tar.gz && \
|
||||
rm -f musl-1.2.4.tar.gz && cd musl-1.2.4 &&
|
||||
if [[ ! "$PATH" =~ (^|:)"/usr/local/musl/bin"(:|$) ]]; then export PATH="/usr/local/musl/bin:$PATH"
|
||||
fi && \
|
||||
./configure --disable-shared --enable-wrapper=gcc && \
|
||||
make -j && make install && cd ..';
|
||||
$install_cmd = match ($distro['dist']) {
|
||||
'ubuntu', 'debian' => 'apt-get install musl musl-tools -y',
|
||||
'alpine' => 'apk add musl musl-utils musl-dev',
|
||||
'rhel' => 'dnf install tar wget git zip bison flex bzip2 cmake patch && wget https://musl.libc.org/releases/musl-1.2.4.tar.gz && tar -zxvf musl-1.2.4.tar.gz && rm musl-1.2.4.tar.gz && cd musl-1.2.4 && ./configure && make -j && make install && cd ..',
|
||||
'almalinux' => 'dnf install bison flex bzip2 cmake patch && wget https://musl.libc.org/releases/musl-1.2.4.tar.gz && tar -zxvf musl-1.2.4.tar.gz && rm musl-1.2.4.tar.gz && cd musl-1.2.4 && ./configure && make -j && make install && export PATH="/usr/local/musl/bin:$PATH" cd ..',
|
||||
'rhel' => $rhel_install,
|
||||
'almalinux' => $rhel_install,
|
||||
default => throw new RuntimeException('Current linux distro does not have an auto-install script for musl packages yet.'),
|
||||
};
|
||||
$prefix = '';
|
||||
|
||||
@@ -16,7 +16,7 @@ class LinuxToolCheckList
|
||||
use UnixSystemUtilTrait;
|
||||
|
||||
public const TOOLS_ALPINE = [
|
||||
'perl', 'make', 'bison', 'flex',
|
||||
'make', 'bison', 'flex',
|
||||
'git', 'autoconf', 'automake',
|
||||
'tar', 'unzip', 'gzip',
|
||||
'bzip2', 'cmake', 'gcc',
|
||||
@@ -24,13 +24,21 @@ class LinuxToolCheckList
|
||||
];
|
||||
|
||||
public const TOOLS_DEBIAN = [
|
||||
'perl', 'make', 'bison', 'flex',
|
||||
'make', 'bison', 'flex',
|
||||
'git', 'autoconf', 'automake',
|
||||
'tar', 'unzip', 'gzip',
|
||||
'bzip2', 'cmake', 'patch',
|
||||
'xz',
|
||||
];
|
||||
|
||||
public const TOOLS_RHEL = [
|
||||
'perl', 'make', 'bison', 'flex',
|
||||
'git', 'autoconf', 'automake',
|
||||
'tar', 'unzip', 'gzip', 'gcc',
|
||||
'bzip2', 'cmake', 'patch',
|
||||
'xz',
|
||||
];
|
||||
|
||||
/** @noinspection PhpUnused */
|
||||
#[AsCheckItem('if necessary tools are installed', limit_os: 'Linux')]
|
||||
public function checkCliTools(): ?CheckResult
|
||||
@@ -39,6 +47,8 @@ class LinuxToolCheckList
|
||||
|
||||
$required = match ($distro['dist']) {
|
||||
'alpine' => self::TOOLS_ALPINE,
|
||||
'almalinux' => self::TOOLS_RHEL,
|
||||
'rhel' => self::TOOLS_RHEL,
|
||||
default => self::TOOLS_DEBIAN,
|
||||
};
|
||||
$missing = [];
|
||||
|
||||
Reference in New Issue
Block a user