Unverified Commit f9895b95 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

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

 nvidia-x11: minor cleanups, don't require gtk2 input when it is disabled 
parents 654af2d3 068dda73
Loading
Loading
Loading
Loading
+23 −17
Original line number Diff line number Diff line
@@ -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) ''
  postInstall = lib.optionalString (!withGtk2) ''
    rm -f $out/lib/libnvidia-gtk2.so.*
    ''}
    ${lib.optionalString (!withGtk3) ''
  '' + 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 ];
  };
}