Homebrew packages in PKG_CONFIG_PATH












7















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.










share|improve this question



























    7















    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.










    share|improve this question

























      7












      7








      7


      2






      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 24 '13 at 20:14









      adrusiadrusi

      1412




      1412






















          2 Answers
          2






          active

          oldest

          votes


















          5














          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





          share|improve this answer
























          • This is both beautiful and useful! Tyvm!

            – VladFr
            Jan 25 at 14:42



















          0














          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






          share|improve this answer
























          • 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











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          5














          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





          share|improve this answer
























          • This is both beautiful and useful! Tyvm!

            – VladFr
            Jan 25 at 14:42
















          5














          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





          share|improve this answer
























          • This is both beautiful and useful! Tyvm!

            – VladFr
            Jan 25 at 14:42














          5












          5








          5







          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





          share|improve this answer













          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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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













          0














          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






          share|improve this answer
























          • 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
















          0














          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






          share|improve this answer
























          • 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














          0












          0








          0







          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






          share|improve this answer













          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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



















          • 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          How do I know what Microsoft account the skydrive app is syncing to?

          When does type information flow backwards in C++?

          Grease: Live!