mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
Add ldap,libcares,libsodium,libunistring, lint all configs
This commit is contained in:
parent
6ee8dc7994
commit
19e11caa83
17
config/pkg/lib/ldap.yml
Normal file
17
config/pkg/lib/ldap.yml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
ldap:
|
||||||
|
type: library
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://www.openldap.org/software/download/OpenLDAP/openldap-release/'
|
||||||
|
regex: '/href="(?<file>openldap-(?<version>[^"]+)\.tgz)"/'
|
||||||
|
metadata:
|
||||||
|
license-files: [LICENSE]
|
||||||
|
depends:
|
||||||
|
- openssl
|
||||||
|
- zlib
|
||||||
|
- gmp
|
||||||
|
- libsodium
|
||||||
|
pkg-configs:
|
||||||
|
- ldap
|
||||||
|
- lber
|
||||||
@ -17,7 +17,7 @@ libcares:
|
|||||||
- ares.h
|
- ares.h
|
||||||
- ares_dns.h
|
- ares_dns.h
|
||||||
- ares_nameser.h
|
- ares_nameser.h
|
||||||
static-libs@unix:
|
|
||||||
- libcares.a
|
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- libcares
|
- libcares
|
||||||
|
static-libs@unix:
|
||||||
|
- libcares.a
|
||||||
|
|||||||
15
config/pkg/lib/libsodium.yml
Normal file
15
config/pkg/lib/libsodium.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
libsodium:
|
||||||
|
type: library
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: ghrel
|
||||||
|
repo: jedisct1/libsodium
|
||||||
|
match: 'libsodium-(?!1\.0\.21)\d+(\.\d+)*\.tar\.gz'
|
||||||
|
prefer-stable: true
|
||||||
|
binary: hosted
|
||||||
|
metadata:
|
||||||
|
license-files: [LICENSE]
|
||||||
|
pkg-configs:
|
||||||
|
- libsodium
|
||||||
|
static-libs@unix:
|
||||||
|
- libsodium.a
|
||||||
@ -16,7 +16,7 @@ libssh2:
|
|||||||
- libssh2.h
|
- libssh2.h
|
||||||
- libssh2_publickey.h
|
- libssh2_publickey.h
|
||||||
- libssh2_sftp.h
|
- libssh2_sftp.h
|
||||||
static-libs@unix:
|
|
||||||
- libssh2.a
|
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- libssh2
|
- libssh2
|
||||||
|
static-libs@unix:
|
||||||
|
- libssh2.a
|
||||||
|
|||||||
16
config/pkg/lib/libunistring.yml
Normal file
16
config/pkg/lib/libunistring.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
libunistring:
|
||||||
|
type: library
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: filelist
|
||||||
|
url: 'https://ftp.gnu.org/gnu/libunistring/'
|
||||||
|
regex: '/href="(?<file>libunistring-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
|
binary: hosted
|
||||||
|
metadata:
|
||||||
|
license-files: [COPYING.LIB]
|
||||||
|
license: LGPL-3.0-or-later
|
||||||
|
headers:
|
||||||
|
- unistr.h
|
||||||
|
- unistring/
|
||||||
|
static-libs@unix:
|
||||||
|
- libunistring.a
|
||||||
@ -4,16 +4,16 @@ libxml2:
|
|||||||
source:
|
source:
|
||||||
type: ghtagtar
|
type: ghtagtar
|
||||||
repo: GNOME/libxml2
|
repo: GNOME/libxml2
|
||||||
match: 'v2\.\d+\.\d+$'
|
match: v2\.\d+\.\d+$
|
||||||
metadata:
|
metadata:
|
||||||
license-files: [Copyright]
|
license-files: [Copyright]
|
||||||
license: MIT
|
license: MIT
|
||||||
depends@unix:
|
depends@unix:
|
||||||
- libiconv
|
- libiconv
|
||||||
suggests@unix:
|
|
||||||
- xz
|
|
||||||
- zlib
|
|
||||||
headers:
|
headers:
|
||||||
- libxml2
|
- libxml2
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- libxml-2.0
|
- libxml-2.0
|
||||||
|
suggests@unix:
|
||||||
|
- xz
|
||||||
|
- zlib
|
||||||
|
|||||||
@ -11,14 +11,14 @@ nghttp2:
|
|||||||
depends:
|
depends:
|
||||||
- zlib
|
- zlib
|
||||||
- openssl
|
- openssl
|
||||||
|
headers:
|
||||||
|
- nghttp2
|
||||||
|
pkg-configs:
|
||||||
|
- libnghttp2
|
||||||
|
static-libs@unix:
|
||||||
|
- libnghttp2.a
|
||||||
suggests:
|
suggests:
|
||||||
- libxml2
|
- libxml2
|
||||||
- nghttp3
|
- nghttp3
|
||||||
- ngtcp2
|
- ngtcp2
|
||||||
- brotli
|
- brotli
|
||||||
headers:
|
|
||||||
- nghttp2
|
|
||||||
static-libs@unix:
|
|
||||||
- libnghttp2.a
|
|
||||||
pkg-configs:
|
|
||||||
- libnghttp2
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@ nghttp3:
|
|||||||
- openssl
|
- openssl
|
||||||
headers:
|
headers:
|
||||||
- nghttp3
|
- nghttp3
|
||||||
static-libs@unix:
|
|
||||||
- libnghttp3.a
|
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- libnghttp3
|
- libnghttp3
|
||||||
|
static-libs@unix:
|
||||||
|
- libnghttp3.a
|
||||||
|
|||||||
@ -11,14 +11,14 @@ ngtcp2:
|
|||||||
license: MIT
|
license: MIT
|
||||||
depends:
|
depends:
|
||||||
- openssl
|
- openssl
|
||||||
suggests:
|
|
||||||
- nghttp3
|
|
||||||
- brotli
|
|
||||||
headers:
|
headers:
|
||||||
- ngtcp2
|
- ngtcp2
|
||||||
static-libs@unix:
|
|
||||||
- libngtcp2.a
|
|
||||||
- libngtcp2_crypto_ossl.a
|
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- libngtcp2
|
- libngtcp2
|
||||||
- libngtcp2_crypto_ossl
|
- libngtcp2_crypto_ossl
|
||||||
|
static-libs@unix:
|
||||||
|
- libngtcp2.a
|
||||||
|
- libngtcp2_crypto_ossl.a
|
||||||
|
suggests:
|
||||||
|
- nghttp3
|
||||||
|
- brotli
|
||||||
|
|||||||
@ -14,7 +14,7 @@ xz:
|
|||||||
- libiconv
|
- libiconv
|
||||||
headers@unix:
|
headers@unix:
|
||||||
- lzma
|
- lzma
|
||||||
static-libs@unix:
|
|
||||||
- liblzma.a
|
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- liblzma
|
- liblzma
|
||||||
|
static-libs@unix:
|
||||||
|
- liblzma.a
|
||||||
|
|||||||
@ -13,7 +13,7 @@ zstd:
|
|||||||
- zdict.h
|
- zdict.h
|
||||||
- zstd.h
|
- zstd.h
|
||||||
- zstd_errors.h
|
- zstd_errors.h
|
||||||
static-libs@unix:
|
|
||||||
- libzstd.a
|
|
||||||
pkg-configs:
|
pkg-configs:
|
||||||
- libzstd
|
- libzstd
|
||||||
|
static-libs@unix:
|
||||||
|
- libzstd.a
|
||||||
|
|||||||
59
src/Package/Library/ldap.php
Normal file
59
src/Package/Library/ldap.php
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Library;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Attribute\Package\PatchBeforeBuild;
|
||||||
|
use StaticPHP\Attribute\PatchDescription;
|
||||||
|
use StaticPHP\Package\LibraryPackage;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
|
use StaticPHP\Util\FileSystem;
|
||||||
|
|
||||||
|
#[Library('ldap')]
|
||||||
|
class ldap
|
||||||
|
{
|
||||||
|
#[PatchBeforeBuild]
|
||||||
|
#[PatchDescription('Add zlib and extra libs to linker flags for ldap')]
|
||||||
|
public function patchBeforeBuild(LibraryPackage $lib): bool
|
||||||
|
{
|
||||||
|
$extra = SystemTarget::getLibc() === 'glibc' ? '-ldl -lpthread -lm -lresolv -lutil' : '';
|
||||||
|
FileSystem::replaceFileStr($lib->getSourceDir() . '/configure', '"-lssl -lcrypto', '"-lssl -lcrypto -lz ' . $extra);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
public function build(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
UnixAutoconfExecutor::create($lib)
|
||||||
|
->optionalPackage('openssl', '--with-tls=openssl')
|
||||||
|
->optionalPackage('gmp', '--with-mp=gmp')
|
||||||
|
->optionalPackage('libsodium', '--with-argon2=libsodium', '--enable-argon2=no')
|
||||||
|
->addConfigureArgs(
|
||||||
|
'--disable-slapd',
|
||||||
|
'--without-systemd',
|
||||||
|
'--without-cyrus-sasl',
|
||||||
|
'ac_cv_func_pthread_kill_other_threads_np=no'
|
||||||
|
)
|
||||||
|
->appendEnv([
|
||||||
|
'CFLAGS' => '-Wno-date-time',
|
||||||
|
'LDFLAGS' => "-L{$lib->getLibDir()}",
|
||||||
|
'CPPFLAGS' => "-I{$lib->getIncludeDir()}",
|
||||||
|
])
|
||||||
|
->configure()
|
||||||
|
->exec('sed -i -e "s/SUBDIRS= include libraries clients servers tests doc/SUBDIRS= include libraries clients servers/g" Makefile')
|
||||||
|
->make();
|
||||||
|
|
||||||
|
FileSystem::replaceFileLineContainsString(
|
||||||
|
$lib->getLibDir() . '/pkgconfig/ldap.pc',
|
||||||
|
'Libs: -L${libdir} -lldap',
|
||||||
|
'Libs: -L${libdir} -lldap -llber'
|
||||||
|
);
|
||||||
|
$lib->patchPkgconfPrefix(['ldap.pc', 'lber.pc']);
|
||||||
|
$lib->patchLaDependencyPrefix();
|
||||||
|
}
|
||||||
|
}
|
||||||
24
src/Package/Library/libsodium.php
Normal file
24
src/Package/Library/libsodium.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Library;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Package\LibraryPackage;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
|
||||||
|
#[Library('libsodium')]
|
||||||
|
class libsodium
|
||||||
|
{
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
public function build(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
UnixAutoconfExecutor::create($lib)->configure()->make();
|
||||||
|
|
||||||
|
// Patch pkg-config file
|
||||||
|
$lib->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX);
|
||||||
|
}
|
||||||
|
}
|
||||||
25
src/Package/Library/libunistring.php
Normal file
25
src/Package/Library/libunistring.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Library;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Package\LibraryPackage;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
|
||||||
|
#[Library('libunistring')]
|
||||||
|
class libunistring
|
||||||
|
{
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
public function build(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
UnixAutoconfExecutor::create($lib)
|
||||||
|
->configure('--disable-nls')
|
||||||
|
->make();
|
||||||
|
|
||||||
|
$lib->patchLaDependencyPrefix();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user