Convert the find
to a static list colon :
separated PKG_CONFIG_PATH list to reduce launch time.
Step 1. Run pkg-config --list-all
to determine what packages are already know by
pkg-config --list-all
# tidy tidy - tidy - HTML syntax checker# tesseract tesseract - An OCR Engine# …
Step 2. Run find
to determine the pkgconfig
directories that contain *.pc files.
# long form `find`
find /usr/local/Cellar-name 'pkgconfig'-type d | grep lib/pkgconfig | tr '\n'':'| sed s/.$//)# short form `find`
find /-name "pkgconfig"-print
# /usr/local/Cellar/abc/0.1.5/lib/pkgconfig:…/usr/local/Cellar/xyz/2.6/lib/pkgconfig
Step 3. Add the paths libraries of interest, that are not already discoverable by pkg-config
, to PKG_CONFIG_PATH.
export PKG_CONFIG_PATH=/usr/local/Cellar/abc/0.1.5/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/Cellar/abc/0.1.5/lib/pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/my/build/from/source/mmmm/0.1.5/lib/pkgconfig