From ddfd374c40fdb4e15ae208062fe72e505d139d0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sun, 6 Apr 2014 17:01:34 +0200 Subject: [PATCH] Merge #2030: add openra game (C&C RTS engine) Modifications from @vcunat, who tried Dune, but it typically segfaults in mono after a few minutes (IMHO unlikely to be a problem with packaging it). --- pkgs/games/openra/default.nix | 44 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 46 insertions(+) create mode 100644 pkgs/games/openra/default.nix diff --git a/pkgs/games/openra/default.nix b/pkgs/games/openra/default.nix new file mode 100644 index 000000000000..ec9d4ad39802 --- /dev/null +++ b/pkgs/games/openra/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchurl, mono, makeWrapper +, SDL2, freetype, openal +}: + +let + version = "20131223"; +in stdenv.mkDerivation rec { + name = "openra-${version}"; + + meta = with stdenv.lib; { + description = "Real Time Strategy game engine recreates the C&C titles"; + homepage = "http://www.open-ra.org/"; + license = licenses.gpl3; + platforms = platforms.linux; + maintainers = with maintainers; [ iyzsong ]; + }; + + src = fetchurl { + name = "${name}.tar.gz"; + url = "https://github.com/OpenRA/OpenRA/archive/release-${version}.tar.gz"; + sha256 = "1gfz6iiccajp86qc7xw5w843bng69k9zplvmipxxbspvr7byhw0c"; + }; + + dontStrip = true; + + nativeBuildInputs = [ mono makeWrapper ]; + + patchPhase = '' + sed -i 's/^VERSION.*/VERSION = release-${version}/g' Makefile + ''; + + preConfigure = '' + makeFlags="prefix=$out" + make version + ''; + + postInstall = with stdenv.lib; let + runtime = makeLibraryPath [ SDL2 freetype openal ]; + in '' + wrapProgram $out/bin/openra \ + --prefix PATH : "${mono}/bin" \ + --prefix LD_LIBRARY_PATH : "${runtime}" + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f138d8c88a26..7e4d2214479e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9993,6 +9993,8 @@ let oilrush = callPackage ../games/oilrush { }; + openra = callPackage ../games/openra { }; + openttd = callPackage ../games/openttd { zlib = zlibStatic; };