Skip to content

Commit ef95e4f

Browse files
authored
fix centos 7 gd build (crazywhalecc#1132)
2 parents 970343b + fd4f70d commit ef95e4f

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

src/SPC/builder/unix/library/curl.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace SPC\builder\unix\library;
66

7+
use SPC\store\FileSystem;
78
use SPC\util\executor\UnixCMakeExecutor;
89

910
trait curl
@@ -32,8 +33,16 @@ protected function build(): void
3233
)
3334
->build();
3435

35-
// patch pkgconf
3636
$this->patchPkgconfPrefix(['libcurl.pc']);
37+
// On glibc <2.28 without built-in pthreads, FindThreads sets
38+
// INTERFACE_LINK_LIBRARIES to '-lpthread'
39+
// curls .pc generator walks and prepends '-l' to each
40+
// entry, resulting in -l-lpthread
41+
FileSystem::replaceFileRegex(
42+
BUILD_LIB_PATH . '/pkgconfig/libcurl.pc',
43+
'/-l(-l\S+)/',
44+
'$1'
45+
);
3746
shell()->cd(BUILD_LIB_PATH . '/cmake/CURL/')
3847
->exec("sed -ie 's|\"/lib/libcurl.a\"|\"" . BUILD_LIB_PATH . "/libcurl.a\"|g' CURLTargets-release.cmake");
3948
}

src/globals/test-extensions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// test php version (8.1 ~ 8.4 available, multiple for matrix)
1515
$test_php_version = [
1616
// '8.1',
17-
'8.2',
17+
// '8.2',
1818
// '8.3',
1919
// '8.4',
2020
'8.5',
@@ -24,11 +24,11 @@
2424
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
2525
$test_os = [
2626
// 'macos-15-intel', // bin/spc for x86_64
27-
'macos-15', // bin/spc for arm64
27+
// 'macos-15', // bin/spc for arm64
2828
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
29-
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
29+
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
3030
// 'ubuntu-24.04', // bin/spc for x86_64
31-
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
31+
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
3232
// 'ubuntu-24.04-arm', // bin/spc for arm64
3333
// 'windows-2022', // .\bin\spc.ps1
3434
// 'windows-2025',
@@ -50,7 +50,7 @@
5050

5151
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5252
$extensions = match (PHP_OS_FAMILY) {
53-
'Linux', 'Darwin' => 'swoole,mongodb',
53+
'Linux', 'Darwin' => 'curl,gd',
5454
'Windows' => 'bcmath,brotli,bz2,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_pgsql,pgsql,session,simdjson,simplexml,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib',
5555
};
5656

0 commit comments

Comments
 (0)