Skip to content

Commit

Permalink
enigma: cleanup; use finalAttrs pattern (#274873)
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Dec 18, 2024
2 parents 34becd6 + 8f48be2 commit 3df608c
Showing 1 changed file with 44 additions and 9 deletions.
53 changes: 44 additions & 9 deletions pkgs/by-name/en/enigma/package.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,55 @@
{ lib, stdenv, fetchurl, fetchpatch, makeWrapper, pkg-config, gettext, imagemagick, curl, libpng, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, xercesc, xdg-utils, hicolor-icon-theme }:
stdenv.mkDerivation rec {
{
lib,
stdenv,
fetchurl,
fetchpatch,
makeWrapper,
pkg-config,
gettext,
imagemagick,
curl,
libpng,
SDL2,
SDL2_image,
SDL2_mixer,
SDL2_ttf,
xercesc,
xdg-utils,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "enigma";
version = "1.30";

src = fetchurl {
url = "https://github.com/Enigma-Game/Enigma/releases/download/${version}/Enigma-${version}-src.tar.gz";
sha256 = "rmS5H7wrEJcAcdDXjtW07enuOGjeLm6VaVRvxYQ3+K8=";
url = "https://github.com/Enigma-Game/Enigma/releases/download/${finalAttrs.version}/Enigma-${finalAttrs.version}-src.tar.gz";
hash = "sha256-rmS5H7wrEJcAcdDXjtW07enuOGjeLm6VaVRvxYQ3+K8=";
};

patches = [
# fix format string security warning (turned into error)
(fetchpatch {
url = "https://github.com/Enigma-Game/Enigma/pull/70/commits/d25051eb6228c885e779a9674f8ee3979da30663.patch";
sha256 = "L5C4NCZDDUKji9Tg4geKaiw3CkSY6rCoawqGKqR4dFM=";
hash = "sha256-L5C4NCZDDUKji9Tg4geKaiw3CkSY6rCoawqGKqR4dFM=";
})
];

nativeBuildInputs = [ pkg-config gettext makeWrapper imagemagick ];
buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf libpng xercesc curl xdg-utils ];
nativeBuildInputs = [
pkg-config
gettext
makeWrapper
imagemagick
];
buildInputs = [
SDL2
SDL2_image
SDL2_mixer
SDL2_ttf
libpng
xercesc
curl
xdg-utils
];

# 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
Expand All @@ -38,10 +70,13 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Puzzle game inspired by Oxyd on the Atari ST and Rock'n'Roll on the Amiga";
mainProgram = "enigma";
license = with licenses; [ gpl2Plus free ]; # source + bundles libs + art
license = with licenses; [
gpl2
free
]; # source + bundles libs + art
platforms = platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
maintainers = with maintainers; [ iblech ];
homepage = "https://www.nongnu.org/enigma/";
};
}
})

0 comments on commit 3df608c

Please sign in to comment.