nixpkgs/pkgs/games/warzone2100/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

69 lines
2.3 KiB
Nix

{ lib, stdenv, mkDerivation, fetchurl, autoconf, automake
, perl, unzip, zip, which, pkgconfig, qtbase, qtscript
, SDL2, libtheora, openal, glew, physfs, fribidi, libXrandr
, withVideos ? false
}:
let
pname = "warzone2100";
sequences_src = fetchurl {
url = "mirror://sourceforge/${pname}/warzone2100/Videos/high-quality-en/sequences.wz";
sha256 = "90ff552ca4a70e2537e027e22c5098ea4ed1bc11bb7fc94138c6c941a73d29fa";
};
in
mkDerivation rec {
inherit pname;
version = "3.3.0";
src = fetchurl {
url = "mirror://sourceforge/${pname}/releases/${version}/${pname}-${version}_src.tar.xz";
sha256 = "1s0n67rh32g0bgq72p4qzkcqjlw58gc70r4r6gl9k90pil9chj6c";
};
buildInputs = [
qtbase qtscript SDL2 libtheora openal
glew physfs fribidi libXrandr
];
nativeBuildInputs = [
perl zip unzip pkgconfig autoconf automake
];
preConfigure = "./autogen.sh";
postPatch = ''
substituteInPlace lib/exceptionhandler/dumpinfo.cpp \
--replace "which %s" "${which}/bin/which %s"
substituteInPlace lib/exceptionhandler/exceptionhandler.cpp \
--replace "which %s" "${which}/bin/which %s"
'';
configureFlags = [ "--with-distributor=NixOS" ];
hardeningDisable = [ "format" ];
enableParallelBuilding = true;
postInstall = stdenv.lib.optionalString withVideos
"cp ${sequences_src} $out/share/warzone2100/sequences.wz";
meta = with lib; {
description = "A free RTS game, originally developed by Pumpkin Studios";
longDescription = ''
Warzone 2100 is an open source real-time strategy and real-time tactics
hybrid computer game, originally developed by Pumpkin Studios and
published by Eidos Interactive.
In Warzone 2100, you command the forces of The Project in a battle to
rebuild the world after mankind has almost been destroyed by nuclear
missiles. The game offers campaign, multi-player, and single-player
skirmish modes. An extensive tech tree with over 400 different
technologies, combined with the unit design system, allows for a wide
variety of possible units and tactics.
'';
homepage = "http://wz2100.net";
license = licenses.gpl2Plus;
maintainers = [ maintainers.astsmtl ];
platforms = platforms.linux;
};
}