Shizcow / dmenu-rs

A pixel perfect port of dmenu, rewritten in Rust with extensive plugin support
GNU General Public License v3.0
202 stars 9 forks source link

Check for dependencies in an x-plat way #29

Closed asdf8dfafjk closed 4 years ago

asdf8dfafjk commented 4 years ago

Use pkg-config to check for dependencies presence in a cross-platform and user-configurable way

asdf8dfafjk commented 4 years ago

Honestly I don't know if this 100% the best way, but this is better than the current way where a hardcoded path is tested.

Shizcow commented 4 years ago

I do agree that this is better than the currently implementation, however just looking for x11 will cause problems on Ubuntu (and maybe Debian). Those platforms need x11-dev and a few other weird packages. Maybe checkdeps.sh should be replaced with some autoconf implimentation? That's the most correct way to do this.

asdf8dfafjk commented 4 years ago

So I'm pretty much a beginner in this field- do you think that pkg-config is available for non-dev packages too? (My blind guess would be yes, likely for linking...) . So your point is probably pertinent but i cannot help you unfortunately...

Shizcow commented 4 years ago

Pkg-config is available for all sorts of packages, but the issue will be matching the package names to the header files, which is distro dependent.

I'll do some digging today to hopefully find the pedantically correct way to do this.

asdf8dfafjk commented 4 years ago

FWIW, when I sent my last PR (fuzzy match), I was warned by your program for every dependency I was missing. And I incrementally installed each upon error. Fontconfig xinerama, et al.

Shizcow commented 4 years ago

Here's another thought -- instead of autoconf, just try to compile the headers with $(CC) -c HEADER and check if error occurred. Because cc is used to expand the headers down the road anyway, this should be the easiest to implement.

I'll close this and implement with $(CC) ASAP, but thanks for bringing this to my attention.