summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-03-11 18:23:54 +0000
committerGitHub <noreply@github.com>2021-03-11 18:23:54 +0000
commitd6257d451b70acba456c13be88fab53d90273dfd (patch)
tree0411ce936bca997b5803d50dc090842c7c3e933a /pkgs/games
parentb4d5951d9e9a0af775e6379f3560ed39d30b7590 (diff)
parentf5c01cf9d4e744426c938b000e235011f7076929 (diff)
downloadnixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.tar
nixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.tar.gz
nixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.tar.bz2
nixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.tar.lz
nixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.tar.xz
nixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.tar.zst
nixpkgs-d6257d451b70acba456c13be88fab53d90273dfd.zip
Merge master into staging-next
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/maelstrom/default.nix39
-rw-r--r--pkgs/games/maelstrom/fix-compilation.patch42
2 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/games/maelstrom/default.nix b/pkgs/games/maelstrom/default.nix
new file mode 100644
index 00000000000..5f78e34edac
--- /dev/null
+++ b/pkgs/games/maelstrom/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, makeDesktopItem, SDL2, SDL2_net }:
+
+stdenv.mkDerivation rec {
+  pname = "maelstrom";
+  version = "3.0.7";
+
+  src = fetchurl {
+    url = "http://www.libsdl.org/projects/Maelstrom/src/Maelstrom-${version}.tar.gz";
+    sha256 = "0dm0m5wd7amrsa8wnrblkv34sq4v4lglc2wfx8klfkdhyhi06s4k";
+  };
+
+  # this fixes a typedef compilation error with gcc-3.x
+  patches = [ ./fix-compilation.patch ];
+
+  buildInputs = [ SDL2 SDL2_net ];
+
+  postInstall = ''
+    mkdir -p $out/bin
+    ln -s $out/games/Maelstrom/Maelstrom $out/bin/maelstrom
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "maelstrom";
+      exec = "maelstrom";
+      desktopName = "Maelstrom";
+      genericName = "Maelstrom";
+      comment = "An arcade-style game resembling Asteroids";
+      categories = "Game;";
+    })
+  ];
+
+  meta = with lib; {
+    description = "An arcade-style game resembling Asteroids";
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ tmountain ];
+  };
+}
diff --git a/pkgs/games/maelstrom/fix-compilation.patch b/pkgs/games/maelstrom/fix-compilation.patch
new file mode 100644
index 00000000000..3fa8980c5ee
--- /dev/null
+++ b/pkgs/games/maelstrom/fix-compilation.patch
@@ -0,0 +1,42 @@
+diff -Naur Maelstrom-3.0.7/buttonlist.h Maelstrom-3.0.7-patched/buttonlist.h
+--- Maelstrom-3.0.7/buttonlist.h	2000-01-25 11:41:32.000000000 -0500
++++ Maelstrom-3.0.7-patched/buttonlist.h	2021-02-22 08:34:01.000000000 -0500
+@@ -16,7 +16,7 @@
+ 
+ 	void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height, 
+ 						void (*callback)(void)) {
+-		struct button *belem;
++        button *belem;
+ 		
+ 		for ( belem=&button_list; belem->next; belem=belem->next );
+ 		belem->next = new button;
+@@ -30,7 +30,7 @@
+ 	}
+ 
+ 	void Activate_Button(Uint16 x, Uint16 y) {
+-		struct button *belem;
++        button *belem;
+ 
+ 		for ( belem=button_list.next; belem; belem=belem->next ) {
+ 			if ( (x >= belem->x1) && (x <= belem->x2) &&
+@@ -42,7 +42,7 @@
+ 	}
+ 
+ 	void Delete_Buttons(void) {
+-		struct button *belem, *btemp;
++        button *belem, *btemp;
+ 
+ 		for ( belem=button_list.next; belem; ) {
+ 			btemp = belem;
+diff -Naur Maelstrom-3.0.7/main.cpp Maelstrom-3.0.7-patched/main.cpp
+--- Maelstrom-3.0.7/main.cpp	2021-02-04 11:50:27.000000000 -0500
++++ Maelstrom-3.0.7-patched/main.cpp	2021-02-22 08:34:34.000000000 -0500
+@@ -153,7 +153,7 @@
+ 	error("or\n");
+ 	error("Usage: %s <options>\n\n", progname);
+ 	error("Where <options> can be any of:\n\n"
+-"	-fullscreen		# Run Maelstrom in full-screen mode\n"
++"	-windowed		# Run Maelstrom in windowed mode\n"
+ "	-gamma [0-8]		# Set the gamma correction\n"
+ "	-volume [0-8]		# Set the sound volume\n"
+ "	-netscores		# Use the world-wide network score server\n"