mkiol / GNotifier

Thunderbird add-on that replaces built-in notifications with the OS native notifications
https://addons.mozilla.org/thunderbird/addon/gnotifier/
GNU General Public License v3.0
164 stars 25 forks source link

Can't find libnotify.so.4 on NixOS #89

Closed meteficha closed 7 years ago

meteficha commented 8 years ago

For example, my libnotify.so.4 is currently at /nix/store/2ankjgnfbwjwkxlwrkc9d28ys46aqfaa-libnotify-0.7.6/lib/libnotify.so.4. I did a hack and linked it to /usr/local/lib/libnotify.so.4, but it's a really bad hack as the link will break in the future.

I'm not sure if there's anything that can be done here, though. Perhaps the only solution is adding a GNotifier package to NixOS (?).

mkiol commented 8 years ago

Thanks for the report.

I'm not familiar with NixOS, but are you sure that there is no any other - more standard - symlink for libnotify? If not, I don't see any obstacles in adding extra check in /nix/store/2ankjgnfbwjwkxlwrkc9d28ys46aqfaa-libnotify-0.7.6/lib/libnotify.so.4.

Here is function that needs to be changed.

meteficha commented 8 years ago

That hash on the filepath changes every time libnotify or its dependencies change in any way. Hardcoding this path wouldn't solve the problem.

mkiol commented 8 years ago

Right.. I wonder how other apps on NixOS know where libs are located...

ghost commented 8 years ago

Maybe you could hardcode /nix/store/*/lib/libnotify.so.4? Or does NixOS keep different versions of libs?

wedens commented 8 years ago

There is workaround: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/run/current-system/sw/lib thunderbird l'm sure there is more idiomatic way to make libnotify visible.

martijnvermaat commented 8 years ago

I fixed it by overriding the Firefox derivation so that libnotify will be added to LD_LIBRARY_PATH in the Firefox wrapper. This is basically @wedens's fix, but making use of the existing Nix infrastructure.

I'm not sure if it makes sense to include this in Nixpkgs, since it is only needed when using GNotifier.

Another approach could be to package GNotifier for Nix as @meteficha suggests, but that's probably not the best way to go for browser add-ons (as opposed to plugins, which are packaged).

martijnvermaat commented 8 years ago

Oops, meant to include this link: https://github.com/martijnvermaat/dotfiles/commit/faffd5c

martijnvermaat commented 7 years ago

It seems this has since been fixed: NixOS/nixpkgs#18712

At least now for me it works without above mentioned workarounds.