diff --git a/src/Package/Library/postgresql.php b/src/Package/Library/postgresql.php index 18893d0e..682b79e2 100644 --- a/src/Package/Library/postgresql.php +++ b/src/Package/Library/postgresql.php @@ -119,8 +119,7 @@ class postgresql extends LibraryPackage // remove dynamic libs shell()->cd($this->getSourceDir() . '/build') - ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so.*") - ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so") + ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so*") ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.dylib"); FileSystem::replaceFileStr("{$this->getLibDir()}/pkgconfig/libpq.pc", '-lldap', '-lldap -llber'); diff --git a/src/Package/Target/php/frankenphp.php b/src/Package/Target/php/frankenphp.php index 8b2fb81d..51304d66 100644 --- a/src/Package/Target/php/frankenphp.php +++ b/src/Package/Target/php/frankenphp.php @@ -92,6 +92,7 @@ trait frankenphp '-ldflags \"-linkmode=external ' . $extLdFlags . ' ' . '-X \'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy\' ' . '-X \'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ' . + '-X \'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp ' . "v{$frankenphp_version} PHP {$libphp_version} Caddy'\\\" " . "-tags={$muslTags}nobadger,nomysql,nopgx{$no_brotli}{$no_watcher}", 'LD_LIBRARY_PATH' => BUILD_LIB_PATH, diff --git a/src/StaticPHP/Runtime/Executor/UnixAutoconfExecutor.php b/src/StaticPHP/Runtime/Executor/UnixAutoconfExecutor.php index 41bc6e78..c59859cf 100644 --- a/src/StaticPHP/Runtime/Executor/UnixAutoconfExecutor.php +++ b/src/StaticPHP/Runtime/Executor/UnixAutoconfExecutor.php @@ -20,8 +20,6 @@ class UnixAutoconfExecutor extends Executor protected array $configure_args = []; - protected array $ignore_args = []; - protected PackageInstaller $installer; public function __construct(protected LibraryPackage $package, ?PackageInstaller $installer = null) @@ -40,6 +38,8 @@ class UnixAutoconfExecutor extends Executor if (!$this->package->hasStage('build')) { throw new SPCInternalException("Package {$this->package->getName()} does not have a build stage defined."); } + + $this->configure_args = $this->getDefaultConfigureArgs(); } /** @@ -48,18 +48,12 @@ class UnixAutoconfExecutor extends Executor public function configure(...$args): static { // remove all the ignored args - $args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args); - $args = array_diff($args, $this->ignore_args); + $args = array_merge($args, $this->configure_args); $configure_args = implode(' ', $args); InteractiveTerm::setMessage('Building package: ' . ConsoleColor::yellow($this->package->getName()) . ' (./configure)'); return $this->seekLogFileOnException(fn () => $this->shell->exec("./configure {$configure_args}")); } - public function getConfigureArgsString(): string - { - return implode(' ', array_merge($this->getDefaultConfigureArgs(), $this->configure_args)); - } - /** * Run make * @@ -134,7 +128,7 @@ class UnixAutoconfExecutor extends Executor */ public function removeConfigureArgs(...$args): static { - $this->ignore_args = [...$this->ignore_args, ...$args]; + $this->configure_args = array_diff($this->configure_args, $args); return $this; } diff --git a/src/StaticPHP/Util/System/UnixUtil.php b/src/StaticPHP/Util/System/UnixUtil.php index 7d7ddfe2..4a41c524 100644 --- a/src/StaticPHP/Util/System/UnixUtil.php +++ b/src/StaticPHP/Util/System/UnixUtil.php @@ -74,7 +74,11 @@ abstract class UnixUtil throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available."); } // https://github.com/ziglang/zig/issues/24662 - if (SystemTarget::getTargetOS() !== 'Linux' || ApplicationContext::get(ToolchainInterface::class) instanceof ZigToolchain) { + $toolchain = ApplicationContext::get(ToolchainInterface::class); + if ($toolchain instanceof ZigToolchain) { + return '-Wl,--export-dynamic'; // needs release 0.16, can be removed then + } + if (SystemTarget::getTargetOS() !== 'Linux') { return "-Wl,-exported_symbols_list,{$symbol_file}"; } return "-Wl,--dynamic-list={$symbol_file}";