Merge pull request #317187 from SuperSandro2000/nvidia-settings-misc

nvidia-x11: minor cleanups, don't require gtk2 input when it is disabled
This commit is contained in:
Sandro 2024-06-07 12:51:02 +02:00 committed by GitHub
commit f9895b9567
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,6 +30,14 @@ let
inherit sha256;
};
meta = with lib; {
homepage = "https://www.nvidia.com/object/unix.html";
license = licenses.unfreeRedistributable;
platforms = nvidia_x11.meta.platforms;
mainProgram = "nvidia-settings";
maintainers = with maintainers; [ abbradar aidalgol ];
};
libXNVCtrl = stdenv.mkDerivation {
pname = "libXNVCtrl";
version = nvidia_x11.settingsVersion;
@ -62,6 +70,10 @@ let
cp NVCtrlLib.h $out/include/NVCtrl
cp -P libXNVCtrl.so* $out/lib
'';
meta = meta // {
description = "NVIDIA NV-CONTROL X extension";
};
};
in
@ -102,21 +114,20 @@ stdenv.mkDerivation {
fi
'';
nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ];
nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ]
++ lib.optionals withGtk3 [ wrapGAppsHook3 ];
buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 gtk2 dbus ]
++ lib.optionals withGtk3 [ gtk3 librsvg wrapGAppsHook3 ];
buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 dbus ]
++ lib.optionals (withGtk2 || lib.versionOlder nvidia_x11.settingsVersion "525.53") [ gtk2 ]
++ lib.optionals withGtk3 [ gtk3 librsvg ];
installFlags = [ "PREFIX=$(out)" ];
postInstall = ''
${lib.optionalString (!withGtk2) ''
rm -f $out/lib/libnvidia-gtk2.so.*
''}
${lib.optionalString (!withGtk3) ''
rm -f $out/lib/libnvidia-gtk3.so.*
''}
postInstall = lib.optionalString (!withGtk2) ''
rm -f $out/lib/libnvidia-gtk2.so.*
'' + lib.optionalString (!withGtk3) ''
rm -f $out/lib/libnvidia-gtk3.so.*
'' + ''
# Install the desktop file and icon.
# The template has substitution variables intended to be replaced resulting
# in absolute paths. Because absolute paths break after the desktop file is
@ -141,12 +152,7 @@ stdenv.mkDerivation {
inherit libXNVCtrl;
};
meta = with lib; {
homepage = "https://www.nvidia.com/object/unix.html";
meta = meta // {
description = "Settings application for NVIDIA graphics cards";
license = licenses.unfreeRedistributable;
platforms = nvidia_x11.meta.platforms;
mainProgram = "nvidia-settings";
maintainers = with maintainers; [ abbradar aidalgol ];
};
}