summaryrefslogtreecommitdiff
path: root/games/monsterz/patches
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2009-02-15 21:53:40 +0000
committerwiz <wiz@pkgsrc.org>2009-02-15 21:53:40 +0000
commit03b44ad8f3fd40989379e4403c46838be98a305f (patch)
tree773817ae3c519ec63a3c01781e313fac5f844839 /games/monsterz/patches
parent3997334c71024c0c59bfa4e2e06b7e85d4fae810 (diff)
downloadpkgsrc-03b44ad8f3fd40989379e4403c46838be98a305f.tar.gz
Improve scorefile handling.
Add patches for two problems with python-2.5/64-bit. Convert to user-destdir. Bump PKGREVISION.
Diffstat (limited to 'games/monsterz/patches')
-rw-r--r--games/monsterz/patches/patch-aa41
-rw-r--r--games/monsterz/patches/patch-ab68
2 files changed, 105 insertions, 4 deletions
diff --git a/games/monsterz/patches/patch-aa b/games/monsterz/patches/patch-aa
index ba6b49ab144..6e5b87b9ddb 100644
--- a/games/monsterz/patches/patch-aa
+++ b/games/monsterz/patches/patch-aa
@@ -1,8 +1,8 @@
-$NetBSD: patch-aa,v 1.1.1.1 2006/12/17 10:33:11 wiz Exp $
+$NetBSD: patch-aa,v 1.2 2009/02/15 21:53:40 wiz Exp $
---- Makefile.orig 2006-05-12 18:39:38.000000000 +0200
+--- Makefile.orig 2007-12-17 22:05:00.000000000 +0000
+++ Makefile
-@@ -1,6 +1,6 @@
+@@ -1,9 +1,9 @@
-prefix = /usr/local
-gamesdir = ${prefix}/games
@@ -10,4 +10,37 @@ $NetBSD: patch-aa,v 1.1.1.1 2006/12/17 10:33:11 wiz Exp $
+gamesdir = ${prefix}/bin
datadir = ${prefix}/share
pkgdatadir = $(datadir)/games/monsterz
- scoredir = /var/games
+-scoredir = /var/games
++scoredir = ${VARBASE}/games
+ scorefile = $(scoredir)/monsterz
+
+ VERSION = 0.7.1
+@@ -40,18 +40,17 @@ graphics/logo.png: graphics/graphics.svg
+ $(INKSCAPE) graphics/graphics.svg -a 810:858:1220:1075 -w380 -h180 -e graphics/logo.png
+
+ install: all
+- mkdir -p $(DESTDIR)$(gamesdir)
+- cp monsterz $(DESTDIR)$(gamesdir)/
+- chown root:games $(DESTDIR)$(gamesdir)/monsterz
+- chmod g+s $(DESTDIR)$(gamesdir)/monsterz
+- mkdir -p $(DESTDIR)$(pkgdatadir)/graphics
+- mkdir -p $(DESTDIR)$(pkgdatadir)/sound
+- cp monsterz.py $(DESTDIR)$(pkgdatadir)/
+- cp $(BITMAP) $(DESTDIR)$(pkgdatadir)/graphics/
+- cp $(SOUND) $(MUSIC) $(DESTDIR)$(pkgdatadir)/sound/
+- mkdir -p $(DESTDIR)$(scoredir)
++ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(gamesdir)
++ ${BSD_INSTALL_GAME} monsterz $(DESTDIR)$(gamesdir)/
++ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(pkgdatadir)/graphics
++ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(pkgdatadir)/sound
++ ${BSD_INSTALL_SCRIPT} monsterz.py $(DESTDIR)$(pkgdatadir)/
++ ${BSD_INSTALL_GAME_DATA} $(BITMAP) $(DESTDIR)$(pkgdatadir)/graphics/
++ ${BSD_INSTALL_GAME_DATA} $(SOUND) $(MUSIC) $(DESTDIR)$(pkgdatadir)/sound/
++ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(scoredir)
++ ${BSD_INSTALL_GAME_DIR} $(DESTDIR)$(scoredir)
+ test -f $(DESTDIR)$(scorefile) || echo "" > $(DESTDIR)$(scorefile)
+- chown root:games $(DESTDIR)$(scorefile)
++ chown ${GAMEOWN}:${GAMEGRP} $(DESTDIR)$(scorefile)
+ chmod g+w $(DESTDIR)$(scorefile)
+
+ uninstall:
diff --git a/games/monsterz/patches/patch-ab b/games/monsterz/patches/patch-ab
new file mode 100644
index 00000000000..9fb234eb519
--- /dev/null
+++ b/games/monsterz/patches/patch-ab
@@ -0,0 +1,68 @@
+$NetBSD: patch-ab,v 1.1 2009/02/15 21:53:40 wiz Exp $
+
+Fix 64-bit alignment issue with Python 2.5.
+http://sam.zoy.org/cgi-bin/viewcvs.cgi/monsterz.py?root=monsterz&rev=137&r1=135&r2=137
+
+Fix blit crash, using patch from Fedora:
+http://cvs.fedoraproject.org/viewvc/devel/monsterz/monsterz-0.7.1-blit-crash.patch?view=log
+
+--- monsterz.py.orig 2007-12-17 22:05:00.000000000 +0000
++++ monsterz.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/pkg/bin/python2.5
+ # -*- coding: utf-8 -*-
+
+ """
+@@ -108,7 +108,9 @@ def semi_grayscale(surf):
+ M = int(max(r, g, b))
+ m = int(min(r, g, b))
+ val = (2 * M + r + g + b) / 5
+- p[:] = (val + r) / 2, (val + g) / 2, (val + b) / 2
++ p[0] = (val + r) / 2
++ p[1] = (val + g) / 2
++ p[2] = (val + b) / 2
+ if alpha[y][x] >= 250:
+ alpha[y][x] = 255 - (M - m) * 3 / 4
+ del pixels
+@@ -129,7 +131,9 @@ def semi_transp(surf):
+ r, g, b = p
+ M = int(max(r, g, b))
+ m = int(min(r, g, b))
+- p[:] = (m + r) / 2, (m + g) / 2, (m + b) / 2
++ p[0] = (m + r) / 2
++ p[1] = (m + g) / 2
++ p[2] = (m + b) / 2
+ if alpha[y][x] >= 250:
+ alpha[y][x] = 255 - M * 2 / 3
+ del pixels
+@@ -829,10 +833,10 @@ class Game:
+ pass
+ else:
+ for x in range(4):
+- for y, p in enumerate(alpha[x]):
+- alpha[x][y] = p * x / 4
+- for y, p in enumerate(alpha[406 - x - 1]):
+- alpha[406 - x - 1][y] = p * x / 4
++ for y in range(len(alpha[x])):
++ alpha[x][y] = alpha[x][y] * x / 4
++ for y in range(len(alpha[406 - x - 1])):
++ alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x / 4
+ for col in alpha:
+ l = len(col)
+ for y in range(4):
+@@ -1287,10 +1291,10 @@ class Monsterz:
+ pass
+ else:
+ for x in range(10):
+- for y, p in enumerate(alpha[x]):
+- alpha[x][y] = p * x / 12
+- for y, p in enumerate(alpha[406 - x - 1]):
+- alpha[406 - x - 1][y] = p * x / 12
++ for y in range(len(alpha[x])):
++ alpha[x][y] = alpha[x][y] * x / 12
++ for y in range(len(alpha[406 - x - 1])):
++ alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x / 12
+ del alpha
+ scroll.unlock()
+ system.blit(scroll, (13, 437))