Bug 150074

Summary: [patch] games/hex-a-hop: update to 1.1.0
Product: Ports & Packages Reporter: swell.k <swell.k>
Component: Individual Port(s)Assignee: Emanuel Haupt <ehaupt>
Status: Closed FIXED    
Severity: Affects Only Me CC: jamie
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
a.diff
none
patch-src-text.cpp none

Description swell.k 2010-08-28 22:10:02 UTC

    
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2010-08-28 22:10:11 UTC
Maintainer of games/hex-a-hop,

Please note that PR ports/150074 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/150074

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2010-08-28 22:10:14 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 swell.k 2010-08-29 13:43:36 UTC
Oops, `-g' in CXXFLAGS overrides any -g[0-3] or -ggdb[0-3] in DEBUG_FLAGS.
I'm adding --disable-debug by default. NDEBUG ifdef is currently unused, though.

--- b.diff begins here ---
diff --git games/hex-a-hop/Makefile games/hex-a-hop/Makefile
index be21e7f..b3da6aa 100644
--- games/hex-a-hop/Makefile
+++ games/hex-a-hop/Makefile
@@ -30,6 +30,10 @@ DESKTOP_ENTRIES="Hex-a-Hop" "A puzzle game based on hexagonal tiles" \
 
 .include <bsd.port.pre.mk>
 
+.if !defined(WITH_DEBUG)
+CONFIGURE_ARGS+=--disable-debug
+.endif
+
 .if !defined(WITHOUT_NLS)
 USE_GETTEXT=	yes
 CONFIGURE_ENV+=	ac_cv_header_libintl_h=yes
@@ -51,4 +55,7 @@ USE_SDL+=	mixer
 CONFIGURE_ARGS+=--disable-sound
 .endif
 
+post-patch:	.SILENT
+	${REINPLACE_CMD} -E '/CFLAGS|CXXFLAGS/s/-g//' ${WRKSRC}/configure
+
 .include <bsd.port.post.mk>
--- b.diff ends here ---
Comment 4 swell.k 2010-08-29 15:09:32 UTC
Looks like I've stepped on a landmine: const qualifier in iconv.h.
Below is a patch from the maintainer that fixes compilation with GNU iconv.

--- c.diff begins here ---
Index: games/hex-a-hop/files/patch-src-text.cpp
===================================================================
RCS file: games/hex-a-hop/files/patch-src-text.cpp
diff -N games/hex-a-hop/files/patch-src-text.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/hex-a-hop/files/patch-src-text.cpp	29 Aug 2010 14:00:10 -0000
@@ -0,0 +1,11 @@
+--- src/text.cpp~
++++ src/text.cpp
+@@ -439,7 +439,7 @@ void ConvertToUTF8(const std::string &te
+ 	errno = 0;
+ 	static const char *locale_enc = gettext_init.GetEncoding();
+ 	iconv_t cd = iconv_open("UTF-8", locale_enc);
+-	char *in_buf = const_cast<char *>(&text_locally_encoded[0]);
++	const char *in_buf = const_cast<char *>(&text_locally_encoded[0]);
+ 	char *out_buf = &text_utf8[0];
+ 	iconv(cd, &in_buf, &text_length, &out_buf, &text_utf8_length);
+ 	iconv_close(cd);
--- c.diff ends here ---
Comment 5 Jamie Jones 2010-08-29 18:27:11 UTC
Please could you apply the patch as submitted, and in addition place
the attached file into the 'files' subdirectory (it allows the
game to compile on machines without the freebsd9 'bsd iconv')

Cheers,
Jamie
Comment 6 Jamie Jones 2010-08-29 18:43:15 UTC
Apologies, I hadn't noticed the revised patches attached to the PR

Yes, please apply the patches a.diff, b.diff, and c.diff, supplied
by Anonymous <swell.k@gmail.com>

Cheers,
Jamie
Comment 7 swell.k 2010-08-29 18:47:32 UTC
Jamie Landeg Jones <jamie@bishopston.net> writes:

> Please could you apply the patch as submitted, and in addition place
> the attached file into the 'files' subdirectory (it allows the
> game to compile on machines without the freebsd9 'bsd iconv')

As I've said in the private mails BSD iconv is not *yet* in /head.
Besides, your patch was already submitted by me as "c.diff".
Comment 8 Jamie Jones 2010-08-29 18:57:30 UTC
> As I've said in the private mails BSD iconv is not *yet* in /head.

Oh, I thought it was!

> Besides, your patch was already submitted by me as "c.diff".

Yes, just noticed.. Our emails crossed (mine got delayed somewhat)
Comment 9 Emanuel Haupt freebsd_committer freebsd_triage 2010-08-31 18:35:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ehaupt

I will take care of it.
Comment 10 Emanuel Haupt freebsd_committer freebsd_triage 2010-09-02 10:17:52 UTC
State Changed
From-To: feedback->open

Feedback received.
Comment 11 Emanuel Haupt freebsd_committer freebsd_triage 2010-09-02 10:17:57 UTC
State Changed
From-To: open->feedback

Could someone please create one single patch against the current version in the tree?
Comment 12 Emanuel Haupt freebsd_committer freebsd_triage 2010-09-02 11:41:54 UTC
State Changed
From-To: feedback->open

Patch received from Anonymous <swell.k@gmail.com> via mail.
Comment 13 dfilter service freebsd_committer freebsd_triage 2010-09-02 12:12:20 UTC
ehaupt      2010-09-02 11:12:06 UTC

  FreeBSD ports repository

  Modified files:
    games/hex-a-hop      Makefile distinfo pkg-descr pkg-plist 
  Added files:
    games/hex-a-hop/files patch-src-i18n.h 
                          patch-src-system-relative.c 
                          patch-src-text.cpp 
  Removed files:
    games/hex-a-hop/files patch-Makefile.FreeBSD 
                          patch-hex_puzzzle.cpp patch-menus.h 
                          patch-state.h 
  Log:
  Update to 1.1.0
  
  PR:             150074
  Submitted by:   Anonymous <swell.k@gmail.com>
  Approved by:    Jamie Landeg Jones <jamie@bishopston.net> (maintainer)
  
  Revision  Changes    Path
  1.10      +42 -15    ports/games/hex-a-hop/Makefile
  1.2       +3 -3      ports/games/hex-a-hop/distinfo
  1.2       +0 -19     ports/games/hex-a-hop/files/patch-Makefile.FreeBSD (dead)
  1.2       +0 -11     ports/games/hex-a-hop/files/patch-hex_puzzzle.cpp (dead)
  1.2       +0 -11     ports/games/hex-a-hop/files/patch-menus.h (dead)
  1.1       +10 -0     ports/games/hex-a-hop/files/patch-src-i18n.h (new)
  1.1       +20 -0     ports/games/hex-a-hop/files/patch-src-system-relative.c (new)
  1.1       +11 -0     ports/games/hex-a-hop/files/patch-src-text.cpp (new)
  1.2       +0 -11     ports/games/hex-a-hop/files/patch-state.h (dead)
  1.2       +1 -2      ports/games/hex-a-hop/pkg-descr
  1.3       +31 -10    ports/games/hex-a-hop/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 14 Emanuel Haupt freebsd_committer freebsd_triage 2010-09-02 12:12:21 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 15 Jamie Jones 2010-09-02 15:40:26 UTC
Complete patch attached.

 --- complete-patch.diff begins here ---
 Index: games/hex-a-hop/Makefile
===================================================================
RCS file: /a/.cvsup/ports/games/hex-a-hop/Makefile,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile
--- games/hex-a-hop/Makefile	19 Aug 2009 15:03:32 -0000	1.9
+++ games/hex-a-hop/Makefile	28 Aug 2010 19:58:45 -0000
@@ -6,29 +6,49 @@
 #
 
 PORTNAME=	hex-a-hop
-PORTVERSION=	1.0.0
-PORTREVISION=	4
+PORTVERSION=	1.1.0
 CATEGORIES=	games
-MASTER_SITES=	http://ftp.bishopston.net/freebsd/distfiles/ \
-		ftp://ftp.bishopston.net/freebsd/distfiles/ \
-		http://critical.ch/distfiles/
+MASTER_SITES=	SF/${PORTNAME:S/-//g}/${PORTNAME}/${PORTVERSION}
 
 MAINTAINER=	jamie@bishopston.net
 COMMENT=	A puzzle game based on hexagonal tiles
 
 USE_SDL=	sdl
-MAKEFILE=	Makefile.FreeBSD
-ALL_TARGET=	${PORTNAME}
+GNU_CONFIGURE=	yes
+CONFIGURE_ENV=	CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
+
+CPPFLAGS+=	-I${LOCALBASE}/include
+CFLAGS+=	-I${LOCALBASE}/include
+LDFLAGS+=	-L${LOCALBASE}/lib
+
+OPTIONS=	PANGO "Use sdl_pango instead of sdl_ttf" off \
+		SOUND "Compile sound support" on
 
-MAKE_ARGS+=	SYSTEM_INSTALL_DIR="${DATADIR}/"
 DESKTOP_ENTRIES="Hex-a-Hop" "A puzzle game based on hexagonal tiles" \
-		"${DATADIR}/graphics/icon.bmp" \
+		"${DATADIR}/icon.bmp" \
 		"hex-a-hop" "Application;LogicGame;Game;" false
 
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/hex-a-hop ${PREFIX}/bin
-	${MKDIR} ${DATADIR}/graphics
-	${INSTALL_DATA} ${WRKSRC}/graphics/* ${DATADIR}/graphics/
-	${INSTALL_DATA} ${WRKSRC}/levels.dat ${DATADIR}/
+.include <bsd.port.pre.mk>
+
+.if !defined(WITHOUT_NLS)
+USE_GETTEXT=	yes
+CONFIGURE_ENV+=	ac_cv_header_libintl_h=yes
+LDFLAGS+=	-lintl
+.else
+CONFIGURE_ENV+=	ac_cv_header_libintl_h=no
+.endif
+
+.if !defined(WITHOUT_PANGO)
+USE_SDL+=	pango
+CONFIGURE_ARGS+=--disable-sdlttf
+.else
+USE_SDL+=	ttf
+.endif
+
+.if !defined(WITHOUT_SOUND)
+USE_SDL+=	mixer
+.else
+CONFIGURE_ARGS+=--disable-sound
+.endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: games/hex-a-hop/distinfo
===================================================================
RCS file: /a/.cvsup/ports/games/hex-a-hop/distinfo,v
retrieving revision 1.1
diff -u -p -r1.1 distinfo
--- games/hex-a-hop/distinfo	20 Mar 2006 19:50:18 -0000	1.1
+++ games/hex-a-hop/distinfo	28 Aug 2010 18:46:18 -0000
@@ -1,3 +1,3 @@
-MD5 (hex-a-hop-1.0.0.tar.gz) = 0f8623f061eee8508d8ca78d86ed15e2
-SHA256 (hex-a-hop-1.0.0.tar.gz) = 200b2b88133f532419398224d29d72ca394168fbc7646b7ce50985867ac275a7
-SIZE (hex-a-hop-1.0.0.tar.gz) = 883536
+MD5 (hex-a-hop-1.1.0.tar.gz) = cc8d065c2cc0fce9e08852b8c465175e
+SHA256 (hex-a-hop-1.1.0.tar.gz) = 80bf19d936a8430cab5bc468ee6827c38052e026c609eb7ece16317e7932a0d6
+SIZE (hex-a-hop-1.1.0.tar.gz) = 9249269
Index: games/hex-a-hop/pkg-descr
===================================================================
RCS file: /a/.cvsup/ports/games/hex-a-hop/pkg-descr,v
retrieving revision 1.1
diff -u -p -r1.1 pkg-descr
--- games/hex-a-hop/pkg-descr	20 Mar 2006 19:50:18 -0000	1.1
+++ games/hex-a-hop/pkg-descr	28 Aug 2010 21:03:59 -0000
@@ -5,5 +5,4 @@ The objective is simply to destroy all t
 100 levels. As you progress through the game, more types of tiles are introduced
 which make things more difficult and interesting (hopefully).
 
-Author: Tom Beaumont <tombeaumont@yahoo.com>
-WWW: http://www.aceinternet.co.uk/~mokona/
+WWW: http://hexahop.sourceforge.net/
Index: games/hex-a-hop/pkg-plist
===================================================================
RCS file: /a/.cvsup/ports/games/hex-a-hop/pkg-plist,v
retrieving revision 1.2
diff -u -p -r1.2 pkg-plist
--- games/hex-a-hop/pkg-plist	30 Sep 2008 09:20:15 -0000	1.2
+++ games/hex-a-hop/pkg-plist	28 Aug 2010 19:19:11 -0000
@@ -1,13 +1,34 @@
 bin/hex-a-hop
-%%DATADIR%%/graphics/emi.dat
-%%DATADIR%%/graphics/font.dat
-%%DATADIR%%/graphics/gradient.dat
-%%DATADIR%%/graphics/icon.bmp
-%%DATADIR%%/graphics/map.dat
-%%DATADIR%%/graphics/map_top.dat
-%%DATADIR%%/graphics/tiles.dat
-%%DATADIR%%/graphics/tiles_reflect.dat
-%%DATADIR%%/graphics/title.dat
+%%DATADIR%%/emi.dat
+%%DATADIR%%/font.dat
+%%DATADIR%%/font.ttf
+%%DATADIR%%/gradient.dat
+%%DATADIR%%/icon.bmp
 %%DATADIR%%/levels.dat
-@dirrm %%DATADIR%%/graphics
+%%DATADIR%%/map.dat
+%%DATADIR%%/map_top.dat
+%%DATADIR%%/music-ending-nonfree.ogg
+%%DATADIR%%/music-game-nonfree-1.ogg
+%%DATADIR%%/music-game-nonfree.ogg
+%%DATADIR%%/sound-builder-nonfree.ogg
+%%DATADIR%%/sound-collapse-nonfree.ogg
+%%DATADIR%%/sound-crack.ogg
+%%DATADIR%%/sound-death.ogg
+%%DATADIR%%/sound-explode-big.ogg
+%%DATADIR%%/sound-explode-small.ogg
+%%DATADIR%%/sound-floater-enter.ogg
+%%DATADIR%%/sound-found-antiice-nonfree.ogg
+%%DATADIR%%/sound-found-jump-nonfree.ogg
+%%DATADIR%%/sound-ice.ogg
+%%DATADIR%%/sound-laser.ogg
+%%DATADIR%%/sound-lift-down-nonfree.ogg
+%%DATADIR%%/sound-lift-up-nonfree.ogg
+%%DATADIR%%/sound-spinner-nonfree.ogg
+%%DATADIR%%/sound-trampoline.ogg
+%%DATADIR%%/sound-used-antiice.ogg
+%%DATADIR%%/sound-used-jump.ogg
+%%DATADIR%%/sound-win.ogg
+%%DATADIR%%/tiles.dat
+%%DATADIR%%/tiles_reflect.dat
+%%DATADIR%%/title.dat
 @dirrm %%DATADIR%%
Index: games/hex-a-hop/files/patch-Makefile.FreeBSD
===================================================================
RCS file: games/hex-a-hop/files/patch-Makefile.FreeBSD
diff -N games/hex-a-hop/files/patch-Makefile.FreeBSD
--- games/hex-a-hop/files/patch-Makefile.FreeBSD	20 Sep 2006 11:21:08 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
---- Makefile.FreeBSD.orig	Tue Sep 12 17:28:37 2006
-+++ Makefile.FreeBSD	Tue Sep 12 17:28:53 2006
-@@ -11,13 +11,13 @@
- .endif
- 
- hex-a-hop:	gfx.o hex_puzzzle.o
--		$(CXX) $(CXXFLAGS) gfx.o hex_puzzzle.o `sdl11-config --libs` -lm -o hex-a-hop
-+		$(CXX) $(CXXFLAGS) gfx.o hex_puzzzle.o `sdl-config --libs` -lm -o hex-a-hop
- 
- gfx.o:		gfx.cpp state.h
--		$(CC) $(CXXFLAGS)  `sdl11-config --cflags`  -c -o $@ $<
-+		$(CC) $(CXXFLAGS)  `sdl-config --cflags`  -c -o $@ $<
- 
- hex_puzzzle.o:	hex_puzzzle.cpp *.h
--		$(CC) $(CXXFLAGS)  `sdl11-config --cflags`  -c -o $@ $<
-+		$(CC) $(CXXFLAGS)  `sdl-config --cflags`  -c -o $@ $<
- 	
- clean :
- 		rm -f gfx.o hex_puzzzle.o hex-a-hop
Index: games/hex-a-hop/files/patch-hex_puzzzle.cpp
===================================================================
RCS file: games/hex-a-hop/files/patch-hex_puzzzle.cpp
diff -N games/hex-a-hop/files/patch-hex_puzzzle.cpp
--- games/hex-a-hop/files/patch-hex_puzzzle.cpp	30 Sep 2008 09:20:15 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- hex_puzzzle.cpp.orig	2006-02-21 07:12:34.000000000 +0300
-+++ hex_puzzzle.cpp	2008-09-14 21:34:14.296378652 +0400
-@@ -2313,7 +2313,7 @@
- 
- 	SDL_Surface* Load(const char * bmp, bool colourKey=true)
- 	{
--		typedef unsigned long uint32;
-+		typedef unsigned int uint32;
- 		uint32* tmp = 0;
- 
- 		SDL_Surface * g = 0;
Index: games/hex-a-hop/files/patch-menus.h
===================================================================
RCS file: games/hex-a-hop/files/patch-menus.h
diff -N games/hex-a-hop/files/patch-menus.h
--- games/hex-a-hop/files/patch-menus.h	30 Sep 2008 09:20:15 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- menus.h.orig	2006-02-21 06:10:35.000000000 +0300
-+++ menus.h	2008-09-14 21:34:41.711083734 +0400
-@@ -1073,7 +1073,7 @@
- 		if (under)
- 			under->Render();
- 
--		RenderFade(time, dir, (int)this);
-+		RenderFade(time, dir, reinterpret_cast<intptr_t>(this));
- 	}
- 	void Update(double timedelta)
- 	{
Index: games/hex-a-hop/files/patch-src-i18n.h
===================================================================
RCS file: games/hex-a-hop/files/patch-src-i18n.h
diff -N games/hex-a-hop/files/patch-src-i18n.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/hex-a-hop/files/patch-src-i18n.h	28 Aug 2010 19:38:38 -0000
@@ -0,0 +1,10 @@
+--- src/i18n.h~
++++ src/i18n.h
+@@ -20,6 +20,7 @@
+ 
+ #ifdef USE_GETTEXT
+ 
++#include <iconv.h>
+ #include <libintl.h>
+ #define _(String) gettext (String)
+ 
Index: games/hex-a-hop/files/patch-src-system-relative.c
===================================================================
RCS file: games/hex-a-hop/files/patch-src-system-relative.c
diff -N games/hex-a-hop/files/patch-src-system-relative.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/hex-a-hop/files/patch-src-system-relative.c	28 Aug 2010 19:45:09 -0000
@@ -0,0 +1,20 @@
+--- src/system-relative.c~
++++ src/system-relative.c
+@@ -163,6 +163,8 @@ lisys_relative_exename ()
+ 	}
+ 
+ 	return strdup (name);
++#elif __FreeBSD__
++	return getprogname();
+ #else
+ #warning "Not supported."
+ 	return NULL;
+@@ -177,7 +179,7 @@ lisys_relative_exename ()
+ char*
+ lisys_relative_exedir ()
+ {
+-#if defined WIN32 || defined linux
++#if defined WIN32 || defined linux || defined __FreeBSD__
+ 	char* tmp;
+ 	char* ptr;
+ 
Index: games/hex-a-hop/files/patch-state.h
===================================================================
RCS file: games/hex-a-hop/files/patch-state.h
diff -N games/hex-a-hop/files/patch-state.h
--- games/hex-a-hop/files/patch-state.h	20 Sep 2006 11:21:08 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- state.h.orig	Tue Sep 12 17:30:34 2006
-+++ state.h	Tue Sep 12 17:30:40 2006
-@@ -22,7 +22,7 @@
- 
- // LINUX: SDL/
- #ifdef __FreeBSD__
--#include <SDL11/SDL.h>
-+#include <SDL/SDL.h>
- #else
- #include <SDL/SDL.h>
- #endif
diff --git games/hex-a-hop/Makefile games/hex-a-hop/Makefile
index be21e7f..b3da6aa 100644
--- games/hex-a-hop/Makefile
+++ games/hex-a-hop/Makefile
@@ -30,6 +30,10 @@ DESKTOP_ENTRIES="Hex-a-Hop" "A puzzle game based on hexagonal tiles" \
 
 .include <bsd.port.pre.mk>
 
+.if !defined(WITH_DEBUG)
+CONFIGURE_ARGS+=--disable-debug
+.endif
+
 .if !defined(WITHOUT_NLS)
 USE_GETTEXT=	yes
 CONFIGURE_ENV+=	ac_cv_header_libintl_h=yes
@@ -51,4 +55,7 @@ USE_SDL+=	mixer
 CONFIGURE_ARGS+=--disable-sound
 .endif
 
+post-patch:	.SILENT
+	${REINPLACE_CMD} -E '/CFLAGS|CXXFLAGS/s/-g//' ${WRKSRC}/configure
+
 .include <bsd.port.post.mk>
Index: games/hex-a-hop/files/patch-src-text.cpp
===================================================================
RCS file: games/hex-a-hop/files/patch-src-text.cpp
diff -N games/hex-a-hop/files/patch-src-text.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/hex-a-hop/files/patch-src-text.cpp	29 Aug 2010 14:00:10 -0000
@@ -0,0 +1,11 @@
+--- src/text.cpp~
++++ src/text.cpp
+@@ -439,7 +439,7 @@ void ConvertToUTF8(const std::string &te
+ 	errno = 0;
+ 	static const char *locale_enc = gettext_init.GetEncoding();
+ 	iconv_t cd = iconv_open("UTF-8", locale_enc);
+-	char *in_buf = const_cast<char *>(&text_locally_encoded[0]);
++	const char *in_buf = const_cast<char *>(&text_locally_encoded[0]);
+ 	char *out_buf = &text_utf8[0];
+ 	iconv(cd, &in_buf, &text_length, &out_buf, &text_utf8_length);
+ 	iconv_close(cd);
 --- complete-patch.diff ends here ---