diff --git a/config/lib.json b/config/lib.json index 079ebc1e..7d1ad213 100644 --- a/config/lib.json +++ b/config/lib.json @@ -1,9 +1,6 @@ { "lib-base": { - "type": "root", - "lib-depends-unix": [ - "pkg-config" - ] + "type": "root" }, "php": { "type": "root", diff --git a/config/pkg.json b/config/pkg.json index 080958b4..00e83595 100644 --- a/config/pkg.json +++ b/config/pkg.json @@ -1,4 +1,16 @@ { + "go-xcaddy-aarch64-linux": { + "type": "custom" + }, + "go-xcaddy-aarch64-macos": { + "type": "custom" + }, + "go-xcaddy-x86_64-linux": { + "type": "custom" + }, + "go-xcaddy-x86_64-macos": { + "type": "custom" + }, "musl-toolchain-aarch64-linux": { "type": "url", "url": "https://dl.static-php.dev/static-php-cli/deps/musl-toolchain/aarch64-musl-toolchain.tgz" @@ -15,6 +27,38 @@ "nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe" } }, + "pkg-config-aarch64-linux": { + "type": "ghrel", + "repo": "static-php/static-php-cli-hosted", + "match": "pkg-config-aarch64-linux-musl-1.2.5.txz", + "extract-files": { + "bin/pkg-config": "{pkg_root_path}/bin/pkg-config" + } + }, + "pkg-config-aarch64-macos": { + "type": "ghrel", + "repo": "static-php/static-php-cli-hosted", + "match": "pkg-config-aarch64-darwin.txz", + "extract-files": { + "bin/pkg-config": "{pkg_root_path}/bin/pkg-config" + } + }, + "pkg-config-x86_64-linux": { + "type": "ghrel", + "repo": "static-php/static-php-cli-hosted", + "match": "pkg-config-x86_64-linux-musl-1.2.5.txz", + "extract-files": { + "bin/pkg-config": "{pkg_root_path}/bin/pkg-config" + } + }, + "pkg-config-x86_64-macos": { + "type": "ghrel", + "repo": "static-php/static-php-cli-hosted", + "match": "pkg-config-x86_64-darwin.txz", + "extract-files": { + "bin/pkg-config": "{pkg_root_path}/bin/pkg-config" + } + }, "strawberry-perl-x86_64-win": { "type": "url", "url": "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_5380_5361/strawberry-perl-5.38.0.1-64bit-portable.zip" @@ -43,30 +87,18 @@ "upx-*-win64/upx.exe": "{pkg_root_path}/bin/upx.exe" } }, - "go-xcaddy-x86_64-linux": { + "zig-aarch64-linux": { "type": "custom" }, - "go-xcaddy-aarch64-linux": { - "type": "custom" - }, - "go-xcaddy-x86_64-macos": { - "type": "custom" - }, - "go-xcaddy-aarch64-macos": { + "zig-aarch64-macos": { "type": "custom" }, "zig-x86_64-linux": { "type": "custom" }, - "zig-aarch64-linux": { - "type": "custom" - }, "zig-x86_64-macos": { "type": "custom" }, - "zig-aarch64-macos": { - "type": "custom" - }, "zig-x86_64-win": { "type": "custom" } diff --git a/src/SPC/builder/freebsd/BSDBuilder.php b/src/SPC/builder/freebsd/BSDBuilder.php index dcaa5a2d..985de5d2 100644 --- a/src/SPC/builder/freebsd/BSDBuilder.php +++ b/src/SPC/builder/freebsd/BSDBuilder.php @@ -25,10 +25,6 @@ class BSDBuilder extends UnixBuilderBase f_putenv('CXX=' . $this->getOption('cxx', 'clang++')); // set PATH f_putenv('PATH=' . BUILD_ROOT_PATH . '/bin:' . getenv('PATH')); - // set PKG_CONFIG - f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config'); - // set PKG_CONFIG_PATH - f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig/'); // set arch (default: current) $this->setOptionIfNotExist('arch', php_uname('m')); diff --git a/src/SPC/doctor/item/PkgConfigCheck.php b/src/SPC/doctor/item/PkgConfigCheck.php new file mode 100644 index 00000000..0936a606 --- /dev/null +++ b/src/SPC/doctor/item/PkgConfigCheck.php @@ -0,0 +1,38 @@ +debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'"); $root = BUILD_ROOT_PATH; + $pkgConfigExecutable = PkgConfigUtil::findPkgConfig(); $ccLine = ''; if ($cc) { $ccLine = 'SET(CMAKE_C_COMPILER ' . $cc . ')'; @@ -202,7 +204,7 @@ SET(CMAKE_PREFIX_PATH "{$root}") SET(CMAKE_INSTALL_PREFIX "{$root}") SET(CMAKE_INSTALL_LIBDIR "lib") -set(PKG_CONFIG_EXECUTABLE "{$root}/bin/pkg-config") +set(PKG_CONFIG_EXECUTABLE "{$pkgConfigExecutable}") list(APPEND PKG_CONFIG_EXECUTABLE "--static") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)