Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 90 additions & 86 deletions composer.lock

Large diffs are not rendered by default.

71 changes: 51 additions & 20 deletions config/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@
"ngtcp2",
"zstd",
"libcares",
"ldap"
"ldap",
"idn2",
"krb5"
],
"lib-suggests-windows": [
"brotli",
Expand Down Expand Up @@ -234,6 +236,24 @@
"unicode"
]
},
"idn2": {
"source": "libidn2",
"pkg-configs": [
"libidn2"
],
"headers": [
"idn2.h"
],
"lib-suggests-unix": [
"libiconv",
"gettext",
"libunistring"
],
"lib-depends-macos": [
"libiconv",
"gettext"
]
},
"imagemagick": {
"source": "imagemagick",
"cpp-library": true,
Expand Down Expand Up @@ -281,6 +301,26 @@
"jbig_ar.h"
]
},
"krb5": {
"source": "krb5",
"pkg-configs": [
"krb5-gssapi"
],
"headers": [
"krb5.h",
"gssapi/gssapi.h"
],
"lib-depends": [
"openssl"
],
"lib-suggests": [
"ldap",
"libedit"
],
"frameworks": [
"Kerberos"
]
},
"ldap": {
"source": "ldap",
"pkg-configs": [
Expand Down Expand Up @@ -568,6 +608,16 @@
"zstd"
]
},
"libunistring": {
"source": "libunistring",
"static-libs-unix": [
"libunistring.a"
],
"headers": [
"unistr.h",
"unistring/"
]
},
"liburing": {
"source": "liburing",
"pkg-configs": [
Expand Down Expand Up @@ -974,24 +1024,5 @@
"zstd.h",
"zstd_errors.h"
]
},
"liburing": {
"source": "liburing",
"pkg-configs": [
"liburing",
"liburing-ffi"
],
"static-libs-linux": [
"liburing.a",
"liburing-ffi.a"
],
"headers-linux": [
"liburing/",
"liburing.h"
]
},
"frankenphp": {
"source": "frankenphp",
"type": "target"
}
}
41 changes: 30 additions & 11 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
"type": "ghtar",
"repo": "php/frankenphp",
"prefer-stable": true,
"provide-pre-built": false,
"license": {
"type": "file",
"path": "LICENSE"
Expand Down Expand Up @@ -373,16 +372,6 @@
"path": "LICENSE"
}
},
"frankenphp": {
"type": "ghtar",
"repo": "php/frankenphp",
"prefer-stable": true,
"provide-pre-build": false,
"license": {
"type": "file",
"path": "LICENSE"
}
},
Comment thread
henderkes marked this conversation as resolved.
"icu-static-win": {
"type": "url",
"url": "https://dl.static-php.dev/static-php-cli/deps/icu-static-windows-x64/icu-static-windows-x64.zip",
Expand Down Expand Up @@ -441,6 +430,16 @@
"path": "COPYING"
}
},
"krb5": {
"type": "ghtagtar",
"repo": "krb5/krb5",
"match": "krb5.+-final",
"prefer-stable": true,
"license": {
"type": "file",
"path": "NOTICE"
}
},
"ldap": {
"type": "filelist",
"url": "https://www.openldap.org/software/download/OpenLDAP/openldap-release/",
Expand Down Expand Up @@ -599,6 +598,15 @@
"path": "source/COPYING"
}
},
"libidn2": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libidn/",
"regex": "/href=\"(?<file>libidn2-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"license": {
"type": "file",
"path": "COPYING.LESSERv3"
}
},
"libjpeg": {
"type": "ghtar",
"repo": "libjpeg-turbo/libjpeg-turbo",
Expand Down Expand Up @@ -700,6 +708,16 @@
"path": "LICENSE.md"
}
},
"libunistring": {
"type": "filelist",
"url": "https://ftp.gnu.org/gnu/libunistring/",
"regex": "/href=\"(?<file>libunistring-(?<version>[^\"]+)\\.tar\\.gz)\"/",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING.LIB"
}
},
"liburing": {
"type": "ghtar",
"repo": "axboe/liburing",
Expand All @@ -713,6 +731,7 @@
"type": "git",
"url": "https://github.com/static-php/libuuid.git",
"rev": "master",
"provide-pre-built": true,
"license": {
"type": "file",
"path": "COPYING"
Expand Down
12 changes: 12 additions & 0 deletions src/SPC/builder/linux/library/idn2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\linux\library;

class idn2 extends LinuxLibraryBase
{
use \SPC\builder\unix\library\idn2;

public const NAME = 'idn2';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/linux/library/krb5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\linux\library;

class krb5 extends LinuxLibraryBase
{
use \SPC\builder\unix\library\krb5;

public const NAME = 'krb5';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/linux/library/libunistring.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\linux\library;

class libunistring extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libunistring;

public const NAME = 'libunistring';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/macos/library/idn2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\macos\library;

class idn2 extends MacOSLibraryBase
{
use \SPC\builder\unix\library\idn2;

public const NAME = 'idn2';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/macos/library/krb5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\macos\library;

class krb5 extends MacOSLibraryBase
{
use \SPC\builder\unix\library\krb5;

public const NAME = 'krb5';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/macos/library/libunistring.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\macos\library;

class libunistring extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libunistring;

public const NAME = 'libunistring';
}
2 changes: 2 additions & 0 deletions src/SPC/builder/unix/library/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ protected function build(): void
->optionalLib('zstd', ...cmake_boolean_args('CURL_ZSTD'))
->optionalLib('idn2', ...cmake_boolean_args('USE_LIBIDN2'))
->optionalLib('psl', ...cmake_boolean_args('CURL_USE_LIBPSL'))
->optionalLib('krb5', ...cmake_boolean_args('CURL_USE_GSSAPI'))
->optionalLib('idn2', ...cmake_boolean_args('CURL_USE_IDN2'))
->optionalLib('libcares', '-DENABLE_ARES=ON')
->addConfigureArgs(
'-DBUILD_CURL_EXE=OFF',
Expand Down
27 changes: 27 additions & 0 deletions src/SPC/builder/unix/library/idn2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace SPC\builder\unix\library;

use SPC\util\executor\UnixAutoconfExecutor;

trait idn2
{
protected function build(): void
{
UnixAutoconfExecutor::create($this)
->configure(
'--disable-nls',
'--disable-doc',
'--enable-year2038',
'--disable-rpath'
)
->optionalLib('libiconv', "--with-libiconv-prefix={$this->getBuildRootPath()}")
->optionalLib('libunistring', "--with-libunistring-prefix={$this->getBuildRootPath()}")
->optionalLib('gettext', "--with-libnintl-prefix={$this->getBuildRootPath()}")
->make();
$this->patchPkgconfPrefix(['libidn2.pc']);
$this->patchLaDependencyPrefix();
}
}
57 changes: 57 additions & 0 deletions src/SPC/builder/unix/library/krb5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

namespace SPC\builder\unix\library;

use SPC\util\executor\UnixAutoconfExecutor;
use SPC\util\SPCConfigUtil;

trait krb5
{
protected function build(): void
{
$origin_source_dir = $this->source_dir;
$this->source_dir .= '/src';
shell()->cd($this->source_dir)->exec('autoreconf -if');
Comment on lines +15 to +16
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no need to modify the root directory, it is best to pass the subpath directly instead of modifying it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we pass a subpath directly? I tried searching for it, but couldn't find it.

Copy link
Copy Markdown
Owner

@crazywhalecc crazywhalecc Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean shell()->cd("{$this->source_dir}/src")->exec() instead of modifying it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not working for UnixAutoconfExecutor, that's why I changed it.

Copy link
Copy Markdown
Owner

@crazywhalecc crazywhalecc Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes sense. But I think it would be more appropriate to add an arg for executor. I would make changes in 3.0 rather than this PR. I will test later to see if it affects other functions, or we can restore it at the end.

$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
$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 (PHP_OS_FAMILY === 'Darwin') {
$extraEnv['LDFLAGS'] = '-framework Kerberos';
$args[] = 'ac_cv_func_secure_getenv=no';
}
UnixAutoconfExecutor::create($this)
->appendEnv($extraEnv)
->optionalLib('ldap', '--with-ldap', '--without-ldap')
->optionalLib('libedit', '--with-libedit', '--without-libedit')
->configure(...$args)
->make();
$this->patchPkgconfPrefix([
'krb5-gssapi.pc',
'krb5.pc',
'kadm-server.pc',
'kadm-client.pc',
'kdb.pc',
'mit-krb5-gssapi.pc',
'mit-krb5.pc',
'gssrpc.pc',
]);
$this->source_dir = $origin_source_dir;
}
}
18 changes: 18 additions & 0 deletions src/SPC/builder/unix/library/libunistring.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

namespace SPC\builder\unix\library;

use SPC\util\executor\UnixAutoconfExecutor;

trait libunistring
{
protected function build(): void
{
UnixAutoconfExecutor::create($this)
->configure('--disable-nls')
->make();
$this->patchLaDependencyPrefix();
}
}
Loading