summary refs log tree commit diff
path: root/pkgs/games/quake3
diff options
context:
space:
mode:
authorEelco Dolstra2006-01-27 23:51:36 +0000
committerEelco Dolstra2006-01-27 23:51:36 +0000
commit3263d078dd4e6476deef256cc835a5cdd30feab3 (patch)
treed89662c9aa9fa71f9393b24bcfb2bd4aef6cc5bb /pkgs/games/quake3
parent14fbcfa64c1dd3f0305d99089b3cda439c388b27 (diff)
* 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
Diffstat (limited to 'pkgs/games/quake3')
-rw-r--r--pkgs/games/quake3/demo/builder.sh9
-rw-r--r--pkgs/games/quake3/demo/default.nix19
-rw-r--r--pkgs/games/quake3/game/builder.sh (renamed from pkgs/games/quake3/builder.sh)0
-rw-r--r--pkgs/games/quake3/game/default.nix (renamed from pkgs/games/quake3/default.nix)10
-rw-r--r--pkgs/games/quake3/wrapper/builder.sh20
-rw-r--r--pkgs/games/quake3/wrapper/default.nix7
6 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/games/quake3/demo/builder.sh b/pkgs/games/quake3/demo/builder.sh
new file mode 100644
index 000000000000..640401a0ec85
--- /dev/null
+++ b/pkgs/games/quake3/demo/builder.sh
@@ -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
diff --git a/pkgs/games/quake3/demo/default.nix b/pkgs/games/quake3/demo/default.nix
new file mode 100644
index 000000000000..497e981a9165
--- /dev/null
+++ b/pkgs/games/quake3/demo/default.nix
@@ -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";
+  };
+  
+}
diff --git a/pkgs/games/quake3/builder.sh b/pkgs/games/quake3/game/builder.sh
index 82025c76903d..82025c76903d 100644
--- a/pkgs/games/quake3/builder.sh
+++ b/pkgs/games/quake3/game/builder.sh
diff --git a/pkgs/games/quake3/default.nix b/pkgs/games/quake3/game/default.nix
index b91a7ece2b43..9117e26b37b7 100644
--- a/pkgs/games/quake3/default.nix
+++ b/pkgs/games/quake3/game/default.nix
@@ -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 {
diff --git a/pkgs/games/quake3/wrapper/builder.sh b/pkgs/games/quake3/wrapper/builder.sh
new file mode 100644
index 000000000000..6162adfa824c
--- /dev/null
+++ b/pkgs/games/quake3/wrapper/builder.sh
@@ -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
diff --git a/pkgs/games/quake3/wrapper/default.nix b/pkgs/games/quake3/wrapper/default.nix
new file mode 100644
index 000000000000..512ff21d7ce4
--- /dev/null
+++ b/pkgs/games/quake3/wrapper/default.nix
@@ -0,0 +1,7 @@
+{stdenv, fetchurl, game, paks}:
+
+stdenv.mkDerivation {
+  name = "quake3";
+  builder = ./builder.sh;
+  inherit game paks;
+}