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