Skip to content

Commit e613ce1

Browse files
committed
chore: wip
1 parent 7fe322e commit e613ce1

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

scripts/build-php.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,24 @@ export build_alias=\${build_alias:-\$(uname -m)-apple-darwin}
16271627
export CONFIG_SHELL=/bin/bash
16281628
export SHELL=/bin/bash
16291629
1630+
# Ensure pkg-config is accessible during configure
1631+
# Preserve system PATH and add any found pkg-config to it
1632+
if [ -z "\${PKG_CONFIG:-}" ]; then
1633+
# Look for pkg-config in Launchpad installation first, then system locations
1634+
for pkg_path in \$HOME/.local/freedesktop.org/*/bin/pkg-config /opt/homebrew/bin/pkg-config /usr/local/bin/pkg-config /usr/bin/pkg-config; do
1635+
if [ -x "\$pkg_path" ]; then
1636+
export PKG_CONFIG="\$pkg_path"
1637+
break
1638+
fi
1639+
done
1640+
fi
1641+
1642+
# Ensure PATH includes directory containing pkg-config
1643+
if [ -n "\${PKG_CONFIG:-}" ]; then
1644+
PKG_CONFIG_DIR=\$(dirname "\$PKG_CONFIG")
1645+
export PATH="\$PKG_CONFIG_DIR:\$PATH"
1646+
fi
1647+
16301648
# Override the iconv errno test function to always return success
16311649
# This completely bypasses the problematic runtime test
16321650
cat > /tmp/iconv_errno_override.c << 'EOF'
@@ -1741,6 +1759,24 @@ export build_alias=\${build_alias:-\$(uname -m)-apple-darwin}
17411759
export CONFIG_SHELL=/bin/bash
17421760
export SHELL=/bin/bash
17431761
1762+
# Ensure pkg-config is accessible during configure
1763+
# Preserve system PATH and add any found pkg-config to it
1764+
if [ -z "\${PKG_CONFIG:-}" ]; then
1765+
# Look for pkg-config in Launchpad installation first, then system locations
1766+
for pkg_path in \$HOME/.local/freedesktop.org/*/bin/pkg-config /opt/homebrew/bin/pkg-config /usr/local/bin/pkg-config /usr/bin/pkg-config; do
1767+
if [ -x "\$pkg_path" ]; then
1768+
export PKG_CONFIG="\$pkg_path"
1769+
break
1770+
fi
1771+
done
1772+
fi
1773+
1774+
# Ensure PATH includes directory containing pkg-config
1775+
if [ -n "\${PKG_CONFIG:-}" ]; then
1776+
PKG_CONFIG_DIR=\$(dirname "\$PKG_CONFIG")
1777+
export PATH="\$PKG_CONFIG_DIR:\$PATH"
1778+
fi
1779+
17441780
# Override the iconv errno test function to always return success
17451781
# This completely bypasses the problematic runtime test
17461782
cat > /tmp/iconv_errno_override.c << 'EOF'

0 commit comments

Comments
 (0)