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
1 change: 1 addition & 0 deletions config/pkg/target/curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ curl:
- zlib
depends@windows:
- zlib
- openssl
- libssh2
- nghttp2
- brotli
Expand Down
10 changes: 10 additions & 0 deletions src/Package/Extension/clickhouse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,15 @@ public function patchBeforeBuildconf(): void
''
);
}

// upstream checks libssl with PHP_CHECK_LIBRARY(ssl, SSL_CTX_new) without naming the
// libraries libssl.a itself depends on, so the conftest fails with undefined libcrypto
// symbols for static builds: configure aborts with "requires libssl, which was not found".
// Preload libcrypto/libz into LIBS for that check (it is guarded by --enable-clickhouse-openssl).
FileSystem::replaceFileStr(
$this->getBuildDir() . '/config.m4',
' PHP_CHECK_LIBRARY(ssl, SSL_CTX_new, [',
' LIBS="$LIBS -lcrypto -lz"' . "\n" . ' PHP_CHECK_LIBRARY(ssl, SSL_CTX_new, ['
);
}
}
6 changes: 3 additions & 3 deletions src/Package/Extension/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
class curl
{
#[BeforeStage('php', [php::class, 'makeForWindows'], 'ext-curl')]
#[PatchDescription('Inject secur32.lib into SPC_EXTRA_LIBS for Schannel SSL support')]
#[PatchDescription('Inject secur32.lib into SPC_EXTRA_LIBS for Windows SSPI support')]
public function addSecur32LibForWindows(): void
{
// curl on Windows uses Schannel (USE_WINDOWS_SSPI=ON, CURL_USE_SCHANNEL=ON),
// which requires secur32.lib for SSL/TLS functions (SslEncryptPackage, etc.).
// libcurl on Windows is built with CURL_WINDOWS_SSPI=ON (NTLM/SPNEGO/SMB), which
// requires secur32.lib for the SSPI functions.
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if (!str_contains($extra_libs, 'secur32.lib')) {
putenv('SPC_EXTRA_LIBS=' . trim("{$extra_libs} secur32.lib"));
Expand Down
11 changes: 8 additions & 3 deletions src/Package/Target/curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ public function buildWin(LibraryPackage $lib): void
'-DENABLE_CURL_MANUAL=OFF',
'-DUSE_LIBIDN2=OFF',
'-DCURL_USE_LIBPSL=OFF',
'-DUSE_WINDOWS_SSPI=ON',
'-DCURL_USE_SCHANNEL=ON',
'-DCURL_USE_OPENSSL=OFF',
'-DCURL_ENABLE_SSL=ON',
'-DUSE_NGHTTP2=ON',
'-DSHARE_LIB_OBJECT=OFF',
'-DCURL_USE_LIBSSH2=ON',
'-DENABLE_IPV6=ON',
'-DCURL_WINDOWS_SSPI=ON',
'-DCURL_USE_SCHANNEL=OFF',
'-DCURL_USE_OPENSSL=ON',
'-DCURL_CA_NATIVE=ON',
'-DCURL_CA_BUNDLE=none',
'-DCURL_CA_PATH=none',
'-DOPENSSL_ROOT_DIR=' . escapeshellarg(str_replace('\\', '/', BUILD_ROOT_PATH)),
'-DOPENSSL_USE_STATIC_LIBS=ON',
)
->build();
// move libcurl.lib to libcurl_a.lib
Expand Down
Loading