mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 20:34:52 +03:00
* 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:
parent
14fbcfa64c
commit
3263d078dd
9
pkgs/games/quake3/demo/builder.sh
Normal file
9
pkgs/games/quake3/demo/builder.sh
Normal 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
|
19
pkgs/games/quake3/demo/default.nix
Normal file
19
pkgs/games/quake3/demo/default.nix
Normal 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";
|
||||
};
|
||||
|
||||
}
|
@ -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 {
|
20
pkgs/games/quake3/wrapper/builder.sh
Normal file
20
pkgs/games/quake3/wrapper/builder.sh
Normal 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
|
7
pkgs/games/quake3/wrapper/default.nix
Normal file
7
pkgs/games/quake3/wrapper/default.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{stdenv, fetchurl, game, paks}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "quake3";
|
||||
builder = ./builder.sh;
|
||||
inherit game paks;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
source $stdenv/setup
|
||||
|
||||
skip=165
|
||||
|
||||
mkdir $out
|
||||
|
||||
cd $out
|
||||
|
||||
tail +165 $src | tar xvfz -
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
@ -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
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user