about summary refs log tree commit diff
path: root/pkgs/games/enigma
diff options
context:
space:
mode:
authorIngo Blechschmidt <iblech@web.de>2021-01-10 02:06:53 +0100
committerIngo Blechschmidt <iblech@web.de>2021-01-10 02:06:53 +0100
commitd0779bc16e3ac8b134843575e8da8a0452b7d24a (patch)
treedc12b78fe7a4b37a8c4c96520ebfd5314fc3a68f /pkgs/games/enigma
parent9297928d602c641818a7e52ceefd72bdd01c8b8d (diff)
enigma: init at 1.21
Diffstat (limited to 'pkgs/games/enigma')
-rw-r--r--pkgs/games/enigma/default.nix31
-rw-r--r--pkgs/games/enigma/src_Value.cc.patch15
-rw-r--r--pkgs/games/enigma/src_client.cc.patch12
-rw-r--r--pkgs/games/enigma/src_lev_Proxy.cc.patch11
4 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/games/enigma/default.nix b/pkgs/games/enigma/default.nix
new file mode 100644
index 0000000000000..d277768dbf551
--- /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 0000000000000..6ce85692dd2de
--- /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 0000000000000..48d989470ff92
--- /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 0000000000000..86796484dfd69
--- /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<char> ifs(absExtPath.c_str(), ios::binary | ios::in);
+-                        if (ifs != NULL)
++                        if (ifs)
+                             Readfile(ifs, extCode);
+                         else
+                             haveLocalCopy = false;