From 1f3943541b9708e5c4673427c7a4433771a37042 Mon Sep 17 00:00:00 2001 From: Alexander Tsamutali Date: Sat, 24 Apr 2010 12:39:10 +0000 Subject: [PATCH] urbanterror: Enabled OpenAL and curl support. svn path=/nixpkgs/trunk/; revision=21294 --- pkgs/games/urbanterror/default.nix | 42 ++++++++++++++++-------------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/pkgs/games/urbanterror/default.nix b/pkgs/games/urbanterror/default.nix index c5e562ced53..dc870c79aba 100644 --- a/pkgs/games/urbanterror/default.nix +++ b/pkgs/games/urbanterror/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, unzip, SDL, mesa, curl, openal }: +{ stdenv, fetchurl, unzip, SDL, mesa, openal, curl }: stdenv.mkDerivation rec { name = "urbanterror-${version}"; version = "4.1"; @@ -16,16 +16,15 @@ stdenv.mkDerivation rec { unzip $src1 unzip $src2 ''; - # FIXME - #patchPhase = '' - # cd ioUrbanTerrorClientSource - # substituteInPlace code/client/snd_openal.c \ - # --replace libopenal.so.0 ${openal}/lib/libopenal.so - # substituteInPlace code/client/cl_curl.h \ - # --replace libcurl.so.3 ${curl}/lib/libcurl.so - # cd .. - #''; - buildInputs = [ unzip SDL mesa ]; + configurePhase = '' + cd ioUrbanTerrorClientSource + echo "USE_OPENAL = 1" > Makefile.local + echo "USE_OPENAL_DLOPEN = 0" >> Makefile.local + echo "USE_CURL = 1" >> Makefile.local + echo "USE_CURL_DLOPEN = 0" >> Makefile.local + cd .. + ''; + buildInputs = [ unzip SDL mesa openal curl ]; buildPhase = '' for d in ioUrbanTerrorClientSource ioUrbanTerrorServerSource do @@ -44,18 +43,23 @@ stdenv.mkDerivation rec { "$destDir/ioUrTded" cp -rv UrbanTerror/q3ut4 "$destDir" cat << EOF > "$out/bin/urbanterror" -#!/bin/sh -cd "$destDir" -exec ./ioUrbanTerror "\$@" -EOF + #!/bin/sh + cd "$destDir" + exec ./ioUrbanTerror "\$@" + EOF chmod +x "$out/bin/urbanterror" cat << EOF > "$out/bin/urbanterror-ded" -#!/bin/sh -cd "$destDir" -exec ./ioUrTded "\$@" -EOF + #!/bin/sh + cd "$destDir" + exec ./ioUrTded "\$@" + EOF chmod +x "$out/bin/urbanterror-ded" ''; + postFixup = '' + p=$out/opt/urbanterror/ioUrbanTerror + cur_rpath=$(patchelf --print-rpath $p) + patchelf --set-rpath $cur_rpath:${mesa}/lib $p + ''; meta = { description = "A multiplayer tactical FPS on top of Quake 3 engine"; longDescription = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 84f277ae39c..97d245b5058 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8678,7 +8678,7 @@ let }; urbanterror = import ../games/urbanterror { - inherit fetchurl stdenv unzip SDL mesa curl openal; + inherit fetchurl stdenv unzip SDL mesa openal curl; }; ut2004demo = import ../games/ut2004demo {