openspades: link to openal instead of using LD_LIBRARY_PATH

This commit is contained in:
Nikolay Amiantov 2016-05-07 03:43:24 +03:00
parent a211eef81a
commit a7fe84e38a

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, cmake, curl, glew, makeWrapper, mesa, SDL2, { stdenv, lib, fetchurl, cmake, curl, glew, makeWrapper, mesa, SDL2,
SDL2_image, unzip, wget, zlib, withOpenal ? true, openal ? null }: SDL2_image, unzip, wget, zlib, withOpenal ? true, openal ? null }:
assert withOpenal -> openal != null; assert withOpenal -> openal != null;
@ -20,9 +20,8 @@ stdenv.mkDerivation rec {
''; '';
nativeBuildInputs = nativeBuildInputs =
with stdenv.lib;
[ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ] [ cmake curl glew makeWrapper mesa SDL2 SDL2_image unzip wget zlib ]
++ optional withOpenal openal; ++ lib.optional withOpenal openal;
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DOPENSPADES_INSTALL_BINARY=bin" ]; cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" "-DOPENSPADES_INSTALL_BINARY=bin" ];
@ -38,13 +37,7 @@ stdenv.mkDerivation rec {
unzip -u -o Resources/DevPaks27.zip -d Resources/DevPak unzip -u -o Resources/DevPaks27.zip -d Resources/DevPak
''; '';
# OpenAL is loaded dynamicly NIX_CFLAGS_LINK = lib.optional withOpenal "-lopenal";
postInstall =
if withOpenal then ''
wrapProgram "$out/bin/openspades" \
--prefix LD_LIBRARY_PATH : "${openal}/lib"
''
else null;
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A compatible client of Ace of Spades 0.75"; description = "A compatible client of Ace of Spades 0.75";