svn commit: r566539 - in head/games/freeblocks: . files

Christian Weisgerber naddy at FreeBSD.org
Thu Feb 25 14:58:05 UTC 2021


Author: naddy
Date: Thu Feb 25 14:58:03 2021
New Revision: 566539
URL: https://svnweb.freebsd.org/changeset/ports/566539

Log:
  games/freeblocks: fix build on FreeBSD 13/14
  
  This fixes the variable declarations so the port will build with
  LLVM11's and GCC10's default of -fno-common.
  
  PR:		253722
  Approved by:	amdmi3

Added:
  head/games/freeblocks/files/patch-src_block.c   (contents, props changed)
  head/games/freeblocks/files/patch-src_block.h   (contents, props changed)
  head/games/freeblocks/files/patch-src_game.c   (contents, props changed)
  head/games/freeblocks/files/patch-src_game.h   (contents, props changed)
  head/games/freeblocks/files/patch-src_menu.h   (contents, props changed)
  head/games/freeblocks/files/patch-src_sys.c   (contents, props changed)
  head/games/freeblocks/files/patch-src_sys.h   (contents, props changed)
Modified:
  head/games/freeblocks/Makefile

Modified: head/games/freeblocks/Makefile
==============================================================================
--- head/games/freeblocks/Makefile	Thu Feb 25 14:53:10 2021	(r566538)
+++ head/games/freeblocks/Makefile	Thu Feb 25 14:58:03 2021	(r566539)
@@ -12,9 +12,6 @@ COMMENT=	Puzzle game with similar gameplay to Tetris A
 LICENSE=	GPLv3
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-BROKEN_FreeBSD_13=	ld: error: duplicate symbol: BLOCK_MOVE_SPEED
-BROKEN_FreeBSD_14=	ld: error: duplicate symbol: BLOCK_MOVE_SPEED
-
 USE_GITHUB=	yes
 GH_ACCOUNT=	dorkster
 

Added: head/games/freeblocks/files/patch-src_block.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_block.c	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,32 @@
+--- src/block.c.orig	2015-03-09 12:48:31 UTC
++++ src/block.c
+@@ -23,8 +23,28 @@ const int POINTS_PER_BLOCK = 10;
+ const int POINTS_PER_BUMP = 5;
+ const int POINTS_PER_COMBO_BLOCK = 15;
+ 
+-int speed_init = 1;
++int ROWS;
++int COLS;
++int NUM_BLOCKS;
++int START_ROWS;
++int DISABLED_ROWS;
++int CURSOR_MAX_X;
++int CURSOR_MIN_Y;
++int CURSOR_MAX_Y;
++int BLOCK_MOVE_SPEED;
++int DRAW_OFFSET_X;
++int DRAW_OFFSET_Y;
++
+ Block **blocks = NULL;
++int speed_init = 1;
++
++bool animating;
++int bump_timer;
++int bump_pixels;
++int speed;
++int speed_timer;
++int game_over_timer;
++bool jewels_cursor_select;
+ 
+ int blockRand(void) {
+     return rand() % NUM_BLOCKS;

Added: head/games/freeblocks/files/patch-src_block.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_block.h	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,63 @@
+--- src/block.h.orig	2015-03-09 12:48:31 UTC
++++ src/block.h
+@@ -33,21 +33,21 @@
+ #define SPEED_TIME 1800 / (60/FPS)
+ #define MAX_SPEED 25
+ 
+-const int POINTS_PER_BLOCK;
+-const int POINTS_PER_BUMP;
+-const int POINTS_PER_COMBO_BLOCK;
++extern const int POINTS_PER_BLOCK;
++extern const int POINTS_PER_BUMP;
++extern const int POINTS_PER_COMBO_BLOCK;
+ 
+-int ROWS;
+-int COLS;
+-int NUM_BLOCKS;
+-int START_ROWS;
+-int DISABLED_ROWS;
+-int CURSOR_MAX_X;
+-int CURSOR_MIN_Y;
+-int CURSOR_MAX_Y;
+-int BLOCK_MOVE_SPEED;
+-int DRAW_OFFSET_X;
+-int DRAW_OFFSET_Y;
++extern int ROWS;
++extern int COLS;
++extern int NUM_BLOCKS;
++extern int START_ROWS;
++extern int DISABLED_ROWS;
++extern int CURSOR_MAX_X;
++extern int CURSOR_MIN_Y;
++extern int CURSOR_MAX_Y;
++extern int BLOCK_MOVE_SPEED;
++extern int DRAW_OFFSET_X;
++extern int DRAW_OFFSET_Y;
+ 
+ typedef struct Block{
+     int x,y;
+@@ -62,15 +62,15 @@ typedef struct Block{
+     bool sound_after_move;
+ }Block;
+ 
+-Block **blocks;
+-bool animating;
+-int bump_timer;
+-int bump_pixels;
+-int speed;
+-int speed_init;
+-int speed_timer;
+-int game_over_timer;
+-bool jewels_cursor_select;
++extern Block **blocks;
++extern bool animating;
++extern int bump_timer;
++extern int bump_pixels;
++extern int speed;
++extern int speed_init;
++extern int speed_timer;
++extern int game_over_timer;
++extern bool jewels_cursor_select;
+ 
+ void blockSet(int i, int j, bool alive, int color);
+ void blockClear(int i, int j);

Added: head/games/freeblocks/files/patch-src_game.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_game.c	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,13 @@
+--- src/game.c.orig	2015-03-09 12:48:31 UTC
++++ src/game.c
+@@ -23,6 +23,10 @@
+ #include "menu.h"
+ #include "sys.h"
+ 
++bool cursor_moving;
++int cursor_timer;
++int rebind_index;
++
+ void gameTitle() {
+     title_screen = true;
+     high_scores_screen = false;

Added: head/games/freeblocks/files/patch-src_game.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_game.h	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,15 @@
+--- src/game.h.orig	2015-03-09 12:48:31 UTC
++++ src/game.h
+@@ -21,9 +21,9 @@
+ 
+ #include "sys.h"
+ 
+-bool cursor_moving;
+-int cursor_timer;
+-int rebind_index;
++extern bool cursor_moving;
++extern int cursor_timer;
++extern int rebind_index;
+ 
+ void gameTitle();
+ void gameHighScores();

Added: head/games/freeblocks/files/patch-src_menu.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_menu.h	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,15 @@
+--- src/menu.h.orig	2015-03-09 12:48:31 UTC
++++ src/menu.h
+@@ -37,9 +37,9 @@ typedef struct {
+     bool has_action;
+ }MenuItem;
+ 
+-MenuItem** menu_items;
+-int menu_option;
+-int menu_size;
++extern MenuItem** menu_items;
++extern int menu_option;
++extern int menu_size;
+ 
+ void menuItemUpdate(int i);
+ char* menuItemGetText(int i);

Added: head/games/freeblocks/files/patch-src_sys.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_sys.c	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,63 @@
+--- src/sys.c.orig	2015-03-09 12:48:31 UTC
++++ src/sys.c
+@@ -52,6 +52,7 @@ TTF_Font* font = NULL;
+ SDL_Surface* surface_blocks = NULL;
+ SDL_Surface* surface_clear = NULL;
+ SDL_Surface* surface_cursor = NULL;
++SDL_Surface* surface_cursor_highlight = NULL;
+ SDL_Surface* surface_cursor_single = NULL;
+ SDL_Surface* surface_bar = NULL;
+ SDL_Surface* surface_bar_inactive = NULL;
+@@ -68,6 +69,7 @@ Mix_Chunk* sound_drop = NULL;
+ SDL_Joystick* joy = NULL;
+ 
+ int score = 0;
++int high_scores[10];
+ bool title_screen = true;
+ bool high_scores_screen = false;
+ int options_screen = -1;
+@@ -77,15 +79,22 @@ bool quit = false;
+ 
+ int game_mode = GAME_MODE_DEFAULT;
+ 
++struct Cursor cursor;
++
+ int action_cooldown = 0;
+ ActionMove action_move = ACTION_NONE;
+ ActionMove action_last_move = ACTION_NONE;
+-ActionMove action_switch = ACTION_NONE;
++bool action_switch = false;
+ bool action_bump = false;
+ bool action_accept = false;
+ bool action_pause = false;
+ bool action_exit = false;
+ 
++Dork_String path_dir_config;
++Dork_String path_file_config;
++Dork_String path_file_highscores;
++Dork_String path_file_highscores_jewels;
++
+ int option_joystick = -1;
+ int option_sound = 8;
+ int option_music = 8;
+@@ -96,8 +105,20 @@ int option_fullscreen = 1;
+ int option_fullscreen = 0;
+ #endif
+ 
++SDLKey option_key[9];
++int option_joy_button[5];
++int option_joy_axis_x;
++int option_joy_axis_y;
++
+ SDLKey last_key = SDLK_UNKNOWN;
+ int last_joy_button = -1;
++
++SDL_Event event;
++
++// Timers
++unsigned int startTimer;
++unsigned int endTimer;
++unsigned int deltaTimer;
+ 
+ bool sysInit() {
+     if(SDL_Init(SDL_INIT_EVERYTHING) == -1) return false;

Added: head/games/freeblocks/files/patch-src_sys.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/freeblocks/files/patch-src_sys.h	Thu Feb 25 14:58:03 2021	(r566539)
@@ -0,0 +1,148 @@
+--- src/sys.h.orig	2015-03-09 12:48:31 UTC
++++ src/sys.h
+@@ -99,62 +99,63 @@ enum KEYBINDS {
+ 
+ extern const char* const key_desc[];
+ 
+-SDL_Surface* screen;
+-TTF_Font* font;
++extern SDL_Surface* screen;
++extern TTF_Font* font;
+ 
+-int score;
+-int high_scores[10];
+-bool title_screen;
+-bool high_scores_screen;
+-int options_screen;
+-bool game_over;
+-bool paused;
+-bool quit;
+-int game_mode;
++extern int score;
++extern int high_scores[10];
++extern bool title_screen;
++extern bool high_scores_screen;
++extern int options_screen;
++extern bool game_over;
++extern bool paused;
++extern bool quit;
++extern int game_mode;
+ 
+ struct Cursor {
+     int x1;
+     int y1;
+     int x2;
+     int y2;
+-}cursor;
++};
++extern struct Cursor cursor;
+ 
+-int action_cooldown;
++extern int action_cooldown;
+ typedef enum {
+     ACTION_NONE, ACTION_LEFT, ACTION_RIGHT, ACTION_UP, ACTION_DOWN
+ }ActionMove;
+-ActionMove action_move;
+-ActionMove action_last_move;
+-ActionMove action_switch;
+-bool action_bump;
+-bool action_accept;
+-bool action_pause;
+-bool action_exit;
++extern ActionMove action_move;
++extern ActionMove action_last_move;
++extern bool action_switch;
++extern bool action_bump;
++extern bool action_accept;
++extern bool action_pause;
++extern bool action_exit;
+ 
+-Dork_String path_dir_config;
+-Dork_String path_file_config;
+-Dork_String path_file_highscores;
+-Dork_String path_file_highscores_jewels;
++extern Dork_String path_dir_config;
++extern Dork_String path_file_config;
++extern Dork_String path_file_highscores;
++extern Dork_String path_file_highscores_jewels;
+ 
+-int option_joystick;
+-int option_sound;
+-int option_music;
+-int option_fullscreen;
++extern int option_joystick;
++extern int option_sound;
++extern int option_music;
++extern int option_fullscreen;
+ 
+-SDLKey option_key[9];
+-int option_joy_button[5];
+-int option_joy_axis_x;
+-int option_joy_axis_y;
++extern SDLKey option_key[9];
++extern int option_joy_button[5];
++extern int option_joy_axis_x;
++extern int option_joy_axis_y;
+ 
+-SDLKey last_key;
+-int last_joy_button;
++extern SDLKey last_key;
++extern int last_joy_button;
+ 
+-SDL_Event event;
++extern SDL_Event event;
+ 
+ // Timers
+-unsigned int startTimer;
+-unsigned int endTimer;
+-unsigned int deltaTimer;
++extern unsigned int startTimer;
++extern unsigned int endTimer;
++extern unsigned int deltaTimer;
+ 
+ // Functions
+ bool sysInit();
+@@ -176,26 +177,26 @@ void sysHighScoresSave();
+ void sysHighScoresClear();
+ 
+ // Images
+-SDL_Surface* surface_blocks;
+-SDL_Surface* surface_clear;
+-SDL_Surface* surface_cursor;
+-SDL_Surface* surface_cursor_highlight;
+-SDL_Surface* surface_bar;
+-SDL_Surface* surface_bar_inactive;
+-SDL_Surface* surface_background;
+-SDL_Surface* surface_background_jewels;
+-SDL_Surface* surface_title;
+-SDL_Surface* surface_highscores;
++extern SDL_Surface* surface_blocks;
++extern SDL_Surface* surface_clear;
++extern SDL_Surface* surface_cursor;
++extern SDL_Surface* surface_cursor_highlight;
++extern SDL_Surface* surface_bar;
++extern SDL_Surface* surface_bar_inactive;
++extern SDL_Surface* surface_background;
++extern SDL_Surface* surface_background_jewels;
++extern SDL_Surface* surface_title;
++extern SDL_Surface* surface_highscores;
+ 
+ // Music and Sounds
+-Mix_Music* music;
+-Mix_Music* music_jewels;
+-Mix_Chunk* sound_menu;
+-Mix_Chunk* sound_switch;
+-Mix_Chunk* sound_match;
+-Mix_Chunk* sound_drop;
++extern Mix_Music* music;
++extern Mix_Music* music_jewels;
++extern Mix_Chunk* sound_menu;
++extern Mix_Chunk* sound_switch;
++extern Mix_Chunk* sound_match;
++extern Mix_Chunk* sound_drop;
+ 
+ // Joystick
+-SDL_Joystick* joy;
++extern SDL_Joystick* joy;
+ 
+ #endif


More information about the svn-ports-all mailing list