nixpkgs/pkgs/games/commandergenius/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

45 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitLab, SDL2, SDL2_image, pkgconfig
, libvorbis, libGL, boost, cmake, zlib, curl, SDL2_mixer, python3
}:
stdenv.mkDerivation rec {
pname = "commandergenius";
version = "2.3.3";
src = fetchFromGitLab {
owner = "Dringgstein";
repo = "Commander-Genius";
rev = "v${version}";
sha256 = "04nb23wwvc3yywz3cr6gvn02fa7psfs22ssg4wk12s08z1azvz3h";
};
buildInputs = [ SDL2 SDL2_image SDL2_mixer libGL boost libvorbis zlib curl python3 ];
preConfigure = ''
export cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_PREFIX=$out -DSHAREDIR=$out/share"
export makeFlags="$makeFlags DESTDIR=$(out)"
'';
nativeBuildInputs = [ cmake pkgconfig ];
postPatch = ''
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(sdl2-config --cflags)"
sed -i 's,APPDIR games,APPDIR bin,' src/install.cmake
'';
meta = with lib; {
description = "Modern Interpreter for the Commander Keen Games";
longDescription = ''
Commander Genius is an open-source clone of
Commander Keen which allows you to play
the games, and some of the mods
made for it. All of the original data files
are required to do so
'';
homepage = "https://github.com/gerstrong/Commander-Genius";
maintainers = with maintainers; [ hce ];
license = licenses.gpl2;
platforms = platforms.linux;
};
}