* Get the Unreal Tournament 2004 demo to work with the new scheme for
handling OpenGL. svn path=/nixpkgs/trunk/; revision=4616
This commit is contained in:
parent
70c36821c6
commit
3ba77c1b40
@ -12,6 +12,8 @@ done
|
||||
ensureDir $out/bin
|
||||
|
||||
cat >$out/bin/quake3 <<EOF
|
||||
#! $SHELL -e
|
||||
|
||||
mesa=$mesa
|
||||
|
||||
$(cat $mesaSwitch)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -19,6 +19,8 @@ ensureDir $out/bin/.orig
|
||||
for i in $(cd $out/bin && ls); do
|
||||
mv $out/bin/$i $out/bin/.orig/$i
|
||||
cat >$out/bin/$i <<EOF
|
||||
#! $SHELL -e
|
||||
|
||||
mesa=$mesa
|
||||
|
||||
$(cat $mesaSwitch)
|
||||
|
@ -2109,7 +2109,7 @@ rec {
|
||||
paks = [quake3demodata];
|
||||
};
|
||||
|
||||
ut2004demo = (import ../games/ut2004demo) {
|
||||
ut2004demo = import ../games/ut2004demo {
|
||||
inherit fetchurl stdenv xlibs mesa;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user