From 4fdddfef31381972c9bc260195dad96d85e9d302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jourde?= Date: Sun, 2 Jun 2019 18:04:09 +0200 Subject: [PATCH] set LIBGL_DRIVERS_PATH in wrapper script --- default.nix | 6 +++--- opengl.nix | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index 111cd8b..21c81a4 100644 --- a/default.nix +++ b/default.nix @@ -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 @@ -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 ''; }; diff --git a/opengl.nix b/opengl.nix index 17ea40e..151e3a7 100644 --- a/opengl.nix +++ b/opengl.nix @@ -1,4 +1,8 @@ { + LIBGL_DRIVERS_PATH = [ + "/usr/lib/x86_64-linux-gnu/dri" + ]; + libdirs = [ "/usr/lib/x86_64-linux-gnu" ];