aboutsummaryrefslogtreecommitdiff
path: root/games/hangman
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2005-11-11 15:31:49 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2005-11-11 15:31:49 +0000
commita8a78b71034397cfd9fcbc3a1d3fcb0dc4df1d0e (patch)
tree235960567becb2e2b3588b741f8f013045f41413 /games/hangman
parentaf6fa01c54585239fa5267fb8aa136a913e55a6c (diff)
downloadports-a8a78b71034397cfd9fcbc3a1d3fcb0dc4df1d0e.tar.gz
ports-a8a78b71034397cfd9fcbc3a1d3fcb0dc4df1d0e.zip
Notes
Diffstat (limited to 'games/hangman')
-rw-r--r--games/hangman/Makefile57
-rw-r--r--games/hangman/distinfo3
-rw-r--r--games/hangman/files/patch-src__dict.c45
-rw-r--r--games/hangman/files/patch-src__sound.c16
-rw-r--r--games/hangman/pkg-descr5
-rw-r--r--games/hangman/pkg-plist20
6 files changed, 146 insertions, 0 deletions
diff --git a/games/hangman/Makefile b/games/hangman/Makefile
new file mode 100644
index 000000000000..0e886439ab87
--- /dev/null
+++ b/games/hangman/Makefile
@@ -0,0 +1,57 @@
+# New ports collection makefile for: hangman
+# Date created: 10 Nov 2005
+# Whom: Dmitry Marakasov <amdmi3@mail.ru>
+#
+# $FreeBSD$
+#
+
+PORTNAME= hangman
+PORTVERSION= 0.9.2
+CATEGORIES= games
+MASTER_SITES= http://www.shiftygames.com/hangman/
+
+MAINTAINER= amdmi3@mail.ru
+COMMENT= Challenge your spelling skills in the old western style
+
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_REINPLACE= yes
+USE_SDL= sdl mixer image ttf
+
+CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ENV= LDFLAGS="`${SDL_CONFIG} --libs`" \
+ CPPFLAGS="`${SDL_CONFIG} --cflags`" \
+ SDL_CONFIG="${SDL_CONFIG}"
+
+MAN6= hangman.6
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_DICTIONARY)
+DICTIONARY=${WITH_DICTIONARY}
+.else
+DICTIONARY=/usr/share/dict/words
+
+pre-fetch:
+ @${ECHO} ""
+ @${ECHO} "You may want to use different dictionary instead of the default one,"
+ @${ECHO} "which is /usr/share/dict/words. If so, use the following option:"
+ @${ECHO} ""
+ @${ECHO} " WITH_DICTIONARY=/path/to/your/dictionary"
+ @${ECHO} ""
+.endif
+
+.if !exists(${DICTIONARY})
+pre-configure:
+ @${ECHO} ""
+ @${ECHO} "Dictionary ${DICTIONARY} does not exist"
+ @${ECHO} "Please, specify correct one with WITH_DICTIONARY option"
+ @${FALSE}
+.endif
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|SDL/|SDL11/|g' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e 's|/usr/share/dict/words|${DICTIONARY}|g' ${WRKSRC}/src/hangman.c
+ @${REINPLACE_CMD} -e 's|-std=gnu99||g' ${WRKSRC}/configure
+
+.include <bsd.port.post.mk>
diff --git a/games/hangman/distinfo b/games/hangman/distinfo
new file mode 100644
index 000000000000..85b6dc977011
--- /dev/null
+++ b/games/hangman/distinfo
@@ -0,0 +1,3 @@
+MD5 (hangman-0.9.2.tar.gz) = 15081ba8a9d69ff82f6bc93004342693
+SHA256 (hangman-0.9.2.tar.gz) = 5fa60699112895848b390b98f84ebb3dc4abaca431fd5c0cb25bf4d09824da2d
+SIZE (hangman-0.9.2.tar.gz) = 1023712
diff --git a/games/hangman/files/patch-src__dict.c b/games/hangman/files/patch-src__dict.c
new file mode 100644
index 000000000000..3fa85ab973f2
--- /dev/null
+++ b/games/hangman/files/patch-src__dict.c
@@ -0,0 +1,45 @@
+--- src/dict.c.orig Sun Apr 11 01:22:40 2004
++++ src/dict.c Thu Nov 10 05:18:25 2005
+@@ -84,11 +84,15 @@
+ ****************************************************/
+ static void resize()
+ {
++ struct node *d;
++ struct node *t;
++ struct node ** old_table = dictionary;
+ unsigned int a;
++ size_t i;
+ size_t old_size = sizeOfTable;
+- sizeOfTable *= 2;
+ numOfEntries = 0;
+- struct node ** old_table = dictionary;
++
++ sizeOfTable *= 2;
+
+ dictionary = (struct node **)malloc(sizeof(struct node *) * sizeOfTable);
+ if(!dictionary) {
+@@ -99,8 +103,9 @@
+
+ /* now copy old table into new table
+ and delete the old one */
+- for(size_t i = 0; i < old_size; i++) {
+- struct node * d = NULL, * t = old_table[i];
++ for(i = 0; i < old_size; i++) {
++ d = NULL;
++ t = old_table[i];
+ while(t) {
+ addToDictionary(t->word);
+ d = t;
+@@ -157,10 +162,11 @@
+ {
+ FILE * input = NULL;
+ unsigned int a;
++ size_t i;
+
+ /* Delete the old dictionary if one exists */
+ if(dictionary) {
+- for(size_t i = 0; i < sizeOfTable; i++) {
++ for(i = 0; i < sizeOfTable; i++) {
+ struct node * t = dictionary[i];
+ while(t) {
+ free(t->word);
diff --git a/games/hangman/files/patch-src__sound.c b/games/hangman/files/patch-src__sound.c
new file mode 100644
index 000000000000..07082e513c35
--- /dev/null
+++ b/games/hangman/files/patch-src__sound.c
@@ -0,0 +1,16 @@
+--- src/sound.c.orig Sun Apr 11 01:27:01 2004
++++ src/sound.c Thu Nov 10 05:14:05 2005
+@@ -47,10 +47,12 @@
+ {
+ Mix_Chunk * temp = NULL;
+ char * newname = NULL;
++ int len1, len2;
+
+ assert(name);
+
+- int len1 = strlen(sg_data_path), len2 = strlen(name);
++ len1 = strlen(sg_data_path);
++ len2 = strlen(name);
+
+ if(disabled)
+ return NULL;
diff --git a/games/hangman/pkg-descr b/games/hangman/pkg-descr
new file mode 100644
index 000000000000..bd94fc26b8b6
--- /dev/null
+++ b/games/hangman/pkg-descr
@@ -0,0 +1,5 @@
+Challenge your spelling skills in the old western style. Get it
+right and we'll let you try again, until you get it wrong. But we
+will give you another chance if you get it wrong.
+
+WWW: http://www.shiftygames.com/hangman/hangman.html
diff --git a/games/hangman/pkg-plist b/games/hangman/pkg-plist
new file mode 100644
index 000000000000..f20591881d7c
--- /dev/null
+++ b/games/hangman/pkg-plist
@@ -0,0 +1,20 @@
+bin/hangman
+%%DATADIR%%/fonts/washing.ttf
+%%DATADIR%%/pics/background.png
+%%DATADIR%%/pics/background2.png
+%%DATADIR%%/pics/noose.png
+%%DATADIR%%/pics/sg_icon.png
+%%DATADIR%%/pics/shiftygames.png
+%%DATADIR%%/pics/sound_high.png
+%%DATADIR%%/pics/sound_low.png
+%%DATADIR%%/pics/sound_medium.png
+%%DATADIR%%/sounds/click.ogg
+%%DATADIR%%/sounds/letterSelectSound.ogg
+%%DATADIR%%/sounds/nooseDropSound.ogg
+%%DATADIR%%/sounds/over.ogg
+%%DATADIR%%/sounds/wordHitSound.ogg
+%%DATADIR%%/sounds/wordMissSound.ogg
+@dirrm %%DATADIR%%/fonts
+@dirrm %%DATADIR%%/pics
+@dirrm %%DATADIR%%/sounds
+@dirrm %%DATADIR%%