HipChat (or rather its copy of Qt) expects to find keyboard data in /usr/share/X11/xkb. So use a LD_PRELOAD library to intercept and rewrite the Glibc calls that access those paths. We've been doing the same thing with packages like Spotify, but now this functionality has been abstracted into a reusable library, libredirect.so. It uses an environment variable $NIX_REDIRECTS containing a colon-separated list of path prefixes to be rewritten, e.g. "/foo=bar:/xyzzy=/fnord".
15 lines
297 B
Nix
15 lines
297 B
Nix
{ stdenv }:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "libredirect-0";
|
|
|
|
unpackPhase = "cp ${./libredirect.c} libredirect.c";
|
|
|
|
buildPhase =
|
|
''
|
|
gcc -Wall -std=c99 -O3 -shared libredirect.c -o libredirect.so -fPIC -ldl
|
|
'';
|
|
|
|
installPhase = "mkdir -p $out/lib; cp libredirect.so $out/lib";
|
|
}
|