3
0
Fork 0
forked from mirrors/nixpkgs

openarena: Clean up and fix tarball evaluation.

It really doesn't make sense to pass stdenv.system to the builder and
check the value during build process. Also, we're now using
$NIX_CC/nix-support/dynamic-linker instead of pattern matching on
ld-linux*.so.?.

This is part of an attempt to fix nixpkgs tarball evaluation.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-01-03 18:24:16 +01:00
parent 840f9b419c
commit 7982c3423a
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961

View file

@ -14,21 +14,21 @@ stdenv.mkDerivation rec {
installPhase = let
gameDir = "$out/openarena-$version";
interpreter = "${stdenv.glibc}/lib/ld-linux*.so.?";
interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
in ''
mkdir -pv $out/bin
cd $out
unzip $src
if [ "${stdenv.system}" == "x86_64-linux" ]; then
patchelf --set-interpreter ${interpreter} ${gameDir}/openarena.x86_64
${if stdenv.system == "x86_64-linux" then ''
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.x86_64"
makeWrapper "${gameDir}/openarena.x86_64" "$out/bin/openarena" \
--prefix LD_LIBRARY_PATH : "${SDL}/lib:${libogg}/lib:${libvorbis}/lib"
else
patchelf --set-interpreter ${interpreter} ${gameDir}/openarena.i386
'' else ''
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.i386"
makeWrapper "${gameDir}/openarena.i386" "$out/bin/openarena" \
--prefix LD_LIBRARY_PATH : "${SDL}/lib:${libogg}/lib:${libvorbis}/lib"
fi
''}
'';
meta = {