Created
August 25, 2021 10:23
-
-
Save VincentSit/a5ac735ca3d072b739c5ec5158900337 to your computer and use it in GitHub Desktop.
Generate PKG_CONFIG_PATH from HomeBrew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for package in $(brew list) | |
do | |
# path=$(brew --cellar $package) | |
path="/usr/local/Cellar/$package" | |
# only the first match. | |
pkgdir=$(find $path -mindepth 1 -type d -name "pkgconfig" -print -quit 2> /dev/null) | |
if [[ "$pkgdir" && -d "$pkgdir" ]] | |
then | |
PKG_CONFIG_PATH="$pkgdir:$PKG_CONFIG_PATH" | |
fi | |
done | |
echo $PKG_CONFIG_PATH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment