Add ext-curl

This commit is contained in:
crazywhalecc 2026-03-07 21:20:34 +08:00
parent 07fd1bcd03
commit 0548aba248
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 15 additions and 0 deletions

View File

@ -11,6 +11,15 @@ ext-calendar:
type: php-extension
ext-ctype:
type: php-extension
ext-curl:
type: php-extension
depends:
- curl
depends@windows:
- ext-zlib
- ext-openssl
php-extension:
arg-type: with
ext-mbregex:
type: php-extension
depends:

View File

@ -55,6 +55,12 @@ class curl
// patch pkgconf
$lib->patchPkgconfPrefix(['libcurl.pc']);
// curl's CMake embeds krb5 link flags directly without following Requires.private chain,
// so -lkrb5support (from mit-krb5.pc Libs.private) is missing from libcurl.pc.
$pc_path = "{$lib->getLibDir()}/pkgconfig/libcurl.pc";
if (str_contains(FileSystem::readFile($pc_path), '-lgssapi_krb5')) {
FileSystem::replaceFileRegex($pc_path, '/-lcom_err$/m', '-lcom_err -lkrb5support');
}
shell()->cd("{$lib->getLibDir()}/cmake/CURL/")
->exec("sed -ie 's|\"/lib/libcurl.a\"|\"{$lib->getLibDir()}/libcurl.a\"|g' CURLTargets-release.cmake");
}