diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2006-01-30 11:44:39 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2006-01-30 11:44:39 +0000 |
commit | 3ba77c1b4031f84602f597e4b993bd614d915c8f (patch) | |
tree | 9e85a8f42ae755cd4b363cc4a72e29ab31df0150 /pkgs/games | |
parent | 70c36821c6140ac0e61b66fab917395aea7950e0 (diff) |
* Get the Unreal Tournament 2004 demo to work with the new scheme for
handling OpenGL. svn path=/nixpkgs/trunk/; revision=4616
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/quake3/wrapper/builder.sh | 2 | ||||
-rw-r--r-- | pkgs/games/ut2004demo/builder.sh | 11 | ||||
-rw-r--r-- | pkgs/games/ut2004demo/default.nix | 5 | ||||
-rw-r--r-- | pkgs/games/ut2004demo/make-wrapper.sh | 9 |
4 files changed, 21 insertions, 6 deletions
diff --git a/pkgs/games/quake3/wrapper/builder.sh b/pkgs/games/quake3/wrapper/builder.sh index 3042e7548f092..4a477bac56114 100644 --- a/pkgs/games/quake3/wrapper/builder.sh +++ b/pkgs/games/quake3/wrapper/builder.sh @@ -12,6 +12,8 @@ done ensureDir $out/bin cat >$out/bin/quake3 <<EOF +#! $SHELL -e + mesa=$mesa $(cat $mesaSwitch) diff --git a/pkgs/games/ut2004demo/builder.sh b/pkgs/games/ut2004demo/builder.sh index 0e7e3ed50721c..d4c45fa9d14f1 100644 --- a/pkgs/games/ut2004demo/builder.sh +++ b/pkgs/games/ut2004demo/builder.sh @@ -8,6 +8,7 @@ mkdir $out (cd $out && tar xvf -) < ut2004demo.tar + # Patch the executable from ELF OS/ABI type `Linux' (3) to `SVR4' (0). # This doesn't seem to matter to ld-linux.so.2 at all, except that it # refuses to load `Linux' executables when invokes explicitly, that @@ -18,5 +19,13 @@ mkdir $out # patch Glibc so it accepts the `Linux' ELF type as well (why doesn't # it?); or to use FreeBSD's `brandelf' program to set to ELF type # (which is a bit cleaner than patching using `dd' :-) ). -(cd $out/System && (echo -en "\000" | dd bs=1 seek=7 of=ut2004-bin conv=notrunc)) +#(cd $out/System && (echo -en "\000" | dd bs=1 seek=7 of=ut2004-bin conv=notrunc)) + + +# Set the ELF interpreter to our own Glibc. +glibc=$(cat $NIX_GCC/nix-support/orig-glibc) + +for i in "$out/System/ucc-bin" "$out/System/ut2004-bin"; do + patchelf --set-interpreter "$glibc/lib/ld-linux.so.2" "$i" +done diff --git a/pkgs/games/ut2004demo/default.nix b/pkgs/games/ut2004demo/default.nix index e079e7819be1c..1c8b42891a4b3 100644 --- a/pkgs/games/ut2004demo/default.nix +++ b/pkgs/games/ut2004demo/default.nix @@ -5,9 +5,9 @@ assert stdenv.system == "i686-linux"; let { raw = stdenv.mkDerivation { - name = "ut2004demo-3120"; + name = "ut2004-demo-3120"; src = fetchurl { - url = ftp://ftp.infogrames.net/demos/ut2004/ut2004-lnx-demo-3120.run.bz2; + url = http://ftp.gameaholic.com/pub/demos/ut2004-lnx-demo-3120.run.bz2; md5 = "da200b043add9d083f6aa7581e6829f0"; }; builder = ./builder.sh; @@ -18,6 +18,7 @@ let { builder = ./make-wrapper.sh; inherit raw mesa; inherit (xlibs) libX11 libXext; + mesaSwitch = ../../build-support/opengl/mesa-switch.sh; }; } diff --git a/pkgs/games/ut2004demo/make-wrapper.sh b/pkgs/games/ut2004demo/make-wrapper.sh index d165127f0a6e5..06a809d4cbdc7 100644 --- a/pkgs/games/ut2004demo/make-wrapper.sh +++ b/pkgs/games/ut2004demo/make-wrapper.sh @@ -1,16 +1,19 @@ source $stdenv/setup -mkdir $out -mkdir $out/bin +ensureDir $out/bin glibc=$(cat $NIX_GCC/nix-support/orig-glibc) cat > $out/bin/ut2004demo <<EOF #! $SHELL -e +mesa=$mesa + +$(cat $mesaSwitch) + cd $raw/System -LD_LIBRARY_PATH=$libX11/lib:$libXext/lib:/usr/lib:$mesa/lib $glibc/lib/ld-linux.so.2 ./ut2004-bin "\$@" +LD_LIBRARY_PATH=$libX11/lib:$libXext/lib\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ./ut2004-bin "\$@" EOF chmod +x $out/bin/ut2004demo |