* Use libglvnd; * Compile nvidia-settings, nvidia-persistenced from source; * Generalize builder.wip/yesman
parent
750e7ba0d9
commit
2fd2fcf54d
@ -1,68 +0,0 @@ |
||||
{ stdenv, fetchurl, kernel ? null, xorg, zlib, perl |
||||
, gtk, atk, pango, glib, gdk_pixbuf, cairo, nukeReferences |
||||
, # Whether to build the libraries only (i.e. not the kernel module or |
||||
# nvidia-settings). Used to support 32-bit binaries on 64-bit |
||||
# Linux. |
||||
libsOnly ? false |
||||
}: |
||||
|
||||
with stdenv.lib; |
||||
|
||||
assert (!libsOnly) -> kernel != null; |
||||
|
||||
let |
||||
|
||||
versionNumber = "349.12"; |
||||
|
||||
# Policy: use the highest stable version as the default (on our master). |
||||
inherit (stdenv.lib) makeLibraryPath; |
||||
|
||||
in |
||||
|
||||
stdenv.mkDerivation { |
||||
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}"; |
||||
|
||||
builder = ./builder.sh; |
||||
|
||||
src = |
||||
if stdenv.system == "i686-linux" then |
||||
fetchurl { |
||||
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run"; |
||||
sha256 = "0x9zfw66nxv98zpkdkymlyqzspksk850bhfmza7g7pba4yba085h"; |
||||
} |
||||
else if stdenv.system == "x86_64-linux" then |
||||
fetchurl { |
||||
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run"; |
||||
sha256 = "19mfkigzffxsik3h4bsjsl481q410h804fz3rdc7chs86q4bg9h3"; |
||||
} |
||||
else throw "nvidia-x11 does not support platform ${stdenv.system}"; |
||||
|
||||
inherit versionNumber libsOnly; |
||||
|
||||
kernel = if libsOnly then null else kernel.dev; |
||||
|
||||
hardeningDisable = [ "pic" "format" ]; |
||||
|
||||
dontStrip = true; |
||||
|
||||
glPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr]; |
||||
cudaPath = makeLibraryPath [zlib stdenv.cc.cc]; |
||||
openclPath = makeLibraryPath [zlib]; |
||||
allLibPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr zlib stdenv.cc.cc]; |
||||
|
||||
gtkPath = optionalString (!libsOnly) (makeLibraryPath |
||||
[ gtk atk pango glib gdk_pixbuf cairo ] ); |
||||
programPath = makeLibraryPath [ xorg.libXv ]; |
||||
|
||||
buildInputs = [ perl nukeReferences ]; |
||||
|
||||
disallowedReferences = if libsOnly then [] else [ kernel.dev ]; |
||||
|
||||
meta = with stdenv.lib.meta; { |
||||
homepage = http://www.nvidia.com/object/unix.html; |
||||
description = "X.org driver and kernel module for NVIDIA graphics cards"; |
||||
license = licenses.unfreeRedistributable; |
||||
platforms = platforms.linux; |
||||
maintainers = [ maintainers.vcunat ]; |
||||
}; |
||||
} |
@ -1,104 +0,0 @@ |
||||
source $stdenv/setup |
||||
|
||||
dontPatchELF=1 # must keep libXv, $out in RPATH |
||||
|
||||
|
||||
unpackFile() { |
||||
sh $src -x |
||||
} |
||||
|
||||
|
||||
buildPhase() { |
||||
if test -z "$libsOnly"; then |
||||
# Create the module. |
||||
echo "Building linux driver against kernel: $kernel"; |
||||
cd kernel |
||||
kernelVersion=$(cd $kernel/lib/modules && ls) |
||||
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source) |
||||
sysOut=$(echo $kernel/lib/modules/$kernelVersion/build) |
||||
unset src # used by the nv makefile |
||||
make SYSSRC=$sysSrc SYSOUT=$sysOut module |
||||
cd .. |
||||
fi |
||||
} |
||||
|
||||
|
||||
installPhase() { |
||||
|
||||
# Install libGL and friends. |
||||
mkdir -p $out/lib/vendors |
||||
|
||||
for f in \ |
||||
libcuda libGL libnvcuvid libnvidia-cfg libnvidia-compiler \ |
||||
libnvidia-glcore libnvidia-ml libnvidia-opencl \ |
||||
libnvidia-tls libOpenCL libnvidia-tls libvdpau_nvidia |
||||
do |
||||
cp -prd $f.* $out/lib/ |
||||
ln -snf $f.so.$versionNumber $out/lib/$f.so |
||||
ln -snf $f.so.$versionNumber $out/lib/$f.so.1 |
||||
done |
||||
|
||||
cp -p nvidia.icd $out/lib/vendors/ |
||||
cp -prd tls $out/lib/ |
||||
cp -prd libOpenCL.so.1.0.0 $out/lib/ |
||||
ln -snf libOpenCL.so.1.0.0 $out/lib/libOpenCL.so |
||||
ln -snf libOpenCL.so.1.0.0 $out/lib/libOpenCL.so.1 |
||||
|
||||
patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.* |
||||
patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.* |
||||
patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.* |
||||
|
||||
if test -z "$libsOnly"; then |
||||
|
||||
# Install the kernel module. |
||||
mkdir -p $out/lib/modules/$kernelVersion/misc |
||||
cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc |
||||
|
||||
# Install the X driver. |
||||
mkdir -p $out/lib/xorg/modules |
||||
cp -p libnvidia-wfb.* $out/lib/xorg/modules/ |
||||
mkdir -p $out/lib/xorg/modules/drivers |
||||
cp -p nvidia_drv.so $out/lib/xorg/modules/drivers |
||||
mkdir -p $out/lib/xorg/modules/extensions |
||||
cp -p libglx.so.* $out/lib/xorg/modules/extensions |
||||
|
||||
ln -snf libnvidia-wfb.so.$versionNumber $out/lib/xorg/modules/libnvidia-wfb.so.1 |
||||
ln -snf libglx.so.$versionNumber $out/lib/xorg/modules/extensions/libglx.so |
||||
|
||||
patchelf --set-rpath $out/lib $out/lib/xorg/modules/extensions/libglx.so.*.* |
||||
|
||||
# Install the programs. |
||||
mkdir -p $out/bin |
||||
|
||||
for i in nvidia-settings nvidia-xconfig; do |
||||
cp $i $out/bin/$i |
||||
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ |
||||
--set-rpath $out/lib:$programPath:$glPath $out/bin/$i |
||||
done |
||||
|
||||
# Header files etc. |
||||
mkdir -p $out/include/nvidia |
||||
cp -p *.h $out/include/nvidia |
||||
|
||||
mkdir -p $out/share/man/man1 |
||||
cp -p *.1.gz $out/share/man/man1 |
||||
|
||||
mkdir -p $out/share/applications |
||||
cp -p *.desktop $out/share/applications |
||||
|
||||
mkdir -p $out/share/pixmaps |
||||
cp -p nvidia-settings.png $out/share/pixmaps |
||||
|
||||
# Patch the `nvidia-settings.desktop' file. |
||||
substituteInPlace $out/share/applications/nvidia-settings.desktop \ |
||||
--replace '__UTILS_PATH__' $out/bin \ |
||||
--replace '__PIXMAP_PATH__' $out/share/pixmaps |
||||
|
||||
# Move VDPAU libraries to their place |
||||
mkdir "$out"/lib/vdpau |
||||
mv "$out"/lib/libvdpau* "$out"/lib/vdpau |
||||
fi |
||||
} |
||||
|
||||
|
||||
genericBuild |
@ -1,120 +0,0 @@ |
||||
source $stdenv/setup |
||||
|
||||
dontPatchELF=1 # must keep libXv, $out in RPATH |
||||
|
||||
|
||||
unpackFile() { |
||||
skip=$(sed 's/^skip=//; t; d' $src) |
||||
tail -n +$skip $src | xz -d | tar xvf - |
||||
sourceRoot=. |
||||
} |
||||
|
||||
|
||||
buildPhase() { |
||||
if test -z "$libsOnly"; then |
||||
# Create the module. |
||||
echo "Building linux driver against kernel: $kernel"; |
||||
cd kernel |
||||
kernelVersion=$(cd $kernel/lib/modules && ls) |
||||
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/source) |
||||
sysOut=$(echo $kernel/lib/modules/$kernelVersion/build) |
||||
unset src # used by the nv makefile |
||||
make SYSSRC=$sysSrc SYSOUT=$sysOut module |
||||
cd uvm |
||||
make SYSSRC=$sysSrc SYSOUT=$sysOut module |
||||
cd .. |
||||
cd .. |
||||
fi |
||||
} |
||||
|
||||
|
||||
installPhase() { |
||||
|
||||
if test -z "$libsOnly"; then |
||||
# Install the kernel module. |
||||
mkdir -p $out/lib/modules/$kernelVersion/misc |
||||
cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc |
||||
cp kernel/uvm/nvidia-uvm.ko $out/lib/modules/$kernelVersion/misc |
||||
|
||||
# Install the X driver. |
||||
mkdir -p $out/lib/xorg/modules |
||||
cp -p libnvidia-wfb.* $out/lib/xorg/modules/ |
||||
mkdir -p $out/lib/xorg/modules/drivers |
||||
cp -p nvidia_drv.so $out/lib/xorg/modules/drivers |
||||
mkdir -p $out/lib/xorg/modules/extensions |
||||
cp -p libglx.so.* $out/lib/xorg/modules/extensions |
||||
|
||||
#patchelf --set-rpath $out/lib $out/lib/xorg/modules/extensions/libglx.so.*.* |
||||
|
||||
# Install the programs. |
||||
mkdir -p $out/bin |
||||
|
||||
for i in nvidia-settings nvidia-smi; do |
||||
cp $i $out/bin/$i |
||||
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ |
||||
--set-rpath $out/lib:$programPath:$glPath $out/bin/$i |
||||
done |
||||
|
||||
# Header files etc. |
||||
mkdir -p $out/include/nvidia |
||||
cp -p *.h $out/include/nvidia |
||||
|
||||
mkdir -p $out/share/man/man1 |
||||
cp -p *.1.gz $out/share/man/man1 |
||||
rm $out/share/man/man1/nvidia-xconfig.1.gz |
||||
|
||||
mkdir -p $out/share/applications |
||||
cp -p *.desktop $out/share/applications |
||||
|
||||
mkdir -p $out/share/pixmaps |
||||
cp -p nvidia-settings.png $out/share/pixmaps |
||||
|
||||
# Patch the `nvidia-settings.desktop' file. |
||||
substituteInPlace $out/share/applications/nvidia-settings.desktop \ |
||||
--replace '__UTILS_PATH__' $out/bin \ |
||||
--replace '__PIXMAP_PATH__' $out/share/pixmaps |
||||
|
||||
# Test a bit. |
||||
$out/bin/nvidia-settings --version |
||||
fi |
||||
|
||||
|
||||
# Install libGL and friends. |
||||
mkdir -p "$out/lib/vendors" |
||||
cp -p nvidia.icd $out/lib/vendors/ |
||||
|
||||
cp -prd *.so.* tls "$out/lib/" |
||||
rm "$out"/lib/lib{glx,nvidia-wfb}.so.* # handled separately |
||||
|
||||
for libname in `find "$out/lib/" -name '*.so.*'` |
||||
do |
||||
# I'm lazy to differentiate needed libs per-library, as the closure is the same. |
||||
# Unfortunately --shrink-rpath would strip too much. |
||||
patchelf --set-rpath "$out/lib:$allLibPath" "$libname" |
||||
|
||||
libname_short=`echo -n "$libname" | sed 's/so\..*/so/'` |
||||
|
||||
# nvidia's EGL stack seems to expect libGLESv2.so.2 to be available |
||||
if [ $(basename "$libname_short") == "libGLESv2.so" ]; then |
||||
ln -srnf "$libname" "$libname_short.2" |
||||
fi |
||||
|
||||
ln -srnf "$libname" "$libname_short" |
||||
ln -srnf "$libname" "$libname_short.1" |
||||
done |
||||
|
||||
#patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.* |
||||
#patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.* |
||||
#patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.* |
||||
#patchelf --set-rpath $openclPath $out/lib/libnvidia-opencl.so.*.* |
||||
|
||||
# We distribute these separately in `libvdpau` |
||||
rm "$out"/lib/libvdpau{.*,_trace.*} |
||||
|
||||
# Move VDPAU libraries to their place |
||||
mkdir "$out"/lib/vdpau |
||||
mv "$out"/lib/libvdpau* "$out"/lib/vdpau |
||||
} |
||||
|
||||
|
||||
genericBuild |
@ -1,74 +1,43 @@ |
||||
{ stdenv, fetchurl, kernel ? null, xorg, zlib, perl |
||||
, gtk2, atk, pango, glib, gdk_pixbuf, cairo, nukeReferences |
||||
, # Whether to build the libraries only (i.e. not the kernel module or |
||||
# nvidia-settings). Used to support 32-bit binaries on 64-bit |
||||
# Linux. |
||||
libsOnly ? false |
||||
}: |
||||
|
||||
with stdenv.lib; |
||||
|
||||
assert (!libsOnly) -> kernel != null; |
||||
{ callPackage }: |
||||
|
||||
let |
||||
|
||||
versionNumber = "375.26"; |
||||
|
||||
# Policy: use the highest stable version as the default (on our master). |
||||
inherit (stdenv.lib) makeLibraryPath; |
||||
|
||||
nameSuffix = optionalString (!libsOnly) "-${kernel.version}"; |
||||
|
||||
generic = args: callPackage (import ./generic.nix args) { }; |
||||
in |
||||
{ |
||||
# Policy: use the highest stable version as the default (on our master). |
||||
stable = generic { |
||||
version = "375.26"; |
||||
sha256_32bit = "0yv19rkz2wzzj0fygfjb1mh21iy769kff3yg2kzk8bsiwnmcyybw"; |
||||
sha256_64bit = "1kqy9ayja3g5znj2hzx8pklz8qi0b0l9da7c3ldg3hlxf31v4hjg"; |
||||
settingsSha256 = "1s8zf5cfhx8m05fvws0gh1q0wy5zyyg2j510zlwp4hk35y7dic5y"; |
||||
persistencedSha256 = "15r6rbzyk4yaqkpkqs8j00zc7jbhgp8naskv93dwjyw0lnj0wgky"; |
||||
}; |
||||
|
||||
stdenv.mkDerivation { |
||||
name = "nvidia-x11-${versionNumber}${nameSuffix}"; |
||||
|
||||
builder = ./builder.sh; |
||||
|
||||
src = |
||||
if stdenv.system == "i686-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run"; |
||||
sha256 = "0yv19rkz2wzzj0fygfjb1mh21iy769kff3yg2kzk8bsiwnmcyybw"; |
||||
} |
||||
else if stdenv.system == "x86_64-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}.run"; |
||||
sha256 = "1kqy9ayja3g5znj2hzx8pklz8qi0b0l9da7c3ldg3hlxf31v4hjg"; |
||||
} |
||||
else throw "nvidia-x11 does not support platform ${stdenv.system}"; |
||||
|
||||
inherit versionNumber libsOnly; |
||||
inherit (stdenv) system; |
||||
|
||||
kernel = if libsOnly then null else kernel.dev; |
||||
|
||||
hardeningDisable = [ "pic" "format" ]; |
||||
|
||||
dontStrip = true; |
||||
|
||||
glPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr]; |
||||
cudaPath = makeLibraryPath [zlib stdenv.cc.cc]; |
||||
openclPath = makeLibraryPath [zlib]; |
||||
allLibPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr zlib stdenv.cc.cc]; |
||||
|
||||
gtkPath = optionalString (!libsOnly) (makeLibraryPath |
||||
[ gtk2 atk pango glib gdk_pixbuf cairo ] ); |
||||
programPath = makeLibraryPath [ xorg.libXv ]; |
||||
|
||||
|
||||
|
||||
buildInputs = [ perl nukeReferences ]; |
||||
beta = generic { |
||||
version = "378.09"; |
||||
sha256_32bit = "0a1vwvsqi89pn29c9aii53xq8292dxf68sr8lxzx4bpqjqmsbapy"; |
||||
sha256_64bit = "018qqg9zlpwd2cad99vbn18rnrrkrqybs7q65h8dmxirkx4pcvh8"; |
||||
settingsSha256 = "1fjkpqmzdzk46p1chzxqvbj3cpqcwwx4qmv33yjq7z2a5zab9z8v"; |
||||
persistencedSha256 = "1svaa5a0zz0r8qy6pg9lnhy5zmffvw0h120h46qqd01pkb4yv5lc"; |
||||
}; |
||||
|
||||
disallowedReferences = if libsOnly then [] else [ kernel.dev ]; |
||||
legacy_340 = generic { |
||||
version = "340.101"; |
||||
sha256_32bit = "0qmhkvxj6h63sayys9gldpafw5skpv8nsm2gxxb3pxcv7nfdlpjz"; |
||||
sha256_64bit = "02k8j0xzxp2y4vay0kf982q382ny1i4g1kai93f2h5sak6sq3kyj"; |
||||
settingsSha256 = "1mavbhff24n0jn154af152fp04njd505scdlxdm850h1ycb2i3g9"; |
||||
persistencedSha256 = "1396bmmg9b1z805dzljgi2f219ji84wfnnifdbk32dpd5mrywjk0"; |
||||
useGLVND = false; |
||||
}; |
||||
|
||||
meta = with stdenv.lib.meta; { |
||||
homepage = http://www.nvidia.com/object/unix.html; |
||||
description = "X.org driver and kernel module for NVIDIA graphics cards"; |
||||
license = licenses.unfreeRedistributable; |
||||
platforms = platforms.linux; |
||||
maintainers = [ maintainers.vcunat ]; |
||||
priority = 4; # resolves collision with xorg-server's "lib/xorg/modules/extensions/libglx.so" |
||||
legacy_304 = generic { |
||||
version = "304.134"; |
||||
sha256_32bit = "178wx0a2pmdnaypa9pq6jh0ii0i8ykz1sh1liad9zfriy4d8kxw4"; |
||||
sha256_64bit = "0pydw7nr4d2dply38kwvjbghsbilbp2q0mas4nfq5ad050d2c550"; |
||||
settingsSha256 = "0q92xw4fr9p5nbhj1plynm50d32881861daxfwrisywszqijhmlf"; |
||||
persistencedSha256 = null; |
||||
useGLVND = false; |
||||
}; |
||||
|
||||
legacy_173 = callPackage ./legacy173.nix { }; |
||||
} |
||||
|
@ -0,0 +1,81 @@ |
||||
{ version |
||||
, sha256_32bit |
||||
, sha256_64bit |
||||
, settingsSha256 |
||||
, persistencedSha256 |
||||
, useGLVND ? true |
||||
, preferGtk2 ? false |
||||
}: |
||||
|
||||
{ stdenv, callPackage, callPackage_i686, buildEnv, fetchurl |
||||
, kernel ? null, xorg, zlib, perl, nukeReferences |
||||
, # Whether to build the libraries only (i.e. not the kernel module or |
||||
# nvidia-settings). Used to support 32-bit binaries on 64-bit |
||||
# Linux. |
||||
libsOnly ? false |
||||
}: |
||||
|
||||
with stdenv.lib; |
||||
|
||||
assert (!libsOnly) -> kernel != null; |
||||
|
||||
let |
||||
nameSuffix = optionalString (!libsOnly) "-${kernel.version}"; |
||||
pkgSuffix = optionalString (versionOlder version "304") "-pkg0"; |
||||
|
||||
self = stdenv.mkDerivation { |
||||
name = "nvidia-x11-${version}${nameSuffix}"; |
||||
|
||||
builder = ./builder.sh; |
||||
|
||||
src = |
||||
if stdenv.system == "i686-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86/${version}/NVIDIA-Linux-x86-${version}${pkgSuffix}.run"; |
||||
sha256 = sha256_32bit; |
||||
} |
||||
else if stdenv.system == "x86_64-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}${pkgSuffix}.run"; |
||||
sha256 = sha256_64bit; |
||||
} |
||||
else throw "nvidia-x11 does not support platform ${stdenv.system}"; |
||||
|
||||
inherit version useGLVND; |
||||
inherit (stdenv) system; |
||||
|
||||
outputs = [ "out" ] ++ optional (!libsOnly) "bin"; |
||||
outputDev = if libsOnly then null else "bin"; |
||||
|
||||
kernel = if libsOnly then null else kernel.dev; |
||||
|
||||
hardeningDisable = [ "pic" "format" ]; |
||||
|
||||
dontStrip = true; |
||||
dontPatchELF = true; |
||||
|
||||
libPath = makeLibraryPath [ xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib stdenv.cc.cc ]; |
||||
|
||||
nativeBuildInputs = [ perl nukeReferences ]; |
||||
|
||||
disallowedReferences = optional (!libsOnly) [ kernel.dev ]; |
||||
|
||||
passthru = { |
||||
settings = callPackage (import ./settings.nix self settingsSha256) { |
||||
withGtk2 = preferGtk2; |
||||
withGtk3 = !preferGtk2; |
||||
}; |
||||
persistenced = if persistencedSha256 == null then null else callPackage (import ./persistenced.nix self persistencedSha256) { }; |
||||
}; |
||||
|
||||
meta = with stdenv.lib; { |
||||
homepage = http://www.nvidia.com/object/unix.html; |
||||
description = "X.org driver and kernel module for NVIDIA graphics cards"; |
||||
license = licenses.unfreeRedistributable; |
||||
platforms = platforms.linux; |
||||
maintainers = [ maintainers.vcunat ]; |
||||
priority = 4; # resolves collision with xorg-server's "lib/xorg/modules/extensions/libglx.so" |
||||
}; |
||||
}; |
||||
|
||||
in self |
@ -1,53 +0,0 @@ |
||||
{ stdenv, fetchurl, kernel ? null, xorg, zlib, perl |
||||
, gtk2, atk, pango, glib, gdk_pixbuf |
||||
, # Whether to build the libraries only (i.e. not the kernel module or |
||||
# nvidia-settings). Used to support 32-bit binaries on 64-bit |
||||
# Linux. |
||||
libsOnly ? false |
||||
}: |
||||
|
||||
with stdenv.lib; |
||||
|
||||
let versionNumber = "304.134"; in |
||||
|
||||
stdenv.mkDerivation { |
||||
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}"; |
||||
|
||||
builder = ./builder-legacy304.sh; |
||||
|
||||
src = |
||||
if stdenv.system == "i686-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run"; |
||||
sha256 = "178wx0a2pmdnaypa9pq6jh0ii0i8ykz1sh1liad9zfriy4d8kxw4"; |
||||
} |
||||
else if stdenv.system == "x86_64-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run"; |
||||
sha256 = "0hy4q1v4y7q2jq2j963mwpjhjksqhaiing3xcla861r8rmjkf8a2"; |
||||
} |
||||
else throw "nvidia-x11 does not support platform ${stdenv.system}"; |
||||
|
||||
inherit versionNumber libsOnly; |
||||
|
||||
kernel = if libsOnly then null else kernel.dev; |
||||
|
||||
hardeningDisable = [ "pic" "format" ]; |
||||
|
||||
dontStrip = true; |
||||
|
||||
glPath = stdenv.lib.makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr]; |
||||
|
||||
cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.cc.cc]; |
||||
|
||||
programPath = optionalString (!libsOnly) (stdenv.lib.makeLibraryPath |
||||
[ gtk2 atk pango glib gdk_pixbuf xorg.libXv ] ); |
||||
|
||||
buildInputs = [ perl ]; |
||||
|
||||
meta = { |
||||
homepage = http://www.nvidia.com/object/unix.html; |
||||
description = "X.org driver and kernel module for NVIDIA graphics cards"; |
||||
license = stdenv.lib.licenses.unfree; |
||||
}; |
||||
} |
@ -1,67 +0,0 @@ |
||||
{ stdenv, fetchurl, kernel ? null, xorg, zlib, perl |
||||
, gtk2, atk, pango, glib, gdk_pixbuf |
||||
, # Whether to build the libraries only (i.e. not the kernel module or |
||||
# nvidia-settings). Used to support 32-bit binaries on 64-bit |
||||
# Linux. |
||||
libsOnly ? false |
||||
}: |
||||
|
||||
with stdenv.lib; |
||||
|
||||
assert (!libsOnly) -> kernel != null; |
||||
|
||||
let |
||||
|
||||
versionNumber = "340.101"; |
||||
/* This branch is needed for G8x, G9x, and GT2xx GPUs, and motherboard chipsets based on them. |
||||
Ongoing support for new Linux kernels and X servers, as well as fixes for critical bugs, |
||||
will be included in 340.* legacy releases through the end of 2019. |
||||
*/ |
||||
inherit (stdenv.lib) makeLibraryPath; |
||||
in |
||||
|
||||
stdenv.mkDerivation { |
||||
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}"; |
||||
|
||||
builder = ./builder-legacy340.sh; |
||||
|
||||
src = |
||||
if stdenv.system == "i686-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run"; |
||||
sha256 = "0qmhkvxj6h63sayys9gldpafw5skpv8nsm2gxxb3pxcv7nfdlpjz"; |
||||
} |
||||
else if stdenv.system == "x86_64-linux" then |
||||
fetchurl { |
||||
url = "http://download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run"; |
||||
sha256 = "0ln7fxm78zrzrjk3j5ychi5xxlgkzg2m7anw8nklr3d17c3jxxjy"; |
||||
} |
||||
else throw "nvidia-x11 does not support platform ${stdenv.system}"; |
||||
|
||||
inherit versionNumber libsOnly; |
||||
|
||||
kernel = if libsOnly then null else kernel.dev; |
||||
|
||||
hardeningDisable = [ "pic" "format" ]; |
||||
|
||||
dontStrip = true; |
||||
|
||||
glPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr]; |
||||
cudaPath = makeLibraryPath [zlib stdenv.cc.cc]; |
||||
openclPath = makeLibraryPath [zlib]; |
||||
allLibPath = makeLibraryPath [xorg.libXext xorg.libX11 xorg.libXrandr zlib stdenv.cc.cc]; |
||||
|
||||
programPath = optionalString (!libsOnly) (makeLibraryPath |
||||
[ gtk2 atk pango glib gdk_pixbuf xorg.libXv ] ); |
||||
|
||||
buildInputs = [ perl ]; |
||||
|
||||
meta = with stdenv.lib.meta; { |
||||
homepage = http://www.nvidia.com/object/unix.html; |
||||
description = "X.org driver and kernel module for NVIDIA graphics cards"; |
||||
license = licenses.unfreeRedistributable; |
||||
platforms = platforms.linux; |
||||
maintainers = [ maintainers.vcunat ]; |
||||
priority = 4; # resolves collision with xorg-server's "lib/xorg/modules/extensions/libglx.so" |
||||
}; |
||||
} |
@ -0,0 +1,30 @@ |
||||
nvidia_x11: sha256: |
||||
|
||||
{ stdenv, lib, fetchurl, m4 }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
name = "nvidia-persistenced-${nvidia_x11.version}"; |
||||
inherit (nvidia_x11) version; |
||||
|
||||
src = fetchurl { |
||||
url = "ftp://download.nvidia.com/XFree86/nvidia-persistenced/${name}.tar.bz2"; |
||||
inherit sha256; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ m4 ]; |
||||
|
||||
installFlags = [ "PREFIX=$(out)" ]; |
||||
|
||||
postFixup = '' |
||||
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/nvidia-persistenced):${nvidia_x11}/lib" \ |
||||
$out/bin/nvidia-persistenced |
||||
''; |
||||
|
||||
meta = with stdenv.lib; { |
||||
homepage = "http://www.nvidia.com/object/unix.html"; |
||||
description = "Settings application for NVIDIA graphics cards"; |
||||
license = licenses.unfreeRedistributable; |
||||
platforms = platforms.linux; |
||||
maintainers = with maintainers; [ abbradar ]; |
||||
}; |
||||
} |
@ -0,0 +1,51 @@ |
||||
nvidia_x11: sha256: |
||||
|
||||
{ stdenv, lib, fetchurl, pkgconfig, m4, gtk2, gtk3, libXv, libvdpau |
||||
, withGtk2 ? false, withGtk3 ? true |
||||
}: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
name = "nvidia-settings-${nvidia_x11.version}"; |
||||
inherit (nvidia_x11) version; |
||||
|
||||
src = fetchurl { |
||||
url = "ftp://download.nvidia.com/XFree86/nvidia-settings/${name}.tar.bz2"; |
||||
inherit sha256; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ pkgconfig m4 ]; |
||||
|
||||
buildInputs = [ gtk2 gtk3 libXv libvdpau ]; |
||||
|
||||
installFlags = [ "PREFIX=$(out)" ]; |
||||
|
||||
preBuild = '' |
||||
if [ -e src/libXNVCtrl/libXNVCtrl.a ]; then |
||||
( cd src/libXNVCtrl |
||||
make |
||||
) |
||||
fi |
||||
''; |
||||
|
||||
postInstall = '' |
||||
${lib.optionalString (!withGtk2) '' |
||||
rm -f $out/lib/libnvidia-gtk2.so.* |
||||
''} |
||||
${lib.optionalString (!withGtk3) '' |
||||
rm -f $out/lib/libnvidia-gtk3.so.* |
||||
''} |
||||
''; |
||||
|
||||
postFixup = '' |
||||
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/nvidia-settings):$out/lib:${nvidia_x11}/lib" \ |
||||
$out/bin/nvidia-settings |
||||
''; |
||||
|
||||
meta = with stdenv.lib; { |
||||
homepage = "http://www.nvidia.com/object/unix.html"; |
||||
description = "Settings application for NVIDIA graphics cards"; |
||||
license = licenses.unfreeRedistributable; |
||||
platforms = platforms.linux; |
||||
maintainers = with maintainers; [ abbradar ]; |
||||
}; |
||||
} |
Loading…
Reference in new issue