mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 01:45:36 +08:00
Add krb5 and lint configs
This commit is contained in:
@@ -8,12 +8,12 @@ gettext:
|
|||||||
metadata:
|
metadata:
|
||||||
license-files: [gettext-runtime/intl/COPYING.LIB]
|
license-files: [gettext-runtime/intl/COPYING.LIB]
|
||||||
license: LGPL-2.1-or-later
|
license: LGPL-2.1-or-later
|
||||||
static-libs@unix:
|
|
||||||
- libintl.a
|
|
||||||
depends:
|
depends:
|
||||||
- libiconv
|
- libiconv
|
||||||
|
frameworks:
|
||||||
|
- CoreFoundation
|
||||||
|
static-libs@unix:
|
||||||
|
- libintl.a
|
||||||
suggests:
|
suggests:
|
||||||
- ncurses
|
- ncurses
|
||||||
- libxml2
|
- libxml2
|
||||||
frameworks:
|
|
||||||
- CoreFoundation
|
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ idn2:
|
|||||||
url: 'https://ftp.gnu.org/gnu/libidn/'
|
url: 'https://ftp.gnu.org/gnu/libidn/'
|
||||||
regex: '/href="(?<file>libidn2-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>libidn2-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
metadata:
|
metadata:
|
||||||
license-files: ['COPYING.LESSERv3']
|
license-files: [COPYING.LESSERv3]
|
||||||
license: LGPL-3.0-or-later
|
license: LGPL-3.0-or-later
|
||||||
pkg-configs:
|
depends@macos:
|
||||||
- libidn2
|
- libiconv
|
||||||
|
- gettext
|
||||||
headers:
|
headers:
|
||||||
- idn2.h
|
- idn2.h
|
||||||
|
pkg-configs:
|
||||||
|
- libidn2
|
||||||
suggests@unix:
|
suggests@unix:
|
||||||
- libiconv
|
- libiconv
|
||||||
- gettext
|
- gettext
|
||||||
- libunistring
|
- libunistring
|
||||||
depends@macos:
|
|
||||||
- libiconv
|
|
||||||
- gettext
|
|
||||||
|
|||||||
23
config/pkg/lib/krb5.yml
Normal file
23
config/pkg/lib/krb5.yml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
krb5:
|
||||||
|
type: library
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: ghtagtar
|
||||||
|
repo: krb5/krb5
|
||||||
|
match: krb5.+-final
|
||||||
|
metadata:
|
||||||
|
license-files: [NOTICE]
|
||||||
|
license: BSD-3-Clause
|
||||||
|
source-root: src
|
||||||
|
depends:
|
||||||
|
- openssl
|
||||||
|
frameworks:
|
||||||
|
- Kerberos
|
||||||
|
headers:
|
||||||
|
- krb5.h
|
||||||
|
- gssapi/gssapi.h
|
||||||
|
pkg-configs:
|
||||||
|
- krb5-gssapi
|
||||||
|
suggests:
|
||||||
|
- ldap
|
||||||
|
- libedit
|
||||||
@@ -7,9 +7,9 @@ libedit:
|
|||||||
regex: '/href="(?<file>libedit-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>libedit-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
binary: hosted
|
binary: hosted
|
||||||
metadata:
|
metadata:
|
||||||
license-files: ['COPYING']
|
license-files: [COPYING]
|
||||||
license: BSD-3-Clause
|
license: BSD-3-Clause
|
||||||
static-libs@unix:
|
|
||||||
- libedit.a
|
|
||||||
depends:
|
depends:
|
||||||
- ncurses
|
- ncurses
|
||||||
|
static-libs@unix:
|
||||||
|
- libedit.a
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ ncurses:
|
|||||||
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
regex: '/href="(?<file>ncurses-(?<version>[^"]+)\.tar\.gz)"/'
|
||||||
binary: hosted
|
binary: hosted
|
||||||
metadata:
|
metadata:
|
||||||
license-files: ['COPYING']
|
license-files: [COPYING]
|
||||||
static-libs@unix:
|
static-libs@unix:
|
||||||
- libncurses.a
|
- libncurses.a
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ zlib:
|
|||||||
match: zlib.+\.tar\.gz
|
match: zlib.+\.tar\.gz
|
||||||
binary: hosted
|
binary: hosted
|
||||||
metadata:
|
metadata:
|
||||||
license-files: ['{registry_root}/src/globals/licenses/zlib.txt']
|
license-files: ['@/zlib.txt']
|
||||||
license: Zlib-Custom
|
license: Zlib-Custom
|
||||||
headers:
|
headers:
|
||||||
- zlib.h
|
- zlib.h
|
||||||
|
|||||||
63
src/Package/Library/krb5.php
Normal file
63
src/Package/Library/krb5.php
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Library;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Package\LibraryPackage;
|
||||||
|
use StaticPHP\Package\PackageInstaller;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixAutoconfExecutor;
|
||||||
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
|
use StaticPHP\Util\SPCConfigUtil;
|
||||||
|
|
||||||
|
#[Library('krb5')]
|
||||||
|
class krb5
|
||||||
|
{
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
public function build(LibraryPackage $lib, PackageInstaller $installer): void
|
||||||
|
{
|
||||||
|
shell()->cd($lib->getSourceRoot())->exec('autoreconf -if');
|
||||||
|
|
||||||
|
$resolved = array_keys($installer->getResolvedPackages());
|
||||||
|
$spc = new SPCConfigUtil(['no_php' => true, 'libs_only_deps' => true]);
|
||||||
|
$config = $spc->getPackageDepsConfig($lib->getName(), $resolved, include_suggests: true);
|
||||||
|
$extraEnv = [
|
||||||
|
'CFLAGS' => '-fcommon',
|
||||||
|
'LIBS' => $config['libs'],
|
||||||
|
];
|
||||||
|
if (getenv('SPC_LD_LIBRARY_PATH') && getenv('SPC_LIBRARY_PATH')) {
|
||||||
|
$extraEnv = [...$extraEnv, ...[
|
||||||
|
'LD_LIBRARY_PATH' => getenv('SPC_LD_LIBRARY_PATH'),
|
||||||
|
'LIBRARY_PATH' => getenv('SPC_LIBRARY_PATH'),
|
||||||
|
]];
|
||||||
|
}
|
||||||
|
$args = [
|
||||||
|
'--disable-nls',
|
||||||
|
'--disable-rpath',
|
||||||
|
'--without-system-verto',
|
||||||
|
];
|
||||||
|
if (SystemTarget::getTargetOS() === 'Darwin') {
|
||||||
|
$extraEnv['LDFLAGS'] = '-framework Kerberos';
|
||||||
|
$args[] = 'ac_cv_func_secure_getenv=no';
|
||||||
|
}
|
||||||
|
UnixAutoconfExecutor::create($lib)
|
||||||
|
->appendEnv($extraEnv)
|
||||||
|
->optionalPackage('ldap', '--with-ldap', '--without-ldap')
|
||||||
|
->optionalPackage('libedit', '--with-libedit', '--without-libedit')
|
||||||
|
->configure(...$args)
|
||||||
|
->make();
|
||||||
|
$lib->patchPkgconfPrefix([
|
||||||
|
'krb5-gssapi.pc',
|
||||||
|
'krb5.pc',
|
||||||
|
'kadm-server.pc',
|
||||||
|
'kadm-client.pc',
|
||||||
|
'kdb.pc',
|
||||||
|
'mit-krb5-gssapi.pc',
|
||||||
|
'mit-krb5.pc',
|
||||||
|
'gssrpc.pc',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user