From f5fa49338d8db2bcf7c25d493ee207c840bfdab5 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Fri, 6 Jun 2025 14:49:09 +0700 Subject: [PATCH] macos is stupid now? --- src/SPC/builder/unix/library/ngtcp2.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/SPC/builder/unix/library/ngtcp2.php b/src/SPC/builder/unix/library/ngtcp2.php index 20620499..bb13dd42 100644 --- a/src/SPC/builder/unix/library/ngtcp2.php +++ b/src/SPC/builder/unix/library/ngtcp2.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace SPC\builder\unix\library; +use SPC\builder\linux\LinuxBuilder; +use SPC\builder\macos\MacOSBuilder; use SPC\exception\FileSystemException; use SPC\exception\RuntimeException; use SPC\exception\WrongUsageException; @@ -17,13 +19,21 @@ trait ngtcp2 */ protected function build(): void { - $args = $this->builder->makeAutoconfArgs(static::NAME, [ - 'zlib' => null, + $available = [ 'openssl' => null, - 'libxml2' => null, 'libev' => null, 'jemalloc' => null, - ]); + ]; + if ($this->builder instanceof LinuxBuilder) { + $available = [...$available, ...[ + 'zlib' => null, + 'libxml2' => null, + ]]; + } + $args = $this->builder->makeAutoconfArgs(static::NAME, $available); + if ($this->builder instanceof MacOSBuilder) { + $args = str_replace('=yes', '=' . BUILD_ROOT_PATH, $args); + } shell()->cd($this->source_dir) ->setEnv([