nixpkgs dir: nvidia and libsrvg

svn path=/nixpkgs/trunk/; revision=8785
This commit is contained in:
Wouter den Breejen 2007-05-28 14:10:46 +00:00
parent 1dcd8601bf
commit 5200276c3b
12 changed files with 233 additions and 8 deletions

View file

@ -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
";
}

View file

@ -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

View file

@ -27,3 +27,4 @@ stdenv.mkDerivation {
realBuilder = perl + "/bin/perl";
args = ["-w" ./builder.pl];
}

View file

@ -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 ];
}

View file

@ -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 =

View file

@ -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

View file

@ -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/";
}

View file

@ -0,0 +1,5 @@
#! /bin/sh -e
insmod $(nix-showOutPath.sh nvidiaDrivers)/src/nv/nvidia.ko
#initctl start xserver

View file

@ -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

View file

@ -13,3 +13,4 @@ stdenv.mkDerivation {
builder = ./builder.sh;
neededLibs = [xlibs.libXxf86vm xlibs.libXext expat libdrm];
}

View file

@ -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
";
}

View file

@ -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;
};