* Get the Quake 3 demo data to work with the open source Quake 3.

quake3/demo takes care of downloading and patching the required PAK
  files.  quake3/wrapper calls the Quake binary with a synthesised
  directory of symlinks to activated PAK files.  This should make it
  easy to plug in the commercial PAKs, or third-party mods.

svn path=/nixpkgs/trunk/; revision=4611
This commit is contained in:
Eelco Dolstra 2006-01-27 23:51:36 +00:00
parent 14fbcfa64c
commit 3263d078dd
10 changed files with 74 additions and 52 deletions

View File

@ -0,0 +1,9 @@
source $stdenv/setup
tail -n +165 $demo | tar xvfz -
chmod -R +w .
tail -n +175 $update | tar xvfz -
chmod -R +w .
ensureDir $out/baseq3
cp demoq3/*.pk3 baseq3/*.pk3 $out/baseq3

View File

@ -0,0 +1,19 @@
{stdenv, fetchurl}:
stdenv.mkDerivation {
name = "quake3demo-1.11-6";
builder = ./builder.sh;
# This is needed for pak0.pk3.
demo = fetchurl {
url = http://linuv.uv.es/mirror/gentoo/distfiles/linuxq3ademo-1.11-6.x86.gz.sh;
md5 = "484610c1ce34272223a52ec331c99d5d";
};
# This is needed for the additional pak?.pk3 files.
update = fetchurl {
url = http://linuv.uv.es/mirror/gentoo/distfiles/linuxq3apoint-1.31.x86.run;
md5 = "2620b9eefb6d0775f766b6570870157a";
};
}

View File

@ -23,6 +23,16 @@ Need to put this in a wrapper.
Idem for adding the various *.pak files.
On i915:
LD_LIBRARY_PATH=/usr/X11R6/lib/modules/:/nix/store/9gy5fj9x7yvs72y31bm8db7mkl43br8w-libX11-1.0.0/lib:/nix/store/kcbq0frclmskk6mslzcc2qll2ky9l3y0-libXext-1.0.0/lib:/nix/store/54l9jk6l7papbh42z7sjdy1x84m255la-libXp-1.0.0/lib:. ./result/ioquake3.i386 +set fs_basepath ./x
With symlinks for: libexpat.so.0 libGL.so.1 libXxf86vm.so.1
Note that the libGL.so.1 for i915 dynamically loads
/usr/X11R6/lib/modules/dri/i915_dri.so (which depends on
libexpat.so).
*/
stdenv.mkDerivation {

View File

@ -0,0 +1,20 @@
source $stdenv/setup
ensureDir $out/baseq3
for i in $paks; do
if test -d "$paks/baseq3"; then
ln -s $paks/baseq3/* $out/baseq3/
fi
done
ensureDir $out/bin
cat >$out/bin/quake3 <<EOF
exec $game/ioquake3.i386 \
+set fs_basepath $out \
"\$@"
EOF
chmod +x $out/bin/quake3

View File

@ -0,0 +1,7 @@
{stdenv, fetchurl, game, paks}:
stdenv.mkDerivation {
name = "quake3";
builder = ./builder.sh;
inherit game paks;
}

View File

@ -1,9 +0,0 @@
source $stdenv/setup
skip=165
mkdir $out
cd $out
tail +165 $src | tar xvfz -

View File

@ -1,23 +0,0 @@
{stdenv, fetchurl, xlibs, mesa}:
assert stdenv.system == "i686-linux";
let {
raw = stdenv.mkDerivation {
name = "quake3demo-1.11-6";
src = fetchurl {
url = ftp://ftp.idsoftware.com/idstuff/quake3/linux/linuxq3ademo-1.11-6.x86.gz.sh;
md5 = "484610c1ce34272223a52ec331c99d5d";
};
builder = ./builder.sh;
};
body = stdenv.mkDerivation {
name = raw.name;
builder = ./make-wrapper.sh;
inherit raw mesa;
inherit (xlibs) libX11 libXext;
};
}

View File

@ -1,17 +0,0 @@
source $stdenv/setup
mkdir $out
mkdir $out/bin
mkdir $out/links
ln -s $raw/* $out/links
ln -s $out/links/bin/x86/glibc-2.1/q3demo $out/links/q3demo
glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
cat > $out/bin/q3ademo <<EOF
#! $SHELL -e
LD_LIBRARY_PATH=$libX11/lib:$libXext/lib:$mesa/lib $glibc/lib/ld-linux.so.2 $out/links/q3demo "\$@" +set s_initsound 0
EOF
chmod +x $out/bin/q3ademo

View File

@ -2086,12 +2086,18 @@ rec {
inherit (xlibs) xlibs;
};
quake3 = import ../games/quake3 {
quake3game = import ../games/quake3/game {
inherit fetchurl stdenv x11 SDL mesa openal;
};
quake3demo = (import ../games/quake3demo) {
inherit fetchurl stdenv xlibs mesa;
quake3demodata = import ../games/quake3/demo {
inherit fetchurl stdenv;
};
quake3demo = import ../games/quake3/wrapper {
inherit fetchurl stdenv;
game = quake3game;
paks = [quake3demodata];
};
ut2004demo = (import ../games/ut2004demo) {