Skip to content

Commit

Permalink
set LIBGL_DRIVERS_PATH in wrapper script
Browse files Browse the repository at this point in the history
  • Loading branch information
timjrd committed Jun 2, 2019
1 parent 259a71e commit 4fdddfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ non-nixos' = root: pkgs.stdenvNoCC.mkDerivation rec {
'';

# see https://github.com/NixOS/nixpkgs/issues/9415#issuecomment-139655485
rpath = builtins.concatStringsSep ":" (map (x: root+x) opengl.libdirs);
wrapper = ''
wrapper = let mkpath = xs: builtins.concatStringsSep ":" (map (x: root+x) xs); in ''
PATH=${pkgs.patchelf}/bin:${pkgs.coreutils}/bin:$PATH
shim=$HOME/.openspace/shim
rm -rf $shim
Expand All @@ -46,12 +45,13 @@ non-nixos' = root: pkgs.stdenvNoCC.mkDerivation rec {
dst=$shim/$lib
if [[ -e $src ]]; then
cp --dereference --no-preserve=all $src $dst
patchelf --set-rpath ${rpath} $dst
patchelf --set-rpath ${mkpath opengl.libdirs} $dst
break
fi
done
done
export LD_LIBRARY_PATH=$shim:$LD_LIBRARY_PATH
export LIBGL_DRIVERS_PATH=${mkpath opengl.LIBGL_DRIVERS_PATH}:$LIBGL_DRIVERS_PATH
'';
};

Expand Down
4 changes: 4 additions & 0 deletions opengl.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
LIBGL_DRIVERS_PATH = [
"/usr/lib/x86_64-linux-gnu/dri"
];

libdirs = [
"/usr/lib/x86_64-linux-gnu"
];
Expand Down

0 comments on commit 4fdddfe

Please sign in to comment.