We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d74977 commit 4ab5c49Copy full SHA for 4ab5c49
config/ext.json
@@ -153,8 +153,9 @@
153
},
154
"ldap": {
155
"type": "builtin",
156
- "arg-type": "with",
+ "arg-type": "with-prefix",
157
"lib-depends": [
158
+ "openssl",
159
"ldap"
160
]
161
config/lib.json
@@ -139,6 +139,13 @@
139
"libxml2"
140
141
142
+ "ldap": {
143
+ "source": "ldap",
144
+ "static-libs-unix": [
145
+ "liblber.a",
146
+ "libldap.a"
147
+ ]
148
+ },
149
"libavif": {
150
"source": "libavif",
151
"static-libs-unix": [
config/source.json
@@ -42,6 +42,15 @@
42
"path": "COPYING"
43
}
44
45
46
+ "type": "filelist",
47
+ "url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
48
+ "regex": "/href=\"(?<file>openldap-(?<version>[^\"]+)\\.tgz)\"/",
49
+ "license": {
50
+ "type": "file",
51
+ "path": "LICENSE"
52
+ }
53
54
"ext-event": {
55
"type": "url",
56
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
src/SPC/builder/linux/library/ldap.php
@@ -0,0 +1,12 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+namespace SPC\builder\linux\library;
6
7
+class ldap extends LinuxLibraryBase
8
+{
9
+ use \SPC\builder\unix\library\ldap;
10
11
+ public const NAME = 'ldap';
12
+}
src/SPC/builder/unix/library/curl.php
@@ -39,8 +39,8 @@ protected function build(): void
39
} else {
40
$extra .= '-DUSE_NGHTTP2=OFF ';
41
- // TODO: ldap is not supported yet
- $extra .= '-DCURL_DISABLE_LDAP=ON ';
+ // lib:ldap
+ $extra .= $this->builder->getLib('ldap') ? '-DCURL_DISABLE_LDAP=OFF ' : '-DCURL_DISABLE_LDAP=ON ';
// lib:zstd
$extra .= $this->builder->getLib('zstd') ? '-DCURL_ZSTD=ON ' : '-DCURL_ZSTD=OFF ';
// lib:idn2
src/SPC/builder/unix/library/ldap.php
@@ -0,0 +1,29 @@
+namespace SPC\builder\unix\library;
+trait ldap
+ protected function build(): void
+ {
+ $openssl_include = BUILD_INCLUDE_PATH;
+ $openssl_lib = BUILD_LIB_PATH;
13
+ shell()->cd($this->source_dir)
14
+ ->exec(
15
+ 'CC="musl-gcc -I' . $openssl_include . ' -L' . $openssl_lib . '" LDFLAGS="-static" ./configure ' .
16
+ '--enable-static=yes ' .
17
+ '--disable-shared ' .
18
+ '--disable-slapd ' .
19
+ '--without-systemd ' .
20
+ '--with-tls=openssl ' .
21
+ '--prefix=' . BUILD_ROOT_PATH
22
+ )
23
+ ->exec('make clean')
24
+ ->exec('make depend')
25
+ ->exec("make -j{$this->builder->concurrency}")
26
+ ->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
27
+ $this->patchPkgconfPrefix(['libldap.pc', 'liblber.pc']);
28
29
src/SPC/builder/unix/library/postgresql.php
@@ -57,15 +57,14 @@ protected function build(): void
57
'--with-ssl=openssl ' .
58
'--with-readline ' .
59
'--with-libxml ' .
60
+ ($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') .
61
($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') .
- '--without-ldap ' .
62
'--without-libxslt ' .
63
'--without-lz4 ' .
64
'--without-zstd ' .
65
'--without-perl ' .
66
'--without-python ' .
67
'--without-pam ' .
68
69
'--without-bonjour ' .
70
'--without-tcl '
71
);
src/SPC/doctor/item/LinuxMuslCheck.php
@@ -36,11 +36,18 @@ public function checkMusl(): ?CheckResult
36
#[AsFixItem('fix-musl')]
37
public function fixMusl(array $distro): bool
38
{
+ $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 = '';
src/SPC/doctor/item/LinuxToolCheckList.php
@@ -24,13 +24,21 @@ class LinuxToolCheckList
];
public const TOOLS_DEBIAN = [
- 'perl', 'make', 'bison', 'flex',
+ 'make', 'bison', 'flex',
'git', 'autoconf', 'automake',
'tar', 'unzip', 'gzip',
30
'bzip2', 'cmake', 'patch',
31
'xz',
32
33
34
+ public const TOOLS_RHEL = [
35
+ '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 @@ public function checkCliTools(): ?CheckResult
$required = match ($distro['dist']) {
'alpine' => self::TOOLS_ALPINE,
+ 'almalinux' => self::TOOLS_RHEL,
+ 'rhel' => self::TOOLS_RHEL,
default => self::TOOLS_DEBIAN,
$missing = [];
0 commit comments