Created
November 17, 2020 15:34
-
-
Save mdeboer/32fab11698106d5aee203bda829d6677 to your computer and use it in GitHub Desktop.
Homebrew pkg-config paths
This file contains 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 | |
# | |
# Echoes export statements for all pkgconfig paths of homebrew packages. | |
# You can echo the output directly to a file and source that. | |
# | |
# Usage: | |
# homebrew_pkgconfig.sh > .homebrew_pkgconfig && source ~/.homebrew_pkgconfig | |
# | |
homebrew_paths=$(find /usr/local/opt/*/lib -type d -name "pkgconfig") | |
first=true | |
for path in $homebrew_paths; do | |
if $first; then | |
printf 'export PKG_CONFIG_PATH=%s\n' "$path" | |
first=false | |
continue | |
fi | |
printf 'export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:%s\n' "$path" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment