{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5576","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5576/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5576/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5576/events","html_url":"https://github.com/matplotlib/matplotlib/issues/5576","id":119235964,"number":5576,"title":"Improper reliance upon pkg-config when C_INCLUDE_PATH is set","user":{"login":"dpryan79","id":6399000,"avatar_url":"https://avatars.githubusercontent.com/u/6399000?v=3","gravatar_id":"","url":"https://api.github.com/users/dpryan79","html_url":"https://github.com/dpryan79","followers_url":"https://api.github.com/users/dpryan79/followers","following_url":"https://api.github.com/users/dpryan79/following{/other_user}","gists_url":"https://api.github.com/users/dpryan79/gists{/gist_id}","starred_url":"https://api.github.com/users/dpryan79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpryan79/subscriptions","organizations_url":"https://api.github.com/users/dpryan79/orgs","repos_url":"https://api.github.com/users/dpryan79/repos","events_url":"https://api.github.com/users/dpryan79/events{/privacy}","received_events_url":"https://api.github.com/users/dpryan79/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800"}],"state":"open","locked":false,"assignee":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-11-27T18:51:57Z","updated_at":"2015-11-27T21:18:42Z","closed_at":null,"body":"In `setupext.py`, matplotlib uses `pkg-config --cflags --libs freetype2` to [determine where `ft2build.h` can be found](https://github.com/matplotlib/matplotlib/blob/master/setupext.py#L922-L924). That works well enough *except* when that path is already set in either the `C_INCLUDE_PATH` or `CPLUS_INCLUDE_PATH` environment variables. If the path is in one of those then pkg-config will not return the appropriate `-I/something` option and compilation will fail (i.e., setupext.py will mark freetype2 as being absent, even though it's not). `pkg-config` is behaving correctly, since gcc/clang/etc. check these environment variables.\r\n\r\nWould it be possible to have `_check_for_pkg_config` also check these environment variables. That would solve some [issues on Galaxy](https://github.com/galaxyproject/tools-iuc/issues/417)."},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/160204286","html_url":"https://github.com/matplotlib/matplotlib/issues/5576#issuecomment-160204286","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/5576","id":160204286,"user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"created_at":"2015-11-27T21:18:42Z","updated_at":"2015-11-27T21:18:42Z","body":"See #5578 for a solution.  I think it makes sense to only look at CPLUS_INCLUDE_PATH, since all of matplotlib's code is C++ (with the exception of the macosx extension), and gcc doesn't seem to look at C_INCLUDE_PATH when in C++ mode (so neither should we)."}}