1 { lib, stdenv, fetchurl, fetchpatch, makeWrapper, pkg-config, gettext, imagemagick, curl, libpng, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, xercesc, xdg-utils, hicolor-icon-theme }:
2 stdenv.mkDerivation rec {
7 url = "https://github.com/Enigma-Game/Enigma/releases/download/${version}/Enigma-${version}-src.tar.gz";
8 sha256 = "rmS5H7wrEJcAcdDXjtW07enuOGjeLm6VaVRvxYQ3+K8=";
12 # fix format string security warning (turned into error)
14 url = "https://github.com/Enigma-Game/Enigma/pull/70/commits/d25051eb6228c885e779a9674f8ee3979da30663.patch";
15 sha256 = "L5C4NCZDDUKji9Tg4geKaiw3CkSY6rCoawqGKqR4dFM=";
19 nativeBuildInputs = [ pkg-config gettext makeWrapper imagemagick ];
20 buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf libpng xercesc curl xdg-utils ];
22 # The configure script of enigma uses pkg-config to determine the header
23 # directories of SDL2. However, pkg-config only returns the path to the core
24 # SDL2 library, not to the additional libraries SDL2_ttf, SDL2_image and
25 # SDL2_mixer. In contrast, sdl2-config does return the correct list of paths.
26 # We don't use configureFlags here so that the shell can correctly carry
27 # out the interpolation.
29 export SDL_CFLAGS=$(sdl2-config --cflags)
34 # make xdg-open overrideable at runtime
35 wrapProgram $out/bin/enigma --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}"
39 description = "Puzzle game inspired by Oxyd on the Atari ST and Rock'n'Roll on the Amiga";
40 mainProgram = "enigma";
41 license = with licenses; [ gpl2Plus free ]; # source + bundles libs + art
42 platforms = platforms.unix;
43 broken = stdenv.hostPlatform.isDarwin;
44 maintainers = with maintainers; [ iblech ];
45 homepage = "https://www.nongnu.org/enigma/";