AltF02 / x11-rs

Rust bindings for X11 libraries
https://docs.rs/x11
MIT License
206 stars 66 forks source link

x11-dl: fallback to pkg-config libdir for loading #46

Closed bennofs closed 8 years ago

bennofs commented 8 years ago

Some source-based distributions do not have libraries in the standard paths such as /usr/lib or /lib and don't make all libraries available though LD_LIBRARY_PATH either (an example is NixOS). Before this patch, x11-dl would not work on these kind of distributions. To fix this, x11-dl now searches the path of the X11 libraries determined at compile time as a last fallback.

This change is backwards compatible, as it still searches the old locations first and only falls back to the compile-time location if no library was found in the default locations. Also, if the library is not available at build time, no fallback will be used, so x11-dl still compiles without having all those libraries available at build-time.

bennofs commented 8 years ago

Hey @Daggerbot, you merged my other PR but there were no comments on this one. Any opinion on this?

(Sorry if you just had no time for it right now, that is ok, I just wanted to ping you in case you simply forgot about it :))

ghost commented 8 years ago

Merged and published! Sorry about the long delay. That was one part being busy with work and one part procrastination :/