nixpkgs/pkgs/games/enigma/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.9 KiB
Nix
Raw Normal View History

2022-04-02 17:51:03 +00:00
{ lib, stdenv, fetchurl, fetchpatch, makeWrapper, pkg-config, gettext, imagemagick, curl, libpng, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, xercesc, xdg-utils, hicolor-icon-theme }:
2021-01-10 01:06:53 +00:00
stdenv.mkDerivation rec {
pname = "enigma";
2022-04-02 17:51:03 +00:00
version = "1.30";
2021-01-10 01:06:53 +00:00
src = fetchurl {
2022-04-02 17:51:03 +00:00
url = "https://github.com/Enigma-Game/Enigma/releases/download/${version}/Enigma-${version}-src.tar.gz";
sha256 = "rmS5H7wrEJcAcdDXjtW07enuOGjeLm6VaVRvxYQ3+K8=";
2021-01-10 01:06:53 +00:00
};
2022-04-02 17:51:03 +00:00
patches = [
# fix format string security warning (turned into error)
(fetchpatch {
url = "https://github.com/Enigma-Game/Enigma/pull/70/commits/d25051eb6228c885e779a9674f8ee3979da30663.patch";
sha256 = "L5C4NCZDDUKji9Tg4geKaiw3CkSY6rCoawqGKqR4dFM=";
})
];
2021-01-10 12:45:48 +00:00
nativeBuildInputs = [ pkg-config gettext makeWrapper imagemagick ];
2021-02-21 04:32:48 +00:00
buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf libpng xercesc curl xdg-utils ];
2021-01-10 01:06:53 +00:00
2022-04-02 17:51:03 +00:00
# The configure script of enigma uses pkg-config to determine the header
# directories of SDL2. However, pkg-config only returns the path to the core
# SDL2 library, not to the additional libraries SDL2_ttf, SDL2_image and
# SDL2_mixer. In contrast, sdl2-config does return the correct list of paths.
# We don't use configureFlags here so that the shell can correctly carry
# out the interpolation.
preConfigure = ''
export SDL_CFLAGS=$(sdl2-config --cflags)
'';
2021-01-10 01:06:53 +00:00
postInstall = ''
rm -r $out/include
# make xdg-open overrideable at runtime
wrapProgram $out/bin/enigma --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}"
2021-01-10 01:06:53 +00:00
'';
2021-01-10 12:45:48 +00:00
meta = with lib; {
2021-01-10 01:06:53 +00:00
description = "Puzzle game inspired by Oxyd on the Atari ST and Rock'n'Roll on the Amiga";
2021-02-21 04:11:42 +00:00
license = with licenses; [ gpl2 free ]; # source + bundles libs + art
2021-01-10 01:06:53 +00:00
platforms = platforms.unix;
2021-01-10 12:45:48 +00:00
broken = stdenv.targetPlatform.isDarwin;
2021-01-10 01:06:53 +00:00
maintainers = with maintainers; [ iblech ];
homepage = "https://www.nongnu.org/enigma/";
};
}