Homebrew packages in PKG_CONFIG_PATH
I have a bunch of libraries installed with homebrew but I don't know what the right way to get them in pkg-config's search path. Right now I have
export PKG_CONFIG_PATH=$(find /usr/local/Cellar -name 'pkgconfig' -type d | grep lib/pkgconfig | tr 'n' ':' | sed s/.$//)
This works fine, but it does slow down my shell startup time, which now takes about 2 seconds. I'm sure that there's a better way built into homebrew, but I can't find it in the docs.
macos homebrew
add a comment |
I have a bunch of libraries installed with homebrew but I don't know what the right way to get them in pkg-config's search path. Right now I have
export PKG_CONFIG_PATH=$(find /usr/local/Cellar -name 'pkgconfig' -type d | grep lib/pkgconfig | tr 'n' ':' | sed s/.$//)
This works fine, but it does slow down my shell startup time, which now takes about 2 seconds. I'm sure that there's a better way built into homebrew, but I can't find it in the docs.
macos homebrew
add a comment |
I have a bunch of libraries installed with homebrew but I don't know what the right way to get them in pkg-config's search path. Right now I have
export PKG_CONFIG_PATH=$(find /usr/local/Cellar -name 'pkgconfig' -type d | grep lib/pkgconfig | tr 'n' ':' | sed s/.$//)
This works fine, but it does slow down my shell startup time, which now takes about 2 seconds. I'm sure that there's a better way built into homebrew, but I can't find it in the docs.
macos homebrew
I have a bunch of libraries installed with homebrew but I don't know what the right way to get them in pkg-config's search path. Right now I have
export PKG_CONFIG_PATH=$(find /usr/local/Cellar -name 'pkgconfig' -type d | grep lib/pkgconfig | tr 'n' ':' | sed s/.$//)
This works fine, but it does slow down my shell startup time, which now takes about 2 seconds. I'm sure that there's a better way built into homebrew, but I can't find it in the docs.
macos homebrew
macos homebrew
asked Jul 24 '13 at 20:14
adrusiadrusi
1412
1412
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
add a comment |
I had a similar issue in Mac Mojave as /usr/include
is gone under Xcode 10, and you have to install a separate package to get it back.
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
source: https://github.com/r-lib/xml2/issues/232
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f623807%2fhomebrew-packages-in-pkg-config-path%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
add a comment |
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
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
add a comment |
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
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
answered Dec 15 '17 at 2:45
l --marc ll --marc l
251147
251147
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
add a comment |
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
This is both beautiful and useful! Tyvm!
– VladFr
Jan 25 at 14:42
add a comment |
I had a similar issue in Mac Mojave as /usr/include
is gone under Xcode 10, and you have to install a separate package to get it back.
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
source: https://github.com/r-lib/xml2/issues/232
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
add a comment |
I had a similar issue in Mac Mojave as /usr/include
is gone under Xcode 10, and you have to install a separate package to get it back.
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
source: https://github.com/r-lib/xml2/issues/232
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
add a comment |
I had a similar issue in Mac Mojave as /usr/include
is gone under Xcode 10, and you have to install a separate package to get it back.
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
source: https://github.com/r-lib/xml2/issues/232
I had a similar issue in Mac Mojave as /usr/include
is gone under Xcode 10, and you have to install a separate package to get it back.
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
source: https://github.com/r-lib/xml2/issues/232
answered Feb 12 at 19:11
Camrin BraunCamrin Braun
1
1
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
add a comment |
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
It's not clear to me how this answers the question. If you believe that it does answer the question, please explain how it does so. … … … … … … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete.
– Scott
Feb 12 at 19:58
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f623807%2fhomebrew-packages-in-pkg-config-path%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown