* NVIDIA driver: updated to 256.35. Unfortunately the unpacked driver
now has a flat directory structure (i.e. usr/lib, usr/share etc. are gone), which makes installing everything in the right location rather more tedious. svn path=/nixpkgs/trunk/; revision=22628
This commit is contained in:
parent
5bd2be1d12
commit
5a7e3c70ce
@ -10,25 +10,16 @@ unpackFile() {
|
|||||||
|
|
||||||
buildPhase() {
|
buildPhase() {
|
||||||
if test -z "$libsOnly"; then
|
if test -z "$libsOnly"; then
|
||||||
echo "Building linux driver against kernel: " $kernel;
|
|
||||||
|
|
||||||
cd usr/src/nv/
|
|
||||||
|
|
||||||
# Workaround: get it to build on kernels that have CONFIG_XEN
|
|
||||||
# set. Disable the test, apply a patch to disable the Xen
|
|
||||||
# functionality.
|
|
||||||
|
|
||||||
#substituteInPlace Makefile.kbuild --replace xen_sanity_check fnord
|
|
||||||
#patch -p1 < $xenPatch
|
|
||||||
|
|
||||||
# Create the module.
|
# Create the module.
|
||||||
|
echo "Building linux driver against kernel: $kernel";
|
||||||
|
cd kernel
|
||||||
kernelVersion=$(cd $kernel/lib/modules && ls)
|
kernelVersion=$(cd $kernel/lib/modules && ls)
|
||||||
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
|
sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
|
||||||
unset src # used by the nv makefile
|
unset src # used by the nv makefile
|
||||||
# Hack necessary to compile on 2.6.28.
|
# Hack necessary to compile on 2.6.28.
|
||||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$sysSrc/include/asm/mach-default"
|
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$sysSrc/include/asm/mach-default"
|
||||||
make SYSSRC=$sysSrc module
|
make SYSSRC=$sysSrc module
|
||||||
cd ../../..
|
cd ..
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,10 +28,12 @@ installPhase() {
|
|||||||
|
|
||||||
# Install libGL and friends.
|
# Install libGL and friends.
|
||||||
ensureDir $out/lib
|
ensureDir $out/lib
|
||||||
cp -prd usr/lib/* usr/X11R6/lib/libXv* $out/lib/
|
cp -prd libcuda.* libGL.* libnvidia-cfg.* libnvidia-compiler.* libnvidia-tls.* libnvidia-glcore.* libOpenCL.* libvdpau.* libXv* tls $out/lib/
|
||||||
|
ensureDir $out/lib/vdpau
|
||||||
|
cp -p libvdpau_* $out/lib/vdpau
|
||||||
|
|
||||||
ln -snf libGLcore.so.$versionNumber $out/lib/libGLcore.so
|
ln -snf libnvidia-glcore.so.$versionNumber $out/lib/libnvidia-glcore.so
|
||||||
ln -snf libGLcore.so.$versionNumber $out/lib/libGLcore.so.1
|
ln -snf libnvidia-glcore.so.$versionNumber $out/lib/libnvidia-glcore.so.1
|
||||||
ln -snf libGL.so.$versionNumber $out/lib/libGL.so
|
ln -snf libGL.so.$versionNumber $out/lib/libGL.so
|
||||||
ln -snf libGL.so.$versionNumber $out/lib/libGL.so.1
|
ln -snf libGL.so.$versionNumber $out/lib/libGL.so.1
|
||||||
ln -snf libnvidia-cfg.so.$versionNumber $out/lib/libnvidia-cfg.so.1
|
ln -snf libnvidia-cfg.so.$versionNumber $out/lib/libnvidia-cfg.so.1
|
||||||
@ -51,20 +44,21 @@ installPhase() {
|
|||||||
|
|
||||||
patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*
|
patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*
|
||||||
patchelf --set-rpath $out/lib:$glPath $out/lib/libXvMCNVIDIA.so.*.*
|
patchelf --set-rpath $out/lib:$glPath $out/lib/libXvMCNVIDIA.so.*.*
|
||||||
set +e
|
|
||||||
# Legacy nvidia doesn't have cuda
|
|
||||||
patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*
|
patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*
|
||||||
set -e
|
|
||||||
|
|
||||||
if test -z "$libsOnly"; then
|
if test -z "$libsOnly"; then
|
||||||
|
|
||||||
# Install the kernel module.
|
# Install the kernel module.
|
||||||
ensureDir $out/lib/modules/$kernelVersion/misc
|
ensureDir $out/lib/modules/$kernelVersion/misc
|
||||||
cp usr/src/nv/nvidia.ko $out/lib/modules/$kernelVersion/misc
|
cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc
|
||||||
|
|
||||||
# Install the X driver.
|
# Install the X driver.
|
||||||
ensureDir $out/lib/xorg/modules
|
ensureDir $out/lib/xorg/modules
|
||||||
cp -prd usr/X11R6/lib/modules/* $out/lib/xorg/modules/
|
cp -p libnvidia-wfb.* $out/lib/xorg/modules/
|
||||||
|
ensureDir $out/lib/xorg/modules/drivers
|
||||||
|
cp -p nvidia_drv.so $out/lib/xorg/modules/drivers
|
||||||
|
ensureDir $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 libnvidia-wfb.so.$versionNumber $out/lib/xorg/modules/libnvidia-wfb.so.1
|
||||||
ln -snf libglx.so.$versionNumber $out/lib/xorg/modules/extensions/libglx.so
|
ln -snf libglx.so.$versionNumber $out/lib/xorg/modules/extensions/libglx.so
|
||||||
@ -75,13 +69,23 @@ installPhase() {
|
|||||||
ensureDir $out/bin
|
ensureDir $out/bin
|
||||||
|
|
||||||
for i in nvidia-settings nvidia-xconfig; do
|
for i in nvidia-settings nvidia-xconfig; do
|
||||||
cp usr/bin/$i $out/bin/$i
|
cp $i $out/bin/$i
|
||||||
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
||||||
--set-rpath $out/lib:$programPath:$glPath $out/bin/$i
|
--set-rpath $out/lib:$programPath:$glPath $out/bin/$i
|
||||||
done
|
done
|
||||||
|
|
||||||
# Header files etc.
|
# Header files etc.
|
||||||
cp -prd usr/include usr/share $out
|
ensureDir $out/include/nvidia
|
||||||
|
cp -p *.h $out/include/nvidia
|
||||||
|
|
||||||
|
ensureDir $out/share/man/man1
|
||||||
|
cp -p *.1.gz $out/share/man/man1
|
||||||
|
|
||||||
|
ensureDir $out/share/applications
|
||||||
|
cp -p *.desktop $out/share/applications
|
||||||
|
|
||||||
|
ensureDir $out/share/pixmaps
|
||||||
|
cp -p nvidia-settings.png $out/share/pixmaps
|
||||||
|
|
||||||
# Patch the `nvidia-settings.desktop' file.
|
# Patch the `nvidia-settings.desktop' file.
|
||||||
substituteInPlace $out/share/applications/nvidia-settings.desktop \
|
substituteInPlace $out/share/applications/nvidia-settings.desktop \
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
let versionNumber = "195.36.24"; in
|
let versionNumber = "256.35"; in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
|
name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
|
||||||
@ -17,13 +17,13 @@ stdenv.mkDerivation {
|
|||||||
src =
|
src =
|
||||||
if stdenv.system == "i686-linux" then
|
if stdenv.system == "i686-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg0.run";
|
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
|
||||||
sha256 = "0h96356jmmk283ijq30zimp3wxldsaddrk03gy3jifj1v29iklcg";
|
sha256 = "0qpn9i1z3b0zafpk97inmhr21wp93pjf76z9jxrxhi3jzkbbdxla";
|
||||||
}
|
}
|
||||||
else if stdenv.system == "x86_64-linux" then
|
else if stdenv.system == "x86_64-linux" then
|
||||||
fetchurl {
|
fetchurl {
|
||||||
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-pkg0.run";
|
url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
|
||||||
sha256 = "1car62fgzy4gvgmqjywbdpascrasqwv3knlyw6zzr7r84qabzc1a";
|
sha256 = "0in4b9k0nlbvnxrnh1v1d8m24wyljanymyh6w86yvirp24b4wang";
|
||||||
}
|
}
|
||||||
else throw "nvidia-x11 does not support platform ${stdenv.system}";
|
else throw "nvidia-x11 does not support platform ${stdenv.system}";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user