···11+{ lib
22+, stdenv
33+, fetchFromGitHub
44+, SDL2
55+, SDL2_image
66+, SDL2_mixer
77+, SDL2_ttf
88+, gettext
99+, libpng
1010+, pkg-config
1111+, zlib
1212+}:
1313+1414+stdenv.mkDerivation rec {
1515+ pname = "the-legend-of-edgar";
1616+ version = "1.35";
1717+1818+ src = fetchFromGitHub {
1919+ name = "${pname}-${version}-src";
2020+ owner = "riksweeney";
2121+ repo = "edgar";
2222+ rev = version;
2323+ hash = "sha256-ojy4nEW9KiSte/AoFUMPrKCxvIeQpMVIL4ileHiBydo=";
2424+ };
2525+2626+ nativeBuildInputs = [
2727+ pkg-config
2828+ gettext
2929+ ];
3030+3131+ buildInputs = [
3232+ SDL2
3333+ SDL2_image
3434+ SDL2_mixer
3535+ SDL2_ttf
3636+ libpng
3737+ zlib
3838+ ];
3939+4040+ dontConfigure = true;
4141+4242+ makefile = "makefile";
4343+4444+ makeFlags = [
4545+ "PREFIX=${placeholder "out"}"
4646+ "BIN_DIR=${placeholder "out"}/bin/"
4747+ ];
4848+4949+ # TODO: remove the setting below when the next version arrives
5050+ # https://github.com/riksweeney/edgar/pull/57
5151+ preBuild = ''
5252+ export CFLAGS=$(sdl2-config --cflags)
5353+ '';
5454+5555+ meta = with lib; {
5656+ homepage = "https://www.parallelrealities.co.uk/games/edgar";
5757+ description = "A 2D platform game with a persistent world";
5858+ longDescription = ''
5959+ When Edgar's father fails to return home after venturing out one dark and
6060+ stormy night, Edgar fears the worst: he has been captured by the evil
6161+ sorcerer who lives in a fortress beyond the forbidden swamp.
6262+6363+ Donning his armour, Edgar sets off to rescue him, but his quest will not
6464+ be easy...
6565+6666+ The Legend of Edgar is a platform game, not unlike those found on the
6767+ Amiga and SNES. Edgar must battle his way across the world, solving
6868+ puzzles and defeating powerful enemies to achieve his quest.
6969+ '';
7070+ license = licenses.gpl1Plus;
7171+ maintainers = with maintainers; [ AndersonTorres ];
7272+ platforms = platforms.unix;
7373+ broken = stdenv.isDarwin;
7474+ };
7575+}