Open pbogdan opened 7 years ago
Does this still work for you? I'm running into the same problem, but xorg.libXcursor is installed.
I can workaround the problem by adding the libXcursor path to LD_LIBRARY_PATH, but that seems like a horrible hack.
I changed my configuration quite a bit since reporting but as is I'm using the same LD_LIBRARY_PATH
hack on NixOS 17.03, but specified in global configuration.nix
. I can only suspect I had something similar previously and failed to mention that in the initial report. Apologies for that.
@hhomar also, forgot to ask - have you seen this issue in applications other than urxvt? It doesn't seem like a wide spread problem so perhaps it would make sense to fix the individual applications on case by case basis.
lightdm doesn't work without the hack either. I haven't seen the problem in any other applications so far.
I was hoping to find a way to fix all applications, but the only thing I could come up is:
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index c7a4ff20a7..132f3ce720 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -85,6 +85,9 @@ in
preConfigure = setMalloc0ReturnsNullCrossCompiling + ''
sed 's,^as_dummy.*,as_dummy="\$PATH",' -i configure
'';
+ postPatch = ''
+ substituteInPlace src/CrGlCur.c --replace "libXcursor.so.1" "/run/current-system/sw/lib/libXcursor.so.1"
+ '';
postInstall =
''
# Remove useless DocBook XML files.
The problem with that is it requires libXcursor to be a system package and for the user to know to do that. It doesn't seem any better than using using LD_LIBRARY_PATH.
AFAICT, this issue is not resolved. See https://dnr.im/tech/broken-cursors/
cc @dnr
Thanks for linking to my post.
The post describes a series of hideous hacks to fix the problem for me, and is limited to solutions that don't require me to rebuild the world. They're clearly not appropriate for Nixpkgs, but it's not obvious how to fix it in Nixpkgs because of the circular dependency.
I think my best proposal would be:
libXcursor
in libX11
so that the two .so files appear in the same directory.$ORIGIN
to the rpath of libX11.so
so that when libX11 calls dlopen, it looks in its own directory and finds libXcursor.so
.If people think this has a shot of getting accepted, I can test it out and make a PR. I'm way out of the loop so not sure who to ask about this stuff.
Just for fun I tried that idea of getting both .so files in the same package: turns out libXcursor depends directly on libX11, but it also depends on libXrender which depends on libX11, i.e. a three-package cycle. So it's looking less likely that it can work.
For completeness, a few other references in nixpkgs: https://github.com/NixOS/nixpkgs/blob/434dd13b25bfe1db97a7bb32cf772f3493416bc3/pkgs/applications/networking/instant-messengers/ripcord/default.nix#L53 https://github.com/NixOS/nixpkgs/blob/434dd13b25bfe1db97a7bb32cf772f3493416bc3/pkgs/development/libraries/qt-5/modules/qtbase.nix#L218 (used here: https://github.com/NixOS/nixpkgs/blob/434dd13b25bfe1db97a7bb32cf772f3493416bc3/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0007-qtbase-xcursor.patch#L19)
One idea I had would be to build the packages each on their own (as is done currently) but then copy them together into a single "libX11" and adjust their rpaths via patchelf.
I tried to do it in a single derivation, but yeah, multiple derivations may be easier. Would that work with the xrender cycle, though? You'd have the following dependencies:
But you couldn't get libxrender to depend on libx11+xcursor.
Issue description
I've ran into a strange situation where certain applications wouldn't respect my mouse cursor settings. An example of that is rxvt_unicode. Stracing urxvt shown the process trying to load libXcursor library which seemed relevant, despite urxvt itself not being linked against it. Some further digging shown that libX11, on which urxvt depends, seems to try loading it dynamically at runtime, and once I installed xorg.libXcursor the issue went away. Is the requirement of manual installation of libXcursor the expected behaviour?
Steps to reproduce
urxvt
from the same shell session.Technical details