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/ut2004demo | |
parent | 70c36821c6140ac0e61b66fab917395aea7950e0 (diff) | |
download | nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.tar nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.tar.gz nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.tar.bz2 nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.tar.lz nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.tar.xz nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.tar.zst nixpkgs-3ba77c1b4031f84602f597e4b993bd614d915c8f.zip |
* 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/ut2004demo')
-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 |
3 files changed, 19 insertions, 6 deletions
diff --git a/pkgs/games/ut2004demo/builder.sh b/pkgs/games/ut2004demo/builder.sh index 0e7e3ed5072..d4c45fa9d14 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 e079e7819be..1c8b42891a4 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 d165127f0a6..06a809d4cbd 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 |