From 3263d078dd4e6476deef256cc835a5cdd30feab3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Jan 2006 23:51:36 +0000 Subject: [PATCH] * 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 --- pkgs/games/quake3/demo/builder.sh | 9 +++++++++ pkgs/games/quake3/demo/default.nix | 19 +++++++++++++++++++ pkgs/games/quake3/{ => game}/builder.sh | 0 pkgs/games/quake3/{ => game}/default.nix | 10 ++++++++++ pkgs/games/quake3/wrapper/builder.sh | 20 ++++++++++++++++++++ pkgs/games/quake3/wrapper/default.nix | 7 +++++++ pkgs/games/quake3demo/builder.sh | 9 --------- pkgs/games/quake3demo/default.nix | 23 ----------------------- pkgs/games/quake3demo/make-wrapper.sh | 17 ----------------- pkgs/system/all-packages-generic.nix | 12 +++++++++--- 10 files changed, 74 insertions(+), 52 deletions(-) create mode 100644 pkgs/games/quake3/demo/builder.sh create mode 100644 pkgs/games/quake3/demo/default.nix rename pkgs/games/quake3/{ => game}/builder.sh (100%) rename pkgs/games/quake3/{ => game}/default.nix (75%) create mode 100644 pkgs/games/quake3/wrapper/builder.sh create mode 100644 pkgs/games/quake3/wrapper/default.nix delete mode 100644 pkgs/games/quake3demo/builder.sh delete mode 100644 pkgs/games/quake3demo/default.nix delete mode 100644 pkgs/games/quake3demo/make-wrapper.sh 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 similarity index 100% rename from pkgs/games/quake3/builder.sh rename to pkgs/games/quake3/game/builder.sh diff --git a/pkgs/games/quake3/default.nix b/pkgs/games/quake3/game/default.nix similarity index 75% rename from pkgs/games/quake3/default.nix rename to 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 < $out/bin/q3ademo <