summary refs log tree commit diff
path: root/pkgs/os-specific/linux/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/opengl')
-rw-r--r--pkgs/os-specific/linux/opengl/xorg-sys/builder.sh9
-rw-r--r--pkgs/os-specific/linux/opengl/xorg-sys/default.nix15
2 files changed, 24 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh b/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh
new file mode 100644
index 00000000000..3894dbd207f
--- /dev/null
+++ b/pkgs/os-specific/linux/opengl/xorg-sys/builder.sh
@@ -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
diff --git a/pkgs/os-specific/linux/opengl/xorg-sys/default.nix b/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
new file mode 100644
index 00000000000..ae348b70c69
--- /dev/null
+++ b/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
@@ -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];
+}