* NVIDIA driver: set a RUNPATH on libGL.so and friends. This ensures
that applications that link against it don't need to have its dependencies (like libXext) in *their* RUNPATHs. * glxinfo: don't add /var/run/opengl-driver/lib to the RUNPATH. Instead LD_LIBRARY_PATH should be set to /var/run/opengl-driver/lib at runtime. This is much more pure, and it obviates the need for patchelfing all OpenGL applications. (TODO: remove patchelf hacks for other OpenGL programs as well.) svn path=/nixpkgs/branches/stdenv-updates/; revision=11972
This commit is contained in:
parent
dcf01e5925
commit
9029c3b61f
|
@ -8,8 +8,7 @@ unpackFile() {
|
|||
}
|
||||
|
||||
|
||||
buildPhase=myBuildPhase
|
||||
myBuildPhase() {
|
||||
buildPhase() {
|
||||
echo "Building linux driver against kernel: " $kernel;
|
||||
|
||||
cd usr/src/nv/
|
||||
|
@ -28,8 +27,7 @@ myBuildPhase() {
|
|||
}
|
||||
|
||||
|
||||
installPhase=myInstallPhase
|
||||
myInstallPhase() {
|
||||
installPhase() {
|
||||
|
||||
# Install the kernel module.
|
||||
ensureDir $out/lib/modules/$kernelVersion/misc
|
||||
|
@ -58,15 +56,15 @@ myInstallPhase() {
|
|||
# Install the programs.
|
||||
ensureDir $out/bin
|
||||
|
||||
fullPath=$out/lib
|
||||
for i in $libPath; do
|
||||
fullPath=$fullPath:$i/lib
|
||||
done
|
||||
patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*.*
|
||||
patchelf --set-rpath $out/lib:$glPath $out/lib/libXvMCNVIDIA.so.*.*.*
|
||||
patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*.*
|
||||
patchelf --set-rpath $out/lib $out/lib/xorg/modules/extensions/libglx.so.*.*.*
|
||||
|
||||
for i in nvidia-settings nvidia-xconfig; do
|
||||
cp usr/bin/$i $out/bin/$i
|
||||
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
||||
--set-rpath $fullPath $out/bin/$i
|
||||
--set-rpath $out/lib:$programPath:$glPath $out/bin/$i
|
||||
done
|
||||
|
||||
# Header files etc.
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
{stdenv, fetchurl, kernel, xlibs, gtkLibs}:
|
||||
{stdenv, fetchurl, kernel, xlibs, gtkLibs, zlib}:
|
||||
|
||||
let
|
||||
|
||||
versionNumber = "169.09";
|
||||
versionNumber = "173.14.05";
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "nvidiaDrivers-" + versionNumber;
|
||||
name = "nvidia-x11-${versionNumber}";
|
||||
|
||||
builder = ./builder.sh;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg1.run";
|
||||
sha256 = "1m3k2jyxi3xxpm6890y0d97jisnxiyyay59ss2r9abyvpkv3by8i";
|
||||
sha256 = "14r3zddrppd0zxq76dd08dlj4qqncr7fj9cnrny4f0b5d0qgrd3f";
|
||||
};
|
||||
|
||||
#xenPatch = ./nvidia-2.6.24-xen.patch;
|
||||
|
@ -21,8 +22,11 @@ stdenv.mkDerivation {
|
|||
|
||||
dontStrip = true;
|
||||
|
||||
libPath = [
|
||||
gtkLibs.gtk gtkLibs.atk gtkLibs.pango gtkLibs.glib
|
||||
xlibs.libXext xlibs.libX11 xlibs.libXv
|
||||
glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11];
|
||||
|
||||
cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
|
||||
|
||||
programPath = stdenv.lib.makeLibraryPath [
|
||||
gtkLibs.gtk gtkLibs.atk gtkLibs.pango gtkLibs.glib xlibs.libXv
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{stdenv, fetchurl, x11, mesa, libXext}:
|
||||
{stdenv, fetchurl, x11, mesa}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "glxinfo-6.5.2";
|
||||
|
@ -20,10 +20,4 @@ stdenv.mkDerivation {
|
|||
ensureDir $out/bin
|
||||
cp glxinfo glxgears $out/bin
|
||||
";
|
||||
|
||||
postFixup = "
|
||||
for i in $out/bin/*; do
|
||||
patchelf --set-rpath /var/run/opengl-driver/lib:${libXext}/lib:$(patchelf --print-rpath $i) $i
|
||||
done
|
||||
";
|
||||
}
|
||||
|
|
|
@ -558,7 +558,6 @@ rec {
|
|||
|
||||
glxinfo = assert mesaSupported; import ../tools/graphics/glxinfo {
|
||||
inherit fetchurl stdenv x11 mesa;
|
||||
inherit (xlibs) libXext;
|
||||
};
|
||||
|
||||
gnugrep = useFromStdenv "gnugrep"
|
||||
|
@ -4288,7 +4287,7 @@ rec {
|
|||
};
|
||||
|
||||
nvidiaDrivers = import ../os-specific/linux/nvidia {
|
||||
inherit stdenv fetchurl kernel xlibs gtkLibs;
|
||||
inherit stdenv fetchurl kernel xlibs gtkLibs zlib;
|
||||
};
|
||||
|
||||
gw6c = import ../os-specific/linux/gw6c {
|
||||
|
|
Loading…
Reference in a new issue