about summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
authorWouter den Breejen <uu@denbreejen.net>2007-05-28 14:10:46 +0000
committerWouter den Breejen <uu@denbreejen.net>2007-05-28 14:10:46 +0000
commit5200276c3b5a475242835a6c171c8f5c2e6c044e (patch)
treeb4173829c6dc21b6782a677d78cf1655b278b74b /pkgs/os-specific/linux
parent1dcd8601bffe904714a6d4db0a9675ae643c8968 (diff)
nixpkgs dir: nvidia and libsrvg
svn path=/nixpkgs/trunk/; revision=8785
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.20.nix2
-rwxr-xr-xpkgs/os-specific/linux/nvidia/builder.sh93
-rw-r--r--pkgs/os-specific/linux/nvidia/default.nix35
-rwxr-xr-xpkgs/os-specific/linux/nvidia/nvidiaload.sh5
-rw-r--r--pkgs/os-specific/linux/opengl/xorg-sys/builder.sh3
-rw-r--r--pkgs/os-specific/linux/opengl/xorg-sys/default.nix1
6 files changed, 138 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.20.nix b/pkgs/os-specific/linux/kernel/linux-2.6.20.nix
index 0d3df58459c3b..ab9acf26d96c4 100644
--- a/pkgs/os-specific/linux/kernel/linux-2.6.20.nix
+++ b/pkgs/os-specific/linux/kernel/linux-2.6.20.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
     sha256 = "1n0xgqckj64ga3l53l8lk1591lfcn6zcrqg3phz2m0y841ck5qlk";
   };
   
-  patches = map (p: p.patch) kernelPatches;
+  patches = [./2.6.20-paravirt-nvidia.patch] ++ (map (p: p.patch) kernelPatches);
   extraConfig = lib.concatStrings (map (p: "\n" + p.extraConfig + "\n") kernelPatches);
 
   config =
diff --git a/pkgs/os-specific/linux/nvidia/builder.sh b/pkgs/os-specific/linux/nvidia/builder.sh
new file mode 100755
index 0000000000000..3d8f907c08a53
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia/builder.sh
@@ -0,0 +1,93 @@
+source $stdenv/setup
+
+echo "Building linux driver against kernel: " $kernelOutPath;
+echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
+
+echo $nvidiasrc
+cp $nvidiasrc .
+chmod 755 ./*-NVIDIA*
+./*-NVIDIA* -x
+cd NVIDIA*/
+
+cd usr/src/nv/
+pwd -P
+
+#Clean up
+#make clean
+
+#Create the module
+echo $out
+mkdir $out
+make SYSSRC=$kernelOutPath/lib/modules/2.*/build/ module	
+
+#go to the usr dir of the nvidia package
+cd ../../
+
+echo "Copying all files to " $out/lib""
+
+cp -R * $out
+
+#add extra symlinks in $out
+ln -sf $out/lib/libGLcore.so.1.0.9755 $out/lib/libGLcore.so
+ln -sf $out/lib/libGLcore.so.1.0.9755 $out/lib/libGLcore.so.1
+ln -sf $out/lib/libGL.so.1.0.9755 $out/lib/libGL.so
+ln -sf $out/lib/libGL.so.1.0.9755 $out/lib/libGL.so.1
+ln -sf $out/lib/libnvidia-cfg.so.1.0.9755 $out/lib/libnvidia-cfg.so.1
+ln -sf $out/lib/libnvidia-tls.so.1.0.9755 $out/lib/libnvidia-tls.so.1
+ln -sf $out/X11R6/lib/libXvMCNVIDIA.so.1.0.9755 $out/X11R6/lib/libXvMCNVIDIA.so.1
+ln -sf $out/X11R6/lib/libXvMCNVIDIA.so.1.0.9755 $out/lib/libXvMCNVIDIA.so.1
+ln -sf $out/X11R6/lib/modules/libnvidia-wfb.so.1.0.9755 $out/X11R6/lib/modules/libnvidia-wfb.so.1
+ln -sf $out/X11R6/lib/modules/libnvidia-wfb.so.1.0.9755 $out/lib/libnvidia-wfb.so.1
+ln -sf $out/X11R6/lib/modules/extensions/libglx.so.1.0.9755 $out/X11R6/lib/modules/extensions/libglx.so.1
+ln -sf $out/X11R6/lib/modules/extensions/libglx.so.1.0.9755 $out/lib/libglx.so.1
+
+#TODO: patchelf binaries !
+#patchelf --set-interpreter ${path glibc TODO  /lib/ld-linux.so.2 $out/bin/....
+
+#from dep on xorg-sys-opengl: add symlinks in /usr/lib/ (especially libGL.so.1) to the real location...
+
+ensureDir /usr/lib/
+cd /usr/lib
+ln -sf $out/lib/libGLcore.so.1.* libGLcore.so.1
+ln -sf $out/lib/libGL.la libGL.la
+ln -sf $out/lib/libGL.so.1.* libGL.so.1
+ln -sf $out/lib/libnvidia-cfg.so.1.* libnvidia-cfg.so.1
+ln -sf $out/lib/libnvidia-tls.so.1.* libnvidia-tls.so.1
+ensureDir /usr/lib/tls/
+ln -sf $out/lib/tls/libnvidia-tls.so.1.* /usr/lib/tls/libnvidia-tls.so.1
+ln -sf $out/X11R6/lib/modules/extensions/libglx.so.1.* libglx.so.1
+ln -sf $out/X11R6/lib/modules/libnvidia-wfb.so.1.* libnvidia-wfb.so.1
+ln -sf $out/X11R6/lib/modules/drivers/nvidia_drv.so nvidia_drv.so
+ln -sf $out/X11R6/lib/libXvMCNVIDIA.so.1.* libXvMCNVIDIA.so.1
+ln -sf $out/bin/tls_test_dso.so tls_test_dso.so
+ln -sf $out/src/nv/nvidia.ko nvidia.ko
+
+echo "YOU! need to add symlinks as root to the libs in the current $xorgOutPath/lib/xorg/modules/extensions/     (especially libglx.so)"
+rwlibs="
+cd $xorgOutPath/lib/xorg/modules/extensions/;
+mv libglx.so libglx.so.org;
+mv libglx.la libglx.la.org;
+mv libGLcore.so libGLcore.so.org;
+ln -sf /usr/lib/libglx.so.1 libglx.so;
+ln -sf /usr/lib/libglx.so.1 libglx.so.1;
+ln -sf /usr/lib/libGLcore.so.1 libGLcore.so;
+ln -sf /usr/lib/libGLcore.so.1 libGLcore.so.1;
+ln -sf /usr/lib/libGL.so.1 libGL.so;
+ln -sf /usr/lib/libGL.so.1 libGL.so.1;
+ln -sf /usr/lib/libglx.la libglx.la;
+ln -sf /usr/lib/libglx.so.1 libglx.so;
+ln -sf /usr/lib/libglx.so.1 libglx.so.1;
+ln -sf /usr/lib/nvidia_drv.so nvidia_drv.so;
+ln -sf $out/src/nv/nvidia.ko $kernelOutPath/lib/modules/$(uname -r)/kernel/drivers/video/nvidia/nvidia.ko;
+
+"
+rwlibsfile="$out/bin/nvidia-rewriteLibs.sh"
+
+echo "--------------------------------------------------------"
+echo "YOU MUST RUN $rwlibsfile as ROOT after this installation"
+echo "--------------------------------------------------------"
+echo $rwlibs > $rwlibsfile
+chmod 755 $rwlibsfile
+
+sleep 5
+
diff --git a/pkgs/os-specific/linux/nvidia/default.nix b/pkgs/os-specific/linux/nvidia/default.nix
new file mode 100644
index 0000000000000..e7c5215f015ab
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia/default.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, fetchurl
+
+, kernel
+, coreutils
+, xorg_server
+
+#deps
+,libXext, libX11
+
+}:
+
+stdenv.mkDerivation {
+  name = "nvidiaDrivers";
+  builder = ./builder.sh;
+  
+  nvidiasrc = fetchurl {										#we cannot use $src since this variable is also used in the nvidia sources
+    url = http://www.denbreejen.net/public/nixos/NVIDIA-Linux-x86-1.0-9755-pkg1.run;
+    sha256 = "1985373866b1dcae80f3da66dbbbd3c28ad76e75a620865be321ee870ad9d1ea";
+  };
+
+  kernelOutPath = kernel.outPath;
+  xorgOutPath = xorg_server.outPath;
+
+  buildInputs = [
+    libXext libX11
+  ];
+
+  propagatedBuildInputs = [
+    libX11 libXext
+  ];
+
+  NIX_LDFLAGS = "-rpath ${libX11}/lib -rpath ${libXext}/lib";
+  LD_LIBRARY_PATH = "${libX11}/lib:${libXext}/lib/";
+}
diff --git a/pkgs/os-specific/linux/nvidia/nvidiaload.sh b/pkgs/os-specific/linux/nvidia/nvidiaload.sh
new file mode 100755
index 0000000000000..4250a06f57742
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia/nvidiaload.sh
@@ -0,0 +1,5 @@
+#! /bin/sh -e
+
+insmod $(nix-showOutPath.sh nvidiaDrivers)/src/nv/nvidia.ko
+
+#initctl start xserver
diff --git a/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh b/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh
index ef5126f1d9bf1..eb5dba4811872 100644
--- a/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh
+++ b/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh
@@ -10,3 +10,6 @@ ln -s /usr/lib/libnvidia-tls.so.1 $out/lib/
 for i in $neededLibs; do
     ln -s $i/lib/*.so* $out/lib/
 done
+
+
+
diff --git a/pkgs/os-specific/linux/opengl/xorg-sys/default.nix b/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
index 3bc1f73cfef0b..c22257ff99f24 100644
--- a/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
+++ b/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
@@ -13,3 +13,4 @@ stdenv.mkDerivation {
   builder = ./builder.sh;
   neededLibs = [xlibs.libXxf86vm xlibs.libXext expat libdrm];
 }
+