aboutsummaryrefslogtreecommitdiff
path: root/games/tuxmath
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2020-09-26 11:29:06 +0000
committerStefan Eßer <se@FreeBSD.org>2020-09-26 11:29:06 +0000
commit2ae264e63b92e1726b7c1c8f9e79463361a01111 (patch)
treecc2e191b826d30982b041e8c5ed562efd6139575 /games/tuxmath
parent4e40b7fd56089f2f2e721a2851af7cb96abab2a8 (diff)
downloadports-2ae264e63b92e1726b7c1c8f9e79463361a01111.tar.gz
ports-2ae264e63b92e1726b7c1c8f9e79463361a01111.zip
Fix build with -fno-common
While here fix a few portlint and portclippy complaints
Notes
Notes: svn path=/head/; revision=550168
Diffstat (limited to 'games/tuxmath')
-rw-r--r--games/tuxmath/Makefile12
-rw-r--r--games/tuxmath/files/patch-src_menu.c11
-rw-r--r--games/tuxmath/files/patch-src_menu__lan.c11
-rw-r--r--games/tuxmath/files/patch-src_network.c11
-rw-r--r--games/tuxmath/files/patch-src_setup.c11
-rw-r--r--games/tuxmath/files/patch-src_titlescreen.c27
-rw-r--r--games/tuxmath/files/patch-t4k_common.h11
-rw-r--r--games/tuxmath/files/patch-t4k_main.c17
8 files changed, 106 insertions, 5 deletions
diff --git a/games/tuxmath/Makefile b/games/tuxmath/Makefile
index e0da70d87c01..d1afc4300540 100644
--- a/games/tuxmath/Makefile
+++ b/games/tuxmath/Makefile
@@ -3,7 +3,7 @@
PORTNAME= tuxmath
PORTVERSION= 2.0.3
-PORTREVISION= 6
+PORTREVISION= 7
PORTEPOCH= 1
CATEGORIES= games
MASTER_SITES= DEBIAN_POOL \
@@ -17,11 +17,11 @@ COMMENT= Educational arcade game starring Tux
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/doc/COPYING_GPL3
-WRKSRC= ${WRKDIR}/${PORTNAME}_w_fonts-${PORTVERSION}
+LIB_DEPENDS= libpng16.so:graphics/png
+USES= gmake gnome iconv localbase perl5 pkgconfig sdl
USE_GNOME= libxml2
USE_SDL= image mixer net pango sdl
-USES= gmake gnome iconv localbase perl5 pkgconfig sdl
GNU_CONFIGURE= yes
CONFIGURE_ENV= T4K_COMMON_CFLAGS="-I${T4K_WRKSRC}/src" \
T4K_COMMON_LIBS="${T4K_WRKSRC}/src/.libs/libt4k_common.a" \
@@ -31,6 +31,8 @@ CPPFLAGS+= $$(pkg-config --cflags SDL_Pango libpng) \
-DHAVE_ALPHASORT -DHAVE_SCANDIR -DHAVE_FSYNC -DICONV_CONST=""
LDFLAGS+= $$(pkg-config --libs SDL_Pango libpng) ${ICONV_LIB}
+WRKSRC= ${WRKDIR}/${PORTNAME}_w_fonts-${PORTVERSION}
+
T4K_NAME= t4k_common
T4K_VERSION= 0.1.1
T4K_DISTFILE= ${T4K_NAME:S/_//}_${T4K_VERSION}.orig${EXTRACT_SUFX}
@@ -40,12 +42,12 @@ OPTIONS_DEFINE= NLS SVG DOCS
OPTIONS_DEFAULT= SVG
OPTIONS_SUB= yes
-NLS_CONFIGURE_ENABLE= nls
NLS_USES= gettext
+NLS_CONFIGURE_ENABLE= nls
NLS_LDFLAGS= -lintl
-SVG_CONFIGURE_WITH= rsvg
SVG_USE= GNOME=librsvg2
+SVG_CONFIGURE_WITH= rsvg
post-extract:
@${LN} -sf ${T4K_WRKSRC} ${WRKDIR}/${T4K_NAME}
diff --git a/games/tuxmath/files/patch-src_menu.c b/games/tuxmath/files/patch-src_menu.c
new file mode 100644
index 000000000000..a714f264b217
--- /dev/null
+++ b/games/tuxmath/files/patch-src_menu.c
@@ -0,0 +1,11 @@
+--- src/menu.c.orig 2011-05-04 00:15:06 UTC
++++ src/menu.c
+@@ -79,7 +79,7 @@ static char* activities[] = { ACTIVITIES };
+ //const int min_font_size = 8, default_font_size = 20, max_font_size = 33;
+
+ /* menu title rect */
+-SDL_Rect menu_title_rect;
++extern SDL_Rect menu_title_rect;
+
+ /* buffer size used when reading attributes or names */
+ const int buf_size = 128;
diff --git a/games/tuxmath/files/patch-src_menu__lan.c b/games/tuxmath/files/patch-src_menu__lan.c
new file mode 100644
index 000000000000..742c57c79eca
--- /dev/null
+++ b/games/tuxmath/files/patch-src_menu__lan.c
@@ -0,0 +1,11 @@
+--- src/menu_lan.c.orig 2011-05-04 00:15:10 UTC
++++ src/menu_lan.c
+@@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.
+
+
+ /* lan_player_type now defined in network.h */
+-lan_player_type lan_player_info[MAX_CLIENTS];
++extern lan_player_type lan_player_info[MAX_CLIENTS];
+
+ /* Local function prototypes: ------------------- */
+ void draw_player_table(void);
diff --git a/games/tuxmath/files/patch-src_network.c b/games/tuxmath/files/patch-src_network.c
new file mode 100644
index 000000000000..28fd44c783d6
--- /dev/null
+++ b/games/tuxmath/files/patch-src_network.c
@@ -0,0 +1,11 @@
+--- src/network.c.orig 2011-05-04 00:15:17 UTC
++++ src/network.c
+@@ -54,7 +54,7 @@ static int connected_server = -1;
+ static int my_index = -1;
+
+ /* Keep track of other connected players: */
+-lan_player_type lan_player_info[MAX_CLIENTS];
++lan_player_type lan_player_info[MAX_CLIENTS];
+
+ /* Local function prototypes: */
+ int say_to_server(char *statement);
diff --git a/games/tuxmath/files/patch-src_setup.c b/games/tuxmath/files/patch-src_setup.c
new file mode 100644
index 000000000000..4ccbf469db53
--- /dev/null
+++ b/games/tuxmath/files/patch-src_setup.c
@@ -0,0 +1,11 @@
+--- src/setup.c.orig 2011-05-04 00:15:43 UTC
++++ src/setup.c
+@@ -64,7 +64,7 @@ along with this program. If not, see <http://www.gnu.
+ /* (These are now 'extern'd in "tuxmath.h") */
+
+
+-SDL_Surface* screen;
++extern SDL_Surface* screen;
+ SDL_Surface* images[NUM_IMAGES];
+ sprite* sprites[NUM_SPRITES];
+ /* Need special handling to generate flipped versions of images. This
diff --git a/games/tuxmath/files/patch-src_titlescreen.c b/games/tuxmath/files/patch-src_titlescreen.c
new file mode 100644
index 000000000000..5fa9947ddea0
--- /dev/null
+++ b/games/tuxmath/files/patch-src_titlescreen.c
@@ -0,0 +1,27 @@
+--- src/titlescreen.c.orig 2011-05-04 00:16:12 UTC
++++ src/titlescreen.c
+@@ -41,16 +41,16 @@ SDL_Rect dstupdate[MAX_UPDATES];
+ int numupdates = 0; // tracks how many blits to be done
+
+ // Colors we use:
+-SDL_Color black;
+-SDL_Color gray;
+-SDL_Color dark_blue;
+-SDL_Color red;
+-SDL_Color white;
+-SDL_Color yellow;
+-SDL_Color bright_green;
++extern SDL_Color black;
++extern SDL_Color gray;
++extern SDL_Color dark_blue;
++extern SDL_Color red;
++extern SDL_Color white;
++extern SDL_Color yellow;
++extern SDL_Color bright_green;
+
+ // Type needed for trans_wipe():
+-struct blit {
++extern struct blit {
+ SDL_Surface *src;
+ SDL_Rect *srcrect;
+ SDL_Rect *dstrect;
diff --git a/games/tuxmath/files/patch-t4k_common.h b/games/tuxmath/files/patch-t4k_common.h
new file mode 100644
index 000000000000..dd635539e47d
--- /dev/null
+++ b/games/tuxmath/files/patch-t4k_common.h
@@ -0,0 +1,11 @@
+--- ../t4k_common-0.1.1/src/t4k_common.h.orig 2011-03-25 00:35:15.000000000 +0100
++++ ../t4k_common-0.1.1/src/t4k_common.h 2020-09-26 12:24:04.794856000 +0200
+@@ -239,7 +239,7 @@
+ #define MAX_LINES 128 //!< Maximum lines to wrap.
+ #define MAX_LINEWIDTH 256 //!< Maximum characters of each line.
+
+-char wrapped_lines[MAX_LINES][MAX_LINEWIDTH]; //!< Global buffer for wrapped lines.
++extern char wrapped_lines[MAX_LINES][MAX_LINEWIDTH]; //!< Global buffer for wrapped lines.
+
+ //TODO separate headers for different areas a la SDL?
+
diff --git a/games/tuxmath/files/patch-t4k_main.c b/games/tuxmath/files/patch-t4k_main.c
new file mode 100644
index 000000000000..ae6e7b617579
--- /dev/null
+++ b/games/tuxmath/files/patch-t4k_main.c
@@ -0,0 +1,17 @@
+--- ../t4k_common/src/t4k_main.c.orig 2011-03-25 00:00:24.000000000 +0100
++++ ../t4k_common/src/t4k_main.c 2020-09-26 13:17:06.379943000 +0200
+@@ -29,7 +29,13 @@
+ int debug_status;
+
+
+-SDL_Color red, yellow, white, black;
++SDL_Color black;
++SDL_Color gray;
++SDL_Color dark_blue;
++SDL_Color red;
++SDL_Color white;
++SDL_Color yellow;
++SDL_Color bright_green;
+
+
+ /* set global variables */