diff --git a/config/pkg/tool/pkg-config.yml b/config/pkg/tool/pkg-config.yml new file mode 100644 index 00000000..4c93c2f5 --- /dev/null +++ b/config/pkg/tool/pkg-config.yml @@ -0,0 +1,13 @@ +pkg-config: + type: tool + artifact: + source: 'https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz' + binary: + linux-x86_64: { type: ghrel, repo: static-php/hosted, match: pkg-config-x86_64-linux-musl-1.2.5.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } } + linux-aarch64: { type: ghrel, repo: static-php/hosted, match: pkg-config-aarch64-linux-musl-1.2.5.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } } + macos-x86_64: { type: ghrel, repo: static-php/hosted, match: pkg-config-x86_64-darwin.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } } + macos-aarch64: { type: ghrel, repo: static-php/hosted, match: pkg-config-aarch64-darwin.txz, extract: { bin/pkg-config: '{pkg_root_path}/bin/pkg-config' } } + tool: + provides: + - pkg-config + binary-subdir: bin diff --git a/src/Package/Tool/pkgconfig.php b/src/Package/Tool/pkgconfig.php new file mode 100644 index 00000000..1cf84ef2 --- /dev/null +++ b/src/Package/Tool/pkgconfig.php @@ -0,0 +1,45 @@ +appendEnv([ + 'CFLAGS' => '-Wimplicit-function-declaration -Wno-int-conversion', + 'LDFLAGS' => $toolchain->isStatic() ? '--static' : '', + ]) + ->configure( + '--with-internal-glib', + '--disable-host-tool', + '--without-sysroot', + '--without-system-include-path', + '--without-system-library-path', + '--without-pc-path', + ) + ->make(with_install: 'install-exec'); + + shell()->exec("strip {$package->getBinDir()}/pkg-config"); + } +}