-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Find libraries via pkgconfig #4
base: master
Are you sure you want to change the base?
Conversation
Not all distributions have libraries in the standard paths. Using pkgconfig should be more reliable and avoids the need to hardcode paths to the library.
What is the status of this? |
The status is that I could never see implications of using pkgconfig. It would probably work for me but would it still compile on hackage without problems and generate docs? How about on OSs other than Ubuntu? Will people need to edit the cabal file if they do not have pkg-config? In this particular case, hcwiid only works on linux, and most users have pkg-config by default, but it requires glibc, which requires GTK on windows, so I'm not sure it's a good idea in the general case. I'm not complaining, just trying to understand what's best and find a solution that works in most cases if that's possible.) |
Sorry, I'm not familar with all of the portability aspects of pkg-config. IME pkg-config solutions often work better than hardcoded paths. But as I don't really have much experience with this, I will close the PR for now. |
There is not problem with having this open at all. Also, I may take over freenect, and other wrapper libraries, which means I'll have to make a decision about them at some point. Instead of closing it, why don't we try to see how this could be addressed for other projects too, especially how large projects do it, and maybe come up with a better solution for all of them? I can give more details, which may help understand my issues. (EDIT: reworded second paragraph) |
In particular: you say that one can still provide manual paths if pkg-config is not available. How? Does the standard I'm actually happy accepting this patch if we can enclose it in some conditional that makes it possible to use an alternative that works if there is not .pc file and the |
Ok, I will test this out. The reason I closed this PR was that I was going through my "list of open PRs" and closed everything that I no longer cared much about (because a PR that is staying around a long time with no activity might as well be closed). If you feel that this would be a good change though, I'm happy to help! I'll see if I can find out how cabal behaves if pkg-config is not available. |
It looks like cabal really does have a hard requirement on
I can't find any way to avoid this. We can add a flag |
Not all distributions have libraries in the standard paths. Using pkgconfig should be more reliable and avoids the need to hardcode paths to the library.
As an example, this patch makes hcwiid compile on NixOS.