Skip to content

Commit 54812fa

Browse files
committed
feat(env): Add script to set PKG_CONFIG_PATH for DB clients
Provide a script to check and set PKG_CONFIG_PATH for libpq and mysql-client on macOS via Homebrew. This helps prevent build errors for database libraries and guides users to install missing dependencies.
1 parent 3676a3d commit 54812fa

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

env.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# This script is primarily intended for macOS users using Homebrew.
4+
# It sets up PKG_CONFIG_PATH for database client libraries.
5+
6+
if ! command -v brew &> /dev/null; then
7+
echo "Error: Homebrew (brew) is not installed." >&2
8+
return 1 2>/dev/null || exit 1
9+
fi
10+
11+
if ! brew list libpq &>/dev/null; then
12+
echo "Error: libpq is not installed. Please run 'make install-deps' to install it." >&2
13+
return 1 2>/dev/null || exit 1
14+
fi
15+
16+
if ! brew list mysql-client &>/dev/null; then
17+
echo "Error: mysql-client is not installed. Please run 'make install-deps' to install it." >&2
18+
return 1 2>/dev/null || exit 1
19+
fi
20+
21+
PREFIX=$(brew --prefix)
22+
export PKG_CONFIG_PATH="${PREFIX}/opt/libpq/lib/pkgconfig:${PREFIX}/opt/mysql-client/lib/pkgconfig"

0 commit comments

Comments
 (0)