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

42 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, SDL, SDL_image, SDL_ttf, SDL_mixer }:
stdenv.mkDerivation {
name = "beret-1.2.0";
buildInputs = [ SDL SDL_image SDL_ttf SDL_mixer ];
NIX_CFLAGS_COMPILE = "-I${SDL.dev}/include/SDL";
NIX_CFLAGS_LINK = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin
"-framework CoreFoundation -framework OpenGL -framework Cocoa";
patches = [ ./use-home-dir.patch ];
postPatch = ''
sed -i 's@RESOURCE_PATH ""@RESOURCE_PATH "'$out'/share/"@' game.c
'';
src = fetchurl {
url = "https://gitorious.org/beret/beret/archive-tarball/ae029777";
name = "beret-1.2.0.tar.gz";
sha256 = "1rx9z72id1810fgv8mizk8qxwd1kh5xi07fdhmjc62mh3fn38szc";
};
installPhase = ''
mkdir -p $out/bin
install -v -m755 beret $out/bin
mkdir -p $out/share
cp -av tahoma.ttf images music rooms sfx $out/share
'';
meta = with lib; {
description = "A 2D puzzle-platformer game about a scientist with telekinetic abilities";
homepage = "http://kiwisauce.com/beret/";
license = licenses.lgpl2;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.all;
broken = true; # source won't download, and no replacement is visible
};
}