3
0
Fork 0
forked from mirrors/nixpkgs

Updating trigger-rally to 0.6.3

This commit is contained in:
Lluís Batlle i Rossell 2016-04-01 11:16:02 +02:00
parent 635c99ce87
commit f07b934c8a
2 changed files with 34 additions and 22 deletions

View file

@ -1,37 +1,35 @@
{ fetchurl, stdenv, SDL, freealut, SDL_image, openal, physfs, zlib, mesa, jam }:
{ fetchurl, stdenv, SDL, freealut, SDL_image, openal, physfs, zlib, mesa, glew }:
stdenv.mkDerivation rec {
name = "trigger-rally-0.6.1";
name = "trigger-rally-0.6.3";
src = fetchurl {
url = "mirror://sourceforge/trigger-rally/${name}-src.tar.bz2";
sha256 = "1fvb6dl5bwclmx0y8ygyrfn8jczc5kxawxlyv6mp592smb5x5hjs";
url = "mirror://sourceforge/trigger-rally/${name}.tar.gz";
sha256 = "103mv4vpq335mrmgzlhahrfncq7ds3b5ip5a52967rv2j6hhzpvy";
};
srcData = fetchurl {
url = "mirror://sourceforge/trigger-rally/${name}-data.tar.bz2";
sha256 = "04f9d74gz5xvfx6pnmbfxqhp0kd1p16j5lrgcq12wxvla6py4qaw";
};
buildInputs = [ SDL freealut SDL_image openal physfs zlib mesa jam ];
buildInputs = [ SDL freealut SDL_image openal physfs zlib mesa glew ];
preConfigure = ''
configureFlags="$configureFlags --datadir=$out/share/${name}-data"
sed s,/usr/local,$out, -i bin/*defs
cd src
export makeFlags="$makeFlags prefix=$out"
'';
# It has some problems installing the README file, so... out.
patchPhase = ''
sed -i /README/d Jamfile
enableParallelBuilding = true;
postInstall = ''
mkdir -p $out/bin
cat <<EOF > $out/bin/trigger-rally
#!/bin/sh
exec $out/games/trigger-rally "$@"
EOF
chmod +x $out/bin/trigger-rally
'';
buildPhase = "jam";
installPhase = ''
jam install
mkdir -p $out/share
pushd $out/share
tar xf $srcData
'';
# search.patch : fix c++ error.
patches = [ ./search.patch ];
meta = {
description = "Rally";

View file

@ -0,0 +1,14 @@
diff --git a/src/Trigger/main.cpp b/src/Trigger/main.cpp
index 39539e1..680c12c 100644
--- a/src/Trigger/main.cpp
+++ b/src/Trigger/main.cpp
@@ -890,7 +890,8 @@ bool MainApp::loadAll()
std::smatch mr; // Match Results
std::regex pat(R"(^(\w+)(\..+)$)"); // Pattern
- if (!std::regex_search(std::string(*fname), mr, pat))
+ std::string search(*fname);
+ if (!std::regex_search(search, mr, pat))
continue;
std::string basefname = mr[1];