openarena: oa_ded link.

This commit is contained in:
Kevin Cox 2019-10-14 13:30:28 +01:00
parent 67effde499
commit 995fbac56f
No known key found for this signature in database
GPG Key ID: 9BB92CC1552E99AA

View File

@ -16,27 +16,28 @@ stdenv.mkDerivation {
gameDir = "$out/openarena-$version";
interpreter = "$(< \"$NIX_CC/nix-support/dynamic-linker\")";
libPath = stdenv.lib.makeLibraryPath [ SDL libglvnd libogg libvorbis curl openal ];
arch = {
"x86_64-linux" = "x86_64";
"i386-linux" = "i386";
}.${stdenv.hostPlatform.system};
in ''
mkdir -pv $out/bin
cd $out
unzip $src
${if stdenv.hostPlatform.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 : "${libPath}"
'' else ''
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.i386"
makeWrapper "${gameDir}/openarena.i386" "$out/bin/openarena" \
--prefix LD_LIBRARY_PATH : "${libPath}"
''}
patchelf --set-interpreter "${interpreter}" "${gameDir}/openarena.${arch}"
patchelf --set-interpreter "${interpreter}" "${gameDir}/oa_ded.${arch}"
makeWrapper "${gameDir}/openarena.${arch}" "$out/bin/openarena" \
--prefix LD_LIBRARY_PATH : "${libPath}"
makeWrapper "${gameDir}/oa_ded.${arch}" "$out/bin/oa_ded"
'';
meta = {
description = "Crossplatform openarena client";
homepage = http://openarena.ws/;
maintainers = [ stdenv.lib.maintainers.wyvie ];
platforms = stdenv.lib.platforms.linux;
platforms = [ "i386-linux" "x86_64-linux" ];
license = stdenv.lib.licenses.gpl2;
};
}