* A quick hack to get accelerated OpenGL working: just use the driver
in /usr/lib/libGL.so.1 (which will typically load a driver in /usr/X11R6/lib/modules/dri). This has been tested on a i915 graphics card; it should work with most open source X.org drivers. For NVidia's proprietary drivers (which we cannot build ourselves anyway), some more symlinks are necessary; I'll add those later. So to get hardware-accelerated Quake 3, do: $ nix-env -p /nix/var/nix/profiles/opengl -i xorg-sys-opengl $ nix-env -i quake3-demo $ quake3 svn path=/nixpkgs/trunk/; revision=4613
This commit is contained in:
parent
7f74c406c4
commit
410f21887a
|
@ -19,10 +19,10 @@ This will probably be quite slow.
|
||||||
|
|
||||||
This program will look for a hardware-accelerated implementation of
|
This program will look for a hardware-accelerated implementation of
|
||||||
OpenGL in the "$profileName" profile of your Nix installation. For
|
OpenGL in the "$profileName" profile of your Nix installation. For
|
||||||
instance, to enable NVidia's accelerated driver on non-NixOS systems,
|
instance, to enable the (hopefully) accelerated driver provided by
|
||||||
try
|
your (non-NixOS) Linux distribution, try
|
||||||
|
|
||||||
$ nix-env -p $profile -i nvidia-sys-opengl
|
$ nix-env -p $profile -i xorg-sys-opengl
|
||||||
|
|
||||||
Alternatively, you can set the OPENGL_DRIVER environment variable to
|
Alternatively, you can set the OPENGL_DRIVER environment variable to
|
||||||
point at the package containing the OpenGL implementation.
|
point at the package containing the OpenGL implementation.
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
source $stdenv/setup
|
||||||
|
|
||||||
|
ensureDir $out/lib
|
||||||
|
|
||||||
|
ln -s /usr/lib/libGL.so.1 $out/lib/
|
||||||
|
|
||||||
|
for i in $neededLibs; do
|
||||||
|
ln -s $i/lib/*.so* $out/lib/
|
||||||
|
done
|
|
@ -0,0 +1,15 @@
|
||||||
|
# This is a very dirty hack to allow hardware acceleration of OpenGL
|
||||||
|
# applications for most (?) users. It will use the driver that your
|
||||||
|
# Linux distribution installed in /usr/lib/libGL.so.1. Hopefully,
|
||||||
|
# this driver uses hardware acceleration.
|
||||||
|
#
|
||||||
|
# Of course, use of the driver in /usr/lib is highly impure. But it
|
||||||
|
# might actually work ;-)
|
||||||
|
|
||||||
|
{stdenv, xlibs, expat}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
name = "xorg-sys-opengl";
|
||||||
|
builder = ./builder.sh;
|
||||||
|
neededLibs = [xlibs.libXxf86vm expat];
|
||||||
|
}
|
|
@ -1681,6 +1681,10 @@ rec {
|
||||||
inherit fetchurl stdenv;
|
inherit fetchurl stdenv;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xorg_sys_opengl = import ../os-specific/linux/opengl/xorg-sys {
|
||||||
|
inherit stdenv xlibs expat;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
### DATA
|
### DATA
|
||||||
|
|
||||||
|
|
|
@ -130,6 +130,7 @@ let {
|
||||||
jetty
|
jetty
|
||||||
|
|
||||||
quake3demo
|
quake3demo
|
||||||
|
xorg_sys_opengl
|
||||||
;};
|
;};
|
||||||
|
|
||||||
i686FreeBSDPkgs = {inherit (allPackages {system = "i686-freebsd";})
|
i686FreeBSDPkgs = {inherit (allPackages {system = "i686-freebsd";})
|
||||||
|
|
Loading…
Reference in New Issue