From d0779bc16e3ac8b134843575e8da8a0452b7d24a Mon Sep 17 00:00:00 2001 From: Ingo Blechschmidt Date: Sun, 10 Jan 2021 02:06:53 +0100 Subject: [PATCH] enigma: init at 1.21 --- pkgs/games/enigma/default.nix | 31 ++++++++++++++++++++++++ pkgs/games/enigma/src_Value.cc.patch | 15 ++++++++++++ pkgs/games/enigma/src_client.cc.patch | 12 +++++++++ pkgs/games/enigma/src_lev_Proxy.cc.patch | 11 +++++++++ pkgs/top-level/all-packages.nix | 2 ++ 5 files changed, 71 insertions(+) create mode 100644 pkgs/games/enigma/default.nix create mode 100644 pkgs/games/enigma/src_Value.cc.patch create mode 100644 pkgs/games/enigma/src_client.cc.patch create mode 100644 pkgs/games/enigma/src_lev_Proxy.cc.patch diff --git a/pkgs/games/enigma/default.nix b/pkgs/games/enigma/default.nix new file mode 100644 index 000000000000..d277768dbf55 --- /dev/null +++ b/pkgs/games/enigma/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchurl, makeWrapper, pkg-config, curl, imagemagick, libpng, SDL, SDL_image, SDL_mixer, SDL_ttf, xercesc, xdg_utils, hicolor-icon-theme }: +stdenv.mkDerivation rec { + pname = "enigma"; + version = "1.21"; + + src = fetchurl { + url = "mirror://sourceforge/enigma-game/enigma-${version}.tar.gz"; + sha256 = "d872cf067d8eb560d3bb1cb17245814bc56ac3953ae1f12e2229c8eb6f82ce01"; + }; + + # patches lifted from Arch + patches = [ ./src_client.cc.patch ./src_lev_Proxy.cc.patch ./src_Value.cc.patch ]; + + NIX_CFLAGS_COMPILE = [ "-Wno-deprecated-declarations" ]; + + nativeBuildInputs = [ pkg-config imagemagick makeWrapper ]; + buildInputs = [ SDL SDL_image SDL_mixer SDL_ttf libpng xercesc curl xdg_utils ]; + + postInstall = '' + rm -r $out/include + wrapProgram $out/bin/enigma --prefix PATH : "${stdenv.lib.makeBinPath [ xdg_utils ]}" + ''; + + meta = with stdenv.lib; { + description = "Puzzle game inspired by Oxyd on the Atari ST and Rock'n'Roll on the Amiga"; + license = with licenses; [ gpl2 free ]; + platforms = platforms.unix; + maintainers = with maintainers; [ iblech ]; + homepage = "https://www.nongnu.org/enigma/"; + }; +} diff --git a/pkgs/games/enigma/src_Value.cc.patch b/pkgs/games/enigma/src_Value.cc.patch new file mode 100644 index 000000000000..6ce85692dd2d --- /dev/null +++ b/pkgs/games/enigma/src_Value.cc.patch @@ -0,0 +1,15 @@ +--- a/src/Value.cc.orig 2017-09-03 15:39:37 UTC ++++ b/src/Value.cc +@@ -146,10 +146,10 @@ namespace enigma { + val.str[0] = 0; + break; + case BOOL : +- val.dval[0] = false; ++ val.dval[0] = 0; + break; + case OBJECT : +- val.dval[0] = (double) NULL; ++ val.dval[0] = 0; + break; + case NAMEDOBJECT: + ASSERT(false, XLevelRuntime, "Value: illegal type usage"); diff --git a/pkgs/games/enigma/src_client.cc.patch b/pkgs/games/enigma/src_client.cc.patch new file mode 100644 index 000000000000..48d989470ff9 --- /dev/null +++ b/pkgs/games/enigma/src_client.cc.patch @@ -0,0 +1,12 @@ +--- a/src/client.cc ++++ b/src/client.cc +@@ -208,8 +208,8 @@ void Client::handle_events() { + case SDL_MOUSEBUTTONUP: on_mousebutton(e); break; + case SDL_ACTIVEEVENT: { + update_mouse_button_state(); +- if (e.active.gain == 0 && !video::IsFullScreen()) +- show_menu(false); ++// if (e.active.gain == 0 && !video::IsFullScreen()) ++// show_menu(false); + break; + } diff --git a/pkgs/games/enigma/src_lev_Proxy.cc.patch b/pkgs/games/enigma/src_lev_Proxy.cc.patch new file mode 100644 index 000000000000..86796484dfd6 --- /dev/null +++ b/pkgs/games/enigma/src_lev_Proxy.cc.patch @@ -0,0 +1,11 @@ +--- a/src/lev/Proxy.cc.orig 2017-09-03 15:54:50 UTC ++++ b/src/lev/Proxy.cc +@@ -933,7 +933,7 @@ namespace enigma { namespace lev { + } else if (haveLocalCopy) { + // plain file + basic_ifstream ifs(absExtPath.c_str(), ios::binary | ios::in); +- if (ifs != NULL) ++ if (ifs) + Readfile(ifs, extCode); + else + haveLocalCopy = false; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c460379c313c..9374b4fa4cda 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2135,6 +2135,8 @@ in enca = callPackage ../tools/text/enca { }; + enigma = callPackage ../games/enigma {}; + ent = callPackage ../tools/misc/ent { }; envconsul = callPackage ../tools/system/envconsul { };