* ioquake: updated to 1.34rc3.

* rss-glx: fixed the build.
* Removed the OpenGL wrapper stuff, it's no longer needed (thanks to
  the RUNPATH you just need to put the appropriate libGL.so in the
  LD_LIBRARY_PATH). 

svn path=/nixpkgs/trunk/; revision=12093
This commit is contained in:
Eelco Dolstra 2008-06-14 20:55:48 +00:00
parent 80b2254cbb
commit 7219a09001
9 changed files with 45 additions and 93 deletions

View File

@ -1,45 +0,0 @@
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
# OpenGL driver for current X server on NixOS.
if test -d /var/run/opengl-driver; then
OPENGL_DRIVER=/var/run/opengl-driver
fi
fi
if test -z "$OPENGL_DRIVER"; then
cat <<EOF
======================================================================
This program uses OpenGL for 3D graphics. For best performance, you
should use a hardware-accelerated implementation of OpenGL. Since you
have not enabled one, a software implementation (Mesa) will be used.
This will probably be quite slow.
This program will look for a hardware-accelerated implementation of
OpenGL in the "$profileName" profile of your Nix installation. For
instance, to enable the (hopefully) accelerated driver provided by
your (non-NixOS) Linux distribution, try
$ nix-env -p $profile -i xorg-sys-opengl
Alternatively, you can set the OPENGL_DRIVER environment variable to
point at the package containing the OpenGL implementation.
======================================================================
EOF
OPENGL_DRIVER=$mesa
fi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}$OPENGL_DRIVER/lib
hook="$OPENGL_DRIVER/nix-support/opengl-hook"
if test -e "$hook"; then
source "$hook"
fi

View File

@ -1,7 +0,0 @@
source $stdenv/setup
ensureDir $out/baseq3
installTargets=copyfiles
installFlags="COPYDIR=$out"
genericBuild

View File

@ -1,11 +1,29 @@
{stdenv, fetchurl, x11, SDL, mesa, openal}:
stdenv.mkDerivation {
name = "quake3-icculus-1.33pre526";
name = "ioquake3-1.34-pre-rc3";
src = fetchurl {
url = http://nix.cs.uu.nl/dist/tarballs/quake3-icculus-r526.tar.bz2;
md5 = "63429347b918052c27cdb5c1d15939ad";
url = http://ioquake3.org/files/ioquake3_1.34-rc3.tar.bz2;
sha256 = "008vah60z0n9h1qp373xbqvhwfbyywbbhd1np0h0yw66g0qzchzv";
};
builder = ./builder.sh;
patchFlags = "-p0";
patches = [
# Fix for compiling on gcc 4.2.
(fetchurl {
url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/games-fps/quake3/files/quake3-1.34_rc3-gcc42.patch?rev=1.1";
sha256 = "06c9lxfczcby5q29pim231mr2wdkvbv36xp9zbxp9vk0dfs8rv9x";
})
];
buildInputs = [x11 SDL mesa openal];
preInstall = ''
ensureDir $out/baseq3
installTargets=copyfiles
installFlags="COPYDIR=$out"
'';
}

View File

@ -1,6 +1,5 @@
source $stdenv/setup
ensureDir $out/baseq3
for i in $paks; do
if test -d "$paks/baseq3"; then
@ -8,20 +7,9 @@ for i in $paks; do
fi
done
ensureDir $out/bin
cat >$out/bin/quake3 <<EOF
#! $SHELL -e
mesa=$mesa
$(cat $mesaSwitch)
exec $game/ioquake3.i386 \
+set fs_basepath $out \
+set r_allowSoftwareGL 1 \
"\$@"
EOF
chmod +x $out/bin/quake3
# We add Mesa to the end of $LD_LIBRARY_PATH to provide fallback
# software rendering. GCC is needed so that libgcc_s.so can be found
# when Mesa is used.
makeWrapper $game/ioquake3.i386 $out/bin/quake3 \
--suffix-each LD_LIBRARY_PATH ':' "$mesa/lib $gcc/lib" \
--add-flags "+set fs_basepath $out +set r_allowSoftwareGL 1"

View File

@ -1,11 +1,14 @@
{stdenv, fetchurl, game, paks, mesa, name, description}:
{stdenv, fetchurl, game, paks, mesa, name, description, makeWrapper}:
stdenv.mkDerivation {
builder = ./builder.sh;
inherit game paks mesa name;
mesaSwitch = ../../../build-support/opengl/mesa-switch.sh;
buildInputs = [makeWrapper];
inherit game paks mesa name;
gcc = stdenv.gcc.gcc;
meta = {
inherit description;
};

View File

@ -18,7 +18,6 @@ let {
builder = ./make-wrapper.sh;
inherit raw mesa;
inherit (xlibs) libX11 libXext;
mesaSwitch = ../../build-support/opengl/mesa-switch.sh;
};
}

View File

@ -5,10 +5,6 @@ ensureDir $out/bin
cat > $out/bin/ut2004demo <<EOF
#! $SHELL -e
mesa=$mesa
$(cat $mesaSwitch)
cd $raw/System
LD_LIBRARY_PATH=$libX11/lib:$libXext/lib\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ./ut2004-bin "\$@"

View File

@ -1,16 +1,16 @@
{stdenv, fetchurl, x11, mesa}:
{stdenv, fetchurl, x11, mesa, pkgconfig, imagemagick, libtiff, bzip2}:
stdenv.mkDerivation {
name = "rss-glx-0.8.1";
builder = ./builder.sh;
#builder = ./builder.sh;
src = fetchurl {
url = mirror://sourceforge/rss-glx/rss-glx_0.8.1.tar.bz2;
md5 = "a2bdf0e10ee4e89c8975f313c5c0ba6f";
};
buildInputs = [x11 mesa];
inherit mesa;
mesaSwitch = ../../../build-support/opengl/mesa-switch.sh;
buildInputs = [x11 mesa pkgconfig imagemagick libtiff bzip2];
NIX_CFLAGS_COMPILE = "-I${imagemagick}/include/ImageMagick";
}

View File

@ -6758,9 +6758,9 @@ let pkgs = rec {
};
quake3demo = import ../games/quake3/wrapper {
name = "quake3-demo";
name = "quake3-demo-${quake3game.name}";
description = "Demo of Quake 3 Arena, a classic first-person shooter";
inherit fetchurl stdenv mesa;
inherit fetchurl stdenv mesa makeWrapper;
game = quake3game;
paks = [quake3demodata];
};
@ -7078,7 +7078,7 @@ let pkgs = rec {
};
rssglx = import ../misc/screensavers/rss-glx {
inherit fetchurl stdenv x11 mesa;
inherit fetchurl stdenv x11 mesa pkgconfig imagemagick libtiff bzip2;
};
xlockmore = import ../misc/screensavers/xlockmore {
@ -7116,7 +7116,7 @@ let pkgs = rec {
*/
texFunctions = import ../misc/tex/nix {
inherit stdenv perl tetex graphviz ghostscript imagemagick;
inherit stdenv perl tetex graphviz ghostscript;
};
texLiveFun = builderDefsPackage (import ../misc/tex/texlive) {