mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 14:22:50 +03:00
nvidia_x11_beta: reinit at 410.57
This commit is contained in:
parent
7131749bee
commit
21bb1fa004
@ -1,6 +1,6 @@
|
|||||||
# This module provides the proprietary NVIDIA X11 / OpenGL drivers.
|
# This module provides the proprietary NVIDIA X11 / OpenGL drivers.
|
||||||
|
|
||||||
{ config, lib, pkgs, pkgs_i686, ... }:
|
{ stdenv, config, lib, pkgs, pkgs_i686, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
@ -23,7 +23,11 @@ let
|
|||||||
else null;
|
else null;
|
||||||
|
|
||||||
nvidia_x11 = nvidiaForKernel config.boot.kernelPackages;
|
nvidia_x11 = nvidiaForKernel config.boot.kernelPackages;
|
||||||
nvidia_libs32 = (nvidiaForKernel pkgs_i686.linuxPackages).override { libsOnly = true; kernel = null; };
|
nvidia_libs32 =
|
||||||
|
if versionOlder nvidia_x11.version "391" then
|
||||||
|
((nvidiaForKernel pkgs_i686.linuxPackages).override { libsOnly = true; kernel = null; }).out
|
||||||
|
else
|
||||||
|
(nvidiaForKernel config.boot.kernelPackages).lib32;
|
||||||
|
|
||||||
enabled = nvidia_x11 != null;
|
enabled = nvidia_x11 != null;
|
||||||
|
|
||||||
@ -98,7 +102,7 @@ in
|
|||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = config.services.xserver.displayManager.gdm.wayland;
|
assertion = config.services.xserver.displayManager.gdm.wayland;
|
||||||
message = "NVidia drivers don't support wayland";
|
message = "NVIDIA drivers don't support wayland";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
assertion = !optimusCfg.enable ||
|
assertion = !optimusCfg.enable ||
|
||||||
@ -161,7 +165,7 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
hardware.opengl.package = nvidia_x11.out;
|
hardware.opengl.package = nvidia_x11.out;
|
||||||
hardware.opengl.package32 = nvidia_libs32.out;
|
hardware.opengl.package32 = nvidia_libs32;
|
||||||
|
|
||||||
environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
|
environment.systemPackages = [ nvidia_x11.bin nvidia_x11.settings ]
|
||||||
++ lib.filter (p: p != null) [ nvidia_x11.persistenced ];
|
++ lib.filter (p: p != null) [ nvidia_x11.persistenced ];
|
||||||
|
@ -26,32 +26,44 @@ buildPhase() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
installPhase() {
|
installPhase() {
|
||||||
# Install libGL and friends.
|
# Install libGL and friends.
|
||||||
|
|
||||||
|
# since version 391, 32bit libraries are bundled in the 32/ sub-directory
|
||||||
|
if [ "$i686bundled" = "1" ]; then
|
||||||
|
mkdir -p "$lib32/lib"
|
||||||
|
cp -prd 32/*.so.* 32/tls "$lib32/lib/"
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$out/lib"
|
mkdir -p "$out/lib"
|
||||||
cp -prd *.so.* tls "$out/lib/"
|
cp -prd *.so.* tls "$out/lib/"
|
||||||
rm $out/lib/lib{glx,nvidia-wfb}.so.* # handled separately
|
|
||||||
rm -f $out/lib/libnvidia-gtk* # built from source
|
|
||||||
if [ "$useGLVND" = "1" ]; then
|
|
||||||
# Pre-built libglvnd
|
|
||||||
rm $out/lib/lib{GL,GLX,EGL,GLESv1_CM,GLESv2,OpenGL,GLdispatch}.so.*
|
|
||||||
fi
|
|
||||||
# Use ocl-icd instead
|
|
||||||
rm $out/lib/libOpenCL.so*
|
|
||||||
# Move VDPAU libraries to their place
|
|
||||||
mkdir $out/lib/vdpau
|
|
||||||
mv $out/lib/libvdpau* $out/lib/vdpau
|
|
||||||
|
|
||||||
# Install ICDs.
|
for i in $lib32 $out; do
|
||||||
install -Dm644 nvidia.icd $out/etc/OpenCL/vendors/nvidia.icd
|
rm -f $i/lib/lib{glx,nvidia-wfb}.so.* # handled separately
|
||||||
if [ -e nvidia_icd.json.template ]; then
|
rm -f $i/lib/libnvidia-gtk* # built from source
|
||||||
sed "s#__NV_VK_ICD__#libGLX_nvidia.so#" nvidia_icd.json.template > nvidia_icd.json
|
if [ "$useGLVND" = "1" ]; then
|
||||||
install -Dm644 nvidia_icd.json $out/share/vulkan/icd.d/nvidia.json
|
# Pre-built libglvnd
|
||||||
fi
|
rm $i/lib/lib{GL,GLX,EGL,GLESv1_CM,GLESv2,OpenGL,GLdispatch}.so.*
|
||||||
if [ "$useGLVND" = "1" ]; then
|
fi
|
||||||
install -Dm644 10_nvidia.json $out/share/glvnd/egl_vendor.d/nvidia.json
|
# Use ocl-icd instead
|
||||||
fi
|
rm -f $i/lib/libOpenCL.so*
|
||||||
|
# Move VDPAU libraries to their place
|
||||||
|
mkdir $i/lib/vdpau
|
||||||
|
mv $i/lib/libvdpau* $i/lib/vdpau
|
||||||
|
|
||||||
|
# Install ICDs.
|
||||||
|
install -Dm644 nvidia.icd $i/etc/OpenCL/vendors/nvidia.icd
|
||||||
|
if [ -e nvidia_icd.json.template ]; then
|
||||||
|
sed "s#__NV_VK_ICD__#libGLX_nvidia.so#" nvidia_icd.json.template > nvidia_icd.json
|
||||||
|
install -Dm644 nvidia_icd.json $i/share/vulkan/icd.d/nvidia.json
|
||||||
|
fi
|
||||||
|
if [ "$useGLVND" = "1" ]; then
|
||||||
|
install -Dm644 10_nvidia.json $i/share/glvnd/egl_vendor.d/nvidia.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
if [ -n "$bin" ]; then
|
if [ -n "$bin" ]; then
|
||||||
# Install the X drivers.
|
# Install the X drivers.
|
||||||
@ -60,7 +72,7 @@ installPhase() {
|
|||||||
mkdir -p $bin/lib/xorg/modules/drivers
|
mkdir -p $bin/lib/xorg/modules/drivers
|
||||||
cp -p nvidia_drv.so $bin/lib/xorg/modules/drivers
|
cp -p nvidia_drv.so $bin/lib/xorg/modules/drivers
|
||||||
mkdir -p $bin/lib/xorg/modules/extensions
|
mkdir -p $bin/lib/xorg/modules/extensions
|
||||||
cp -p libglx.so.* $bin/lib/xorg/modules/extensions
|
cp -p libglx*.so* $bin/lib/xorg/modules/extensions
|
||||||
|
|
||||||
# Install the kernel module.
|
# Install the kernel module.
|
||||||
mkdir -p $bin/lib/modules/$kernelVersion/misc
|
mkdir -p $bin/lib/modules/$kernelVersion/misc
|
||||||
@ -78,7 +90,7 @@ installPhase() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# All libs except GUI-only are installed now, so fixup them.
|
# All libs except GUI-only are installed now, so fixup them.
|
||||||
for libname in `find "$out/lib/" -name '*.so.*'` `test -z "$bin" || find "$bin/lib/" -name '*.so.*'`
|
for libname in $(find "$out/lib/" $(test -n "$lib32" && echo "$lib32/lib/") $(test -n "$bin" && echo "$bin/lib/") -name '*.so.*')
|
||||||
do
|
do
|
||||||
# I'm lazy to differentiate needed libs per-library, as the closure is the same.
|
# I'm lazy to differentiate needed libs per-library, as the closure is the same.
|
||||||
# Unfortunately --shrink-rpath would strip too much.
|
# Unfortunately --shrink-rpath would strip too much.
|
||||||
|
@ -26,8 +26,12 @@ rec {
|
|||||||
patches = lib.optional (kernel.meta.branch == "4.19") ./drm_mode_connector.patch;
|
patches = lib.optional (kernel.meta.branch == "4.19") ./drm_mode_connector.patch;
|
||||||
};
|
};
|
||||||
|
|
||||||
beta = stable; # not enough interest to maintain beta ATM
|
beta = generic {
|
||||||
|
version = "410.57";
|
||||||
|
sha256_64bit = "08534rv3wcmzslbwq11kd3s7cxm72p48dia6540c0586xwgjwg2w";
|
||||||
|
settingsSha256 = "1phhhzlc8n3rqdhrn757mnlqmsp616d079a6h1qjpa6jba9z9915";
|
||||||
|
persistencedSha256 = "1z7c1ff0y486yp9i5w0siwh9dnprml22x2avarbjfgqwm4f652lw";
|
||||||
|
};
|
||||||
|
|
||||||
legacy_340 = generic {
|
legacy_340 = generic {
|
||||||
version = "340.104";
|
version = "340.104";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ version
|
{ version
|
||||||
, sha256_32bit
|
, sha256_32bit ? null
|
||||||
, sha256_64bit
|
, sha256_64bit
|
||||||
, settingsSha256
|
, settingsSha256
|
||||||
, persistencedSha256
|
, persistencedSha256
|
||||||
@ -22,11 +22,15 @@
|
|||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
assert (!libsOnly) -> kernel != null;
|
assert !libsOnly -> kernel != null;
|
||||||
|
assert versionOlder version "391" -> sha256_32bit != null;
|
||||||
|
assert ! versionOlder version "391" -> stdenv.hostPlatform.system == "x86_64-linux";
|
||||||
|
|
||||||
let
|
let
|
||||||
nameSuffix = optionalString (!libsOnly) "-${kernel.version}";
|
nameSuffix = optionalString (!libsOnly) "-${kernel.version}";
|
||||||
pkgSuffix = optionalString (versionOlder version "304") "-pkg0";
|
pkgSuffix = optionalString (versionOlder version "304") "-pkg0";
|
||||||
|
i686bundled = versionAtLeast version "391";
|
||||||
|
|
||||||
|
|
||||||
self = stdenv.mkDerivation {
|
self = stdenv.mkDerivation {
|
||||||
name = "nvidia-x11-${version}${nameSuffix}";
|
name = "nvidia-x11-${version}${nameSuffix}";
|
||||||
@ -34,24 +38,27 @@ let
|
|||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
|
|
||||||
src =
|
src =
|
||||||
if stdenv.hostPlatform.system == "i686-linux" then
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
||||||
fetchurl {
|
|
||||||
url = "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run";
|
|
||||||
sha256 = sha256_32bit;
|
|
||||||
}
|
|
||||||
else if stdenv.hostPlatform.system == "x86_64-linux" then
|
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run";
|
url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run";
|
||||||
sha256 = sha256_64bit;
|
sha256 = sha256_64bit;
|
||||||
}
|
}
|
||||||
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
||||||
|
fetchurl {
|
||||||
|
url = "https://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run";
|
||||||
|
sha256 = sha256_32bit;
|
||||||
|
}
|
||||||
else throw "nvidia-x11 does not support platform ${stdenv.hostPlatform.system}";
|
else throw "nvidia-x11 does not support platform ${stdenv.hostPlatform.system}";
|
||||||
|
|
||||||
patches = if libsOnly then null else patches;
|
patches = if libsOnly then null else patches;
|
||||||
inherit prePatch;
|
inherit prePatch;
|
||||||
inherit version useGLVND useProfiles;
|
inherit version useGLVND useProfiles;
|
||||||
inherit (stdenv.hostPlatform) system;
|
inherit (stdenv.hostPlatform) system;
|
||||||
|
inherit i686bundled;
|
||||||
|
|
||||||
outputs = [ "out" ] ++ optional (!libsOnly) "bin";
|
outputs = [ "out" ]
|
||||||
|
++ optional i686bundled "lib32"
|
||||||
|
++ optional (!libsOnly) "bin";
|
||||||
outputDev = if libsOnly then null else "bin";
|
outputDev = if libsOnly then null else "bin";
|
||||||
|
|
||||||
kernel = if libsOnly then null else kernel.dev;
|
kernel = if libsOnly then null else kernel.dev;
|
||||||
|
Loading…
Reference in New Issue
Block a user