tseli0s/nvdialog

[BUG] libnotify can't be `dlopen()`'ed on Debian-based distributions.

tseli0s opened this issue · 1 comments

NvDialog opens libnotify (For notification support on Linux) using the dlopen call (Basically linking libnotify manually at runtime, here you can learn more). This helped decrease dependencies as one who did not desire notification support could just disable it. However, this means we must manually find the library.

For now, NvDialog hardcodes the expected path at /usr/lib/libnotify.so. However:

  • Debian, Ubuntu and derivatives use a different filesystem look than Arch and Void (Which is where this library used to be developed).
  • Sometimes the .so extension may be followed by the library version (NvDialog does this as well), however the hardcoded path won't be able to detect this.

So, here is my own solution:

  • Detect distribution at run time, and set path accordingly,
  • Use the set path of libnotify to load the library when needed,
  • And have a fallback path ready, in case the original one isn't found

(The issue is mostly fixed, we only have to make the backends use the new path)

Finished, the next release will no longer have this bug.