mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
add ext-ldap (openldap) support
This commit is contained in:
parent
e3a4cd6e1d
commit
059c32e59c
@ -153,9 +153,15 @@
|
|||||||
},
|
},
|
||||||
"ldap": {
|
"ldap": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"arg-type": "with",
|
"arg-type": "with-prefix",
|
||||||
"lib-depends": [
|
"lib-depends": [
|
||||||
"ldap"
|
"ldap"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"openssl"
|
||||||
|
],
|
||||||
|
"ext-suggests": [
|
||||||
|
"openssl"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mbregex": {
|
"mbregex": {
|
||||||
|
|||||||
@ -139,6 +139,13 @@
|
|||||||
"libxml2"
|
"libxml2"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"ldap": {
|
||||||
|
"source": "ldap",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"liblber.a",
|
||||||
|
"libldap.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libavif": {
|
"libavif": {
|
||||||
"source": "libavif",
|
"source": "libavif",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@ -42,6 +42,16 @@
|
|||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ldap": {
|
||||||
|
"type": "filelist",
|
||||||
|
"url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
|
||||||
|
"regex": "/href=\"(?<file>openldap-(?<version>[^\"]+)\\.tgz)\"/",
|
||||||
|
"path": "php-src/ext/ldap",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-event": {
|
"ext-event": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
|
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
|
||||||
|
|||||||
12
src/SPC/builder/linux/library/ldap.php
Normal file
12
src/SPC/builder/linux/library/ldap.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class ldap extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\ldap;
|
||||||
|
|
||||||
|
public const NAME = 'ldap';
|
||||||
|
}
|
||||||
12
src/SPC/builder/macos/library/ldap.php
Normal file
12
src/SPC/builder/macos/library/ldap.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class ldap extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\ldap;
|
||||||
|
|
||||||
|
public const NAME = 'ldap';
|
||||||
|
}
|
||||||
@ -39,8 +39,8 @@ trait curl
|
|||||||
} else {
|
} else {
|
||||||
$extra .= '-DUSE_NGHTTP2=OFF ';
|
$extra .= '-DUSE_NGHTTP2=OFF ';
|
||||||
}
|
}
|
||||||
// TODO: ldap is not supported yet
|
// lib:ldap
|
||||||
$extra .= '-DCURL_DISABLE_LDAP=ON ';
|
$extra .= $this->builder->getLib('ldap') ? '-DCURL_DISABLE_LDAP=OFF ' : '-DCURL_DISABLE_LDAP=ON ';
|
||||||
// lib:zstd
|
// lib:zstd
|
||||||
$extra .= $this->builder->getLib('zstd') ? '-DCURL_ZSTD=ON ' : '-DCURL_ZSTD=OFF ';
|
$extra .= $this->builder->getLib('zstd') ? '-DCURL_ZSTD=ON ' : '-DCURL_ZSTD=OFF ';
|
||||||
// lib:idn2
|
// lib:idn2
|
||||||
|
|||||||
29
src/SPC/builder/unix/library/ldap.php
Normal file
29
src/SPC/builder/unix/library/ldap.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
trait ldap
|
||||||
|
{
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec(
|
||||||
|
$this->builder->configure_env . ' ' .
|
||||||
|
'LDFLAGS="-static"' .
|
||||||
|
' ./configure ' .
|
||||||
|
'--enable-static ' .
|
||||||
|
'--disable-shared ' .
|
||||||
|
'--disable-slapd ' .
|
||||||
|
'--without-systemd ' .
|
||||||
|
($this->builder->getLib('openssl') ? '--with-tls=openssl ' : '') .
|
||||||
|
'--prefix='
|
||||||
|
)
|
||||||
|
->exec('make clean')
|
||||||
|
->exec('make depend')
|
||||||
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
$this->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -57,15 +57,14 @@ trait postgresql
|
|||||||
'--with-ssl=openssl ' .
|
'--with-ssl=openssl ' .
|
||||||
'--with-readline ' .
|
'--with-readline ' .
|
||||||
'--with-libxml ' .
|
'--with-libxml ' .
|
||||||
|
($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
|
||||||
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
|
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
|
||||||
'--without-ldap ' .
|
|
||||||
'--without-libxslt ' .
|
'--without-libxslt ' .
|
||||||
'--without-lz4 ' .
|
'--without-lz4 ' .
|
||||||
'--without-zstd ' .
|
'--without-zstd ' .
|
||||||
'--without-perl ' .
|
'--without-perl ' .
|
||||||
'--without-python ' .
|
'--without-python ' .
|
||||||
'--without-pam ' .
|
'--without-pam ' .
|
||||||
'--without-ldap ' .
|
|
||||||
'--without-bonjour ' .
|
'--without-bonjour ' .
|
||||||
'--without-tcl '
|
'--without-tcl '
|
||||||
);
|
);
|
||||||
|
|||||||
@ -36,11 +36,18 @@ class LinuxMuslCheck
|
|||||||
#[AsFixItem('fix-musl')]
|
#[AsFixItem('fix-musl')]
|
||||||
public function fixMusl(array $distro): bool
|
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']) {
|
$install_cmd = match ($distro['dist']) {
|
||||||
'ubuntu', 'debian' => 'apt-get install musl musl-tools -y',
|
'ubuntu', 'debian' => 'apt-get install musl musl-tools -y',
|
||||||
'alpine' => 'apk add musl musl-utils musl-dev',
|
'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 ..',
|
'rhel' => $rhel_install,
|
||||||
'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 ..',
|
'almalinux' => $rhel_install,
|
||||||
default => throw new RuntimeException('Current linux distro does not have an auto-install script for musl packages yet.'),
|
default => throw new RuntimeException('Current linux distro does not have an auto-install script for musl packages yet.'),
|
||||||
};
|
};
|
||||||
$prefix = '';
|
$prefix = '';
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class LinuxToolCheckList
|
|||||||
use UnixSystemUtilTrait;
|
use UnixSystemUtilTrait;
|
||||||
|
|
||||||
public const TOOLS_ALPINE = [
|
public const TOOLS_ALPINE = [
|
||||||
'perl', 'make', 'bison', 'flex',
|
'make', 'bison', 'flex',
|
||||||
'git', 'autoconf', 'automake',
|
'git', 'autoconf', 'automake',
|
||||||
'tar', 'unzip', 'gzip',
|
'tar', 'unzip', 'gzip',
|
||||||
'bzip2', 'cmake', 'gcc',
|
'bzip2', 'cmake', 'gcc',
|
||||||
@ -24,13 +24,21 @@ class LinuxToolCheckList
|
|||||||
];
|
];
|
||||||
|
|
||||||
public const TOOLS_DEBIAN = [
|
public const TOOLS_DEBIAN = [
|
||||||
'perl', 'make', 'bison', 'flex',
|
'make', 'bison', 'flex',
|
||||||
'git', 'autoconf', 'automake',
|
'git', 'autoconf', 'automake',
|
||||||
'tar', 'unzip', 'gzip',
|
'tar', 'unzip', 'gzip',
|
||||||
'bzip2', 'cmake', 'patch',
|
'bzip2', 'cmake', 'patch',
|
||||||
'xz',
|
'xz',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public const TOOLS_RHEL = [
|
||||||
|
'perl', 'make', 'bison', 'flex',
|
||||||
|
'git', 'autoconf', 'automake',
|
||||||
|
'tar', 'unzip', 'gzip', 'gcc',
|
||||||
|
'bzip2', 'cmake', 'patch',
|
||||||
|
'xz',
|
||||||
|
];
|
||||||
|
|
||||||
/** @noinspection PhpUnused */
|
/** @noinspection PhpUnused */
|
||||||
#[AsCheckItem('if necessary tools are installed', limit_os: 'Linux')]
|
#[AsCheckItem('if necessary tools are installed', limit_os: 'Linux')]
|
||||||
public function checkCliTools(): ?CheckResult
|
public function checkCliTools(): ?CheckResult
|
||||||
@ -39,6 +47,8 @@ class LinuxToolCheckList
|
|||||||
|
|
||||||
$required = match ($distro['dist']) {
|
$required = match ($distro['dist']) {
|
||||||
'alpine' => self::TOOLS_ALPINE,
|
'alpine' => self::TOOLS_ALPINE,
|
||||||
|
'almalinux' => self::TOOLS_RHEL,
|
||||||
|
'rhel' => self::TOOLS_RHEL,
|
||||||
default => self::TOOLS_DEBIAN,
|
default => self::TOOLS_DEBIAN,
|
||||||
};
|
};
|
||||||
$missing = [];
|
$missing = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user