From 7f74c406c4dab2a4aa9c3c818c14f59b3d28829d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 28 Jan 2006 00:41:16 +0000 Subject: [PATCH] * In Quake 3, by default use Mesa as the OpenGL implementation. But allow the OpenGL implementation to be overriden through the OPENGL_DRIVER environment variable. If it is not set, we use the implementation installed in the profile /nix/var/nix/profiles/opengl, allowing easy late binding by the user, e.g., $ nix-env -p /nix/var/nix/profiles/opengl -i nvidia-sys-opengl might install the NVidia OpenGL implementation. The code that does this is not specific to Quake 3: it has been factored out into build-support/opengl/mesa-switch.sh. Presumably any application that requires hardware-accelerated OpenGL needs it. * Add the Quake 3 demo to the cache. svn path=/nixpkgs/trunk/; revision=4612 --- pkgs/build-support/opengl/mesa-switch.sh | 41 ++++++++++++++++++++++++ pkgs/games/quake3/wrapper/builder.sh | 5 +++ pkgs/games/quake3/wrapper/default.nix | 6 ++-- pkgs/system/all-packages-generic.nix | 3 +- pkgs/system/populate-cache.nix | 2 ++ 5 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 pkgs/build-support/opengl/mesa-switch.sh diff --git a/pkgs/build-support/opengl/mesa-switch.sh b/pkgs/build-support/opengl/mesa-switch.sh new file mode 100644 index 000000000000..bc9445319dd9 --- /dev/null +++ b/pkgs/build-support/opengl/mesa-switch.sh @@ -0,0 +1,41 @@ +profileName=opengl +profileDir=/nix/var/nix/profiles +profile=$profileDir/$profileName + +if test -z "$OPENGL_DRIVER"; then + if test -d "$profile/lib"; then + OPENGL_DRIVER=$profile + fi +fi + +if test -z "$OPENGL_DRIVER"; then + + cat <$out/bin/quake3 <