From 5200276c3b5a475242835a6c171c8f5c2e6c044e Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Mon, 28 May 2007 14:10:46 +0000 Subject: [PATCH] nixpkgs dir: nvidia and libsrvg svn path=/nixpkgs/trunk/; revision=8785 --- .../window-managers/compiz/default.nix | 16 +++- .../window-managers/compiz/extra.nix | 2 +- pkgs/build-support/buildenv/default.nix | 1 + .../development/libraries/librsvg/default.nix | 17 ++++ .../os-specific/linux/kernel/linux-2.6.20.nix | 2 +- pkgs/os-specific/linux/nvidia/builder.sh | 93 +++++++++++++++++++ pkgs/os-specific/linux/nvidia/default.nix | 35 +++++++ pkgs/os-specific/linux/nvidia/nvidiaload.sh | 5 + .../linux/opengl/xorg-sys/builder.sh | 3 + .../linux/opengl/xorg-sys/default.nix | 1 + pkgs/tools/graphics/glxinfo/default.nix | 4 +- pkgs/top-level/all-packages.nix | 62 ++++++++++++- 12 files changed, 233 insertions(+), 8 deletions(-) create mode 100644 pkgs/development/libraries/librsvg/default.nix create mode 100755 pkgs/os-specific/linux/nvidia/builder.sh create mode 100644 pkgs/os-specific/linux/nvidia/default.nix create mode 100755 pkgs/os-specific/linux/nvidia/nvidiaload.sh diff --git a/pkgs/applications/window-managers/compiz/default.nix b/pkgs/applications/window-managers/compiz/default.nix index 3ba52518d38e..25cee0600bb6 100644 --- a/pkgs/applications/window-managers/compiz/default.nix +++ b/pkgs/applications/window-managers/compiz/default.nix @@ -1,6 +1,9 @@ { stdenv, fetchurl, pkgconfig, libpng, libXcomposite, libXfixes , libXdamage, libXrandr, libXinerama, libICE, libSM , startupnotification, libXrender, xextproto, mesa, gtk, libwnck, GConf +, libgnome, libgnomeui, metacity +, gnomegtk, glib, pango, libglade, libgtkhtml, gtkhtml, libgnomecanvas, libgnomeprint, libgnomeprintui, gnomepanel +, librsvg, fuse }: stdenv.mkDerivation { @@ -13,11 +16,18 @@ stdenv.mkDerivation { ./tfp-server-extension.patch ]; buildInputs = [ - pkgconfig libXrender xextproto gtk libwnck GConf + pkgconfig libXrender xextproto gtk libwnck GConf libgnome libgnomeui metacity gnomegtk glib pango libglade libgtkhtml gtkhtml libgnomecanvas libgnomeprint libgnomeprintui gnomepanel librsvg fuse ]; propagatedBuildInputs = [ libpng libXcomposite libXfixes libXdamage libXrandr libXinerama - libICE libSM startupnotification mesa + libICE libSM startupnotification mesa GConf ]; - configureFlags = "--enable-gtk"; + configureFlags = "--enable-gtk --enable-fuse --enable-annotate --enable-librsvg"; + + postFixup = " + for i in $out/bin/*; do + patchelf --set-rpath /var/state/opengl-driver/lib:$(patchelf --print-rpath $i) $i + done + "; + } diff --git a/pkgs/applications/window-managers/compiz/extra.nix b/pkgs/applications/window-managers/compiz/extra.nix index af2671945d24..75d640ca1cad 100644 --- a/pkgs/applications/window-managers/compiz/extra.nix +++ b/pkgs/applications/window-managers/compiz/extra.nix @@ -5,7 +5,7 @@ stdenv.mkDerivation { name = "compiz-extra-20070305"; src = fetchurl { url = http://gandalfn.club.fr/ubuntu/compiz-extra/compiz-extra-latest.tar.bz2; - sha256 = "1cm5cayhpnlhj0fhg8lqghdk52h9gmv4jv98zzadj3r3fd8mwr9z"; + sha256 = "7fc7faafccfdf22dea7ac1de6629dcb55ec63d84fcb57a14559309cf284fa94f"; }; buildInputs = [ pkgconfig compiz perl perlXMLParser GConf dbus gtk diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index 9f150d8bda20..95f5f2304c01 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -27,3 +27,4 @@ stdenv.mkDerivation { realBuilder = perl + "/bin/perl"; args = ["-w" ./builder.pl]; } + diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix new file mode 100644 index 000000000000..584cbf02cfed --- /dev/null +++ b/pkgs/development/libraries/librsvg/default.nix @@ -0,0 +1,17 @@ +{stdenv, fetchurl +, pkgconfig, glib, cairo, fontconfig, freetype, pango, gtk +, libxml2, libart + +}: + +#required: libxml and libart at a minimum, while providing extra features when used with libcroco, libgsf, and mozilla + +stdenv.mkDerivation { + name = "librsvg-2.16.1"; + src = fetchurl { + url = http://ftp.gnome.org/pub/GNOME/sources/librsvg/2.16/librsvg-2.16.1.tar.gz; + md5 = "2bbd4f634ef229cbb1552b574aacf0bd"; + }; + propagatedBuildInputs = [ libxml2 libart pkgconfig glib pkgconfig cairo fontconfig freetype pango gtk ]; + +} 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 0d3df58459c3..ab9acf26d96c 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 000000000000..3d8f907c08a5 --- /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 000000000000..e7c5215f015a --- /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 000000000000..4250a06f5774 --- /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 ef5126f1d9bf..eb5dba481187 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 3bc1f73cfef0..c22257ff99f2 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]; } + diff --git a/pkgs/tools/graphics/glxinfo/default.nix b/pkgs/tools/graphics/glxinfo/default.nix index 8ebf5e816fd8..8dc5c1569dd8 100644 --- a/pkgs/tools/graphics/glxinfo/default.nix +++ b/pkgs/tools/graphics/glxinfo/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, x11, mesa}: +{stdenv, fetchurl, x11, mesa, libXext}: stdenv.mkDerivation { name = "glxinfo-6.5.2"; @@ -23,7 +23,7 @@ stdenv.mkDerivation { postFixup = " for i in $out/bin/*; do - patchelf --set-rpath /var/state/opengl-driver/lib:$(patchelf --print-rpath $i) $i + patchelf --set-rpath /var/state/opengl-driver/lib:${libXext}/lib:$(patchelf --print-rpath $i) $i done "; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0ccdb7bb9b52..fd23d0128899 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -339,6 +339,7 @@ rec { glxinfo = assert mesaSupported; import ../tools/graphics/glxinfo { inherit fetchurl stdenv x11 mesa; + inherit (xlibs) libXext; }; gnugrep = useFromStdenv (stdenv ? gnugrep) stdenv.gnugrep @@ -453,6 +454,12 @@ rec { inherit fetchurl stdenv libcap; }; + nvidiaDrivers = import ../os-specific/linux/nvidia { + inherit stdenv fetchurl kernel coreutils; + xorg_server = xorg.xorgserver; + inherit (xlibs) libX11 libXext; + }; + openssh = import ../tools/networking/openssh { inherit fetchurl stdenv zlib openssl pam perl; pamSupport = true; @@ -1245,6 +1252,17 @@ rec { inherit fetchurl stdenv pkgconfig expat; }; + dbus1 = import ../development/libraries/dbus/dbus1.nix { + inherit fetchurl stdenv pkgconfig expat; + }; + + dbus1_qt3 = import ../development/libraries/dbus/dbus_qt3.nix { + inherit fetchurl stdenv pkgconfig; + inherit (xlibs) xextproto libXft libXrender libXrandr randrproto libXmu libXinerama xineramaproto libXcursor; + inherit (xlibs) libX11 libXext; + inherit zlib libjpeg perl qt3 dbus1 libpng; + }; + dbus_glib = import ../development/libraries/dbus-glib { inherit fetchurl stdenv pkgconfig gettext dbus expat; inherit (gtkLibs) glib; @@ -2239,6 +2257,25 @@ rec { inherit fetchurl stdenv; }; + kernelHeaders_2_6_20_7 = import ../os-specific/linux/kernel-headers/2.6.20.7.nix { + inherit fetchurl stdenv; + }; + + kernelHeadersArm = import ../os-specific/linux/kernel-headers-cross { + inherit fetchurl stdenv; + cross = "arm-linux"; + }; + + kernelHeadersMips = import ../os-specific/linux/kernel-headers-cross { + inherit fetchurl stdenv; + cross = "mips-linux"; + }; + + kernelHeadersSparc = import ../os-specific/linux/kernel-headers-cross { + inherit fetchurl stdenv; + cross = "sparc-linux"; + }; + kernelscripts = import ../os-specific/linux/kernelscripts { inherit stdenv module_init_tools kernel; modules = []; @@ -2272,6 +2309,14 @@ rec { inherit fetchurl stdenv libsepol; }; + librsvg = import ../development/libraries/librsvg { + inherit fetchurl stdenv; + inherit libxml2 pkgconfig cairo fontconfig freetype; + inherit (gtkLibs) glib pango gtk; + #gtkLibs = gtkLibs210; #need gtk+ + libart = gnome.libart_lgpl; + }; + libsepol = import ../os-specific/linux/libsepol { inherit fetchurl stdenv; }; @@ -2568,8 +2613,14 @@ rec { libXinerama libICE libSM libXrender xextproto; inherit (gnome) startupnotification libwnck GConf; inherit (gtkLibs) gtk; + inherit (gnome) libgnome libgnomeui metacity + glib pango libglade libgtkhtml gtkhtml + libgnomecanvas libgnomeprint + libgnomeprintui gnomepanel; + gnomegtk = gnome.gtk; + inherit librsvg fuse; }; - + compizExtra = import ../applications/window-managers/compiz/extra.nix { inherit fetchurl stdenv pkgconfig compiz perl perlXMLParser dbus; inherit (gnome) GConf; @@ -3173,10 +3224,19 @@ rec { inherit fetchurl stdenv tetex lazylist; }; + putty = import ../applications/networking/remote/putty { + inherit stdenv fetchurl ncurses; + inherit (gtkLibs1x) gtk; + }; + rssglx = import ../misc/screensavers/rss-glx { inherit fetchurl stdenv x11 mesa; }; + samba = import ../../../services/samba { + inherit stdenv fetchurl; + }; + saneBackends = import ../misc/sane-backends { inherit fetchurl stdenv; };