Skip to content

Commit 6cf4c40

Browse files
committed
Merge remote-tracking branch 'origin/main' into henderkes-patch-1
2 parents af75ffa + ae0217b commit 6cf4c40

File tree

7 files changed

+51
-10
lines changed

7 files changed

+51
-10
lines changed

config/env.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable-
146146
SPC_CMD_VAR_PHP_EMBED_TYPE="static"
147147
; EXTRA_CFLAGS for `configure` and `make` php
148148
SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}"
149+
; minimum compatible macOS version (LLVM vars, availability not guaranteed)
150+
MACOSX_DEPLOYMENT_TARGET=12.0
149151

150152
[freebsd]
151153
; compiler environments

config/ext.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,14 @@
127127
"sockets"
128128
]
129129
},
130+
"excimer": {
131+
"support": {
132+
"Windows": "wip",
133+
"BSD": "wip"
134+
},
135+
"type": "external",
136+
"source": "ext-excimer"
137+
},
130138
"exif": {
131139
"type": "builtin"
132140
},

config/source.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,23 @@
126126
},
127127
"ext-event": {
128128
"type": "url",
129-
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.0.8.tar.gz",
129+
"url": "https://bitbucket.org/osmanov/pecl-event/get/3.1.4.tar.gz",
130130
"path": "php-src/ext/event",
131131
"license": {
132132
"type": "file",
133133
"path": "LICENSE"
134134
}
135135
},
136+
"ext-excimer": {
137+
"type": "url",
138+
"url": "https://pecl.php.net/get/excimer",
139+
"path": "php-src/ext/excimer",
140+
"filename": "excimer.tgz",
141+
"license": {
142+
"type": "file",
143+
"path": "LICENSE"
144+
}
145+
},
136146
"ext-glfw": {
137147
"type": "git",
138148
"url": "https://github.com/mario-deluna/php-glfw",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SPC\builder\extension;
6+
7+
use SPC\builder\Extension;
8+
use SPC\util\CustomExt;
9+
10+
#[CustomExt('excimer')]
11+
class excimer extends Extension
12+
{
13+
public function getSharedExtensionEnv(): array
14+
{
15+
$env = parent::getSharedExtensionEnv();
16+
$env['LIBS'] = clean_spaces(str_replace('-lphp', '', $env['LIBS']));
17+
return $env;
18+
}
19+
}

src/SPC/builder/traits/UnixSystemUtilTrait.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,8 @@ public static function getDynamicExportedSymbols(string $lib_file): ?string
7272
if (!is_file($symbol_file)) {
7373
throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available.");
7474
}
75-
// https://github.com/ziglang/zig/issues/24662
76-
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
77-
return '-Wl,--export-dynamic';
78-
}
79-
// macOS
80-
if (SPCTarget::getTargetOS() !== 'Linux') {
75+
// macOS/zig
76+
if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) {
8177
return "-Wl,-exported_symbols_list,{$symbol_file}";
8278
}
8379
return "-Wl,--dynamic-list={$symbol_file}";

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ protected function build(): void
3030
'-DCMAKE_BUILD_TYPE=Release ' .
3131
'-DBUILD_SHARED_LIBS=OFF ' .
3232
'-DBUILD_STATIC_LIBS=ON ' .
33-
'-DCURL_STATICLIB=ON ' .
3433
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
3534
'-DBUILD_CURL_EXE=OFF ' . // disable curl.exe
3635
'-DBUILD_TESTING=OFF ' . // disable tests
@@ -42,9 +41,9 @@ protected function build(): void
4241
'-DCURL_USE_OPENSSL=OFF ' . // disable openssl due to certificate issue
4342
'-DCURL_ENABLE_SSL=ON ' .
4443
'-DUSE_NGHTTP2=ON ' . // enable nghttp2
44+
'-DSHARE_LIB_OBJECT=OFF ' . // disable shared lib object
4545
'-DCURL_USE_LIBSSH2=ON ' . // enable libssh2
4646
'-DENABLE_IPV6=ON ' . // enable ipv6
47-
'-DNGHTTP2_CFLAGS="/DNGHTTP2_STATICLIB" ' .
4847
$alt
4948
)
5049
->execWithWrapper(
@@ -53,5 +52,7 @@ protected function build(): void
5352
);
5453
// move libcurl.lib to libcurl_a.lib
5554
rename(BUILD_LIB_PATH . '\libcurl.lib', BUILD_LIB_PATH . '\libcurl_a.lib');
55+
56+
FileSystem::replaceFileStr(BUILD_INCLUDE_PATH . '\curl\curl.h', '#ifdef CURL_STATICLIB', '#if 1');
5657
}
5758
}

src/SPC/builder/windows/library/nghttp2.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ protected function build(): void
2929
'-DBUILD_SHARED_LIBS=OFF ' .
3030
'-DENABLE_STATIC_CRT=ON ' .
3131
'-DENABLE_LIB_ONLY=ON ' .
32-
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' '
32+
'-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' .
33+
'-DENABLE_STATIC_CRT=ON ' .
34+
'-DENABLE_DOC=OFF ' .
35+
'-DBUILD_TESTING=OFF '
3336
)
3437
->execWithWrapper(
3538
$this->builder->makeSimpleWrapper('cmake'),
3639
"--build build --config Release --target install -j{$this->builder->concurrency}"
3740
);
41+
42+
FileSystem::replaceFileStr(BUILD_INCLUDE_PATH . '\nghttp2\nghttp2.h', '#ifdef NGHTTP2_STATICLIB', '#if 1');
3843
}
3944
}

0 commit comments

Comments
 (0)