Merge pull request #249158 from Kiskae/nvidia-settings/fix-path

linuxPackages.nvidia_x11.settings: fix runpath
This commit is contained in:
Nick Cao 2023-08-14 18:43:48 -06:00 committed by GitHub
commit 467e4c2e93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 6 deletions

View file

@ -64,6 +64,7 @@ installPhase() {
for i in $lib32 $out; do for i in $lib32 $out; do
rm -f $i/lib/lib{glx,nvidia-wfb}.so.* # handled separately rm -f $i/lib/lib{glx,nvidia-wfb}.so.* # handled separately
rm -f $i/lib/libnvidia-gtk* # built from source rm -f $i/lib/libnvidia-gtk* # built from source
rm -f $i/lib/libnvidia-wayland-client* # built from source
if [ "$useGLVND" = "1" ]; then if [ "$useGLVND" = "1" ]; then
# Pre-built libglvnd # Pre-built libglvnd
rm $i/lib/lib{GL,GLX,EGL,GLESv1_CM,GLESv2,OpenGL,GLdispatch}.so.* rm $i/lib/lib{GL,GLX,EGL,GLESv1_CM,GLESv2,OpenGL,GLdispatch}.so.*

View file

@ -1,9 +1,25 @@
nvidia_x11: sha256: nvidia_x11: sha256:
{ stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, m4, jansson, gtk2, dbus, gtk3 { stdenv
, libXv, libXrandr, libXext, libXxf86vm, libvdpau , lib
, librsvg, wrapGAppsHook , fetchFromGitHub
, withGtk2 ? false, withGtk3 ? true , fetchpatch
, pkg-config
, m4
, jansson
, gtk2
, dbus
, gtk3
, libXv
, libXrandr
, libXext
, libXxf86vm
, libvdpau
, librsvg
, wrapGAppsHook
, addOpenGLRunpath
, withGtk2 ? false
, withGtk3 ? true
}: }:
let let
@ -75,10 +91,10 @@ stdenv.mkDerivation {
fi fi
''; '';
nativeBuildInputs = [ pkg-config m4 ]; nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ];
buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ] buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ]
++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook ]; ++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook ];
installFlags = [ "PREFIX=$(out)" ]; installFlags = [ "PREFIX=$(out)" ];
@ -106,6 +122,8 @@ stdenv.mkDerivation {
postFixup = '' postFixup = ''
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/$binaryName):$out/lib:${libXv}/lib" \ patchelf --set-rpath "$(patchelf --print-rpath $out/bin/$binaryName):$out/lib:${libXv}/lib" \
$out/bin/$binaryName $out/bin/$binaryName
addOpenGLRunpath $out/bin/$binaryName
''; '';
passthru = { passthru = {