From 02258d60068878be3d059a5aefd4147bef199cd5 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 25 Feb 2020 11:26:02 +0100 Subject: [PATCH] Fixed FTBFS --- 0002-Fix-global-variable-gcc10.patch | 408 +++++++++++++++++++++++++++ speech-dispatcher.spec | 6 +- 2 files changed, 413 insertions(+), 1 deletion(-) create mode 100644 0002-Fix-global-variable-gcc10.patch diff --git a/0002-Fix-global-variable-gcc10.patch b/0002-Fix-global-variable-gcc10.patch new file mode 100644 index 0000000..595287b --- /dev/null +++ b/0002-Fix-global-variable-gcc10.patch @@ -0,0 +1,408 @@ +diff -up speech-dispatcher-0.9.1-me/src/clients/say/options.c.me speech-dispatcher-0.9.1-me/src/clients/say/options.c +--- speech-dispatcher-0.9.1-me/src/clients/say/options.c.me 2020-02-25 11:18:40.491329730 +0100 ++++ speech-dispatcher-0.9.1-me/src/clients/say/options.c 2020-02-25 11:18:58.344502652 +0100 +@@ -33,6 +33,30 @@ + #include "options.h" + #include + ++signed int rate; ++signed int pitch; ++signed int pitch_range; ++signed int volume; ++ ++int list_output_modules; ++char *output_module; ++char *sound_icon; ++char *language; ++char *voice_type; ++char *punctuation_mode; ++char *priority; ++int pipe_mode; ++SPDDataMode ssml_mode; ++int spelling; ++int wait_till_end; ++int stop_previous; ++int cancel_previous; ++int list_synthesis_voices; ++char *synthesis_voice; ++ ++char *application_name; ++char *connection_name; ++ + void options_print_help(char *argv[]) + { + assert(argv); +diff -up speech-dispatcher-0.9.1-me/src/clients/say/options.h.me speech-dispatcher-0.9.1-me/src/clients/say/options.h +--- speech-dispatcher-0.9.1-me/src/clients/say/options.h.me 2020-02-25 11:16:53.433292880 +0100 ++++ speech-dispatcher-0.9.1-me/src/clients/say/options.h 2020-02-25 11:18:09.112025820 +0100 +@@ -22,29 +22,29 @@ + #include + #include "speechd_types.h" + +-signed int rate; +-signed int pitch; +-signed int pitch_range; +-signed int volume; ++extern signed int rate; ++extern signed int pitch; ++extern signed int pitch_range; ++extern signed int volume; + +-int list_output_modules; +-char *output_module; +-char *sound_icon; +-char *language; +-char *voice_type; +-char *punctuation_mode; +-char *priority; +-int pipe_mode; +-SPDDataMode ssml_mode; +-int spelling; +-int wait_till_end; +-int stop_previous; +-int cancel_previous; +-int list_synthesis_voices; +-char *synthesis_voice; ++extern int list_output_modules; ++extern char *output_module; ++extern char *sound_icon; ++extern char *language; ++extern char *voice_type; ++extern char *punctuation_mode; ++extern char *priority; ++extern int pipe_mode; ++extern SPDDataMode ssml_mode; ++extern int spelling; ++extern int wait_till_end; ++extern int stop_previous; ++extern int cancel_previous; ++extern int list_synthesis_voices; ++extern char *synthesis_voice; + +-char *application_name; +-char *connection_name; ++extern char *application_name; ++extern char *connection_name; + + static struct option long_options[] = { + {"rate", 1, 0, 'r'}, +diff -up speech-dispatcher-0.9.1-me/src/modules/festival_client.c.me speech-dispatcher-0.9.1-me/src/modules/festival_client.c +--- speech-dispatcher-0.9.1-me/src/modules/festival_client.c.me 2020-02-25 11:15:50.574684099 +0100 ++++ speech-dispatcher-0.9.1-me/src/modules/festival_client.c 2020-02-25 11:16:12.420895681 +0100 +@@ -72,6 +72,8 @@ + + #include "module_utils.h" + ++int festival_connection_crashed; ++ + /* For testing endianness */ + int fapi_endian_loc = 1; + +diff -up speech-dispatcher-0.9.1-me/src/modules/festival_client.h.me speech-dispatcher-0.9.1-me/src/modules/festival_client.h +--- speech-dispatcher-0.9.1-me/src/modules/festival_client.h.me 2020-02-25 11:15:26.264448667 +0100 ++++ speech-dispatcher-0.9.1-me/src/modules/festival_client.h 2020-02-25 11:15:41.373594996 +0100 +@@ -44,7 +44,7 @@ + #define FESTIVAL_DEFAULT_SERVER_PORT 1314 + #define FESTIVAL_DEFAULT_TEXT_MODE "fundamental" + +-int festival_connection_crashed; ++extern int festival_connection_crashed; + + typedef struct FT_Info { + int encoding; +diff -up speech-dispatcher-0.9.1-me/src/modules/module_utils.c.me speech-dispatcher-0.9.1-me/src/modules/module_utils.c +--- speech-dispatcher-0.9.1-me/src/modules/module_utils.c.me 2020-02-25 11:13:24.518269557 +0100 ++++ speech-dispatcher-0.9.1-me/src/modules/module_utils.c 2020-02-25 11:15:04.381236719 +0100 +@@ -35,6 +35,19 @@ extern char *module_index_mark; + + pthread_mutex_t module_stdout_mutex = PTHREAD_MUTEX_INITIALIZER; + ++int log_level; ++AudioID *module_audio_id; ++SPDMsgSettings msg_settings; ++SPDMsgSettings msg_settings_old; ++int current_index_mark; ++int Debug; ++FILE *CustomDebugFile; ++configfile_t *configfile; ++configoption_t *module_dc_options; ++int module_num_dc_options; ++const char *module_name; ++char *module_index_mark; ++ + char *do_message(SPDMessageType msgtype) + { + int ret; +diff -up speech-dispatcher-0.9.1-me/src/modules/module_utils.h.me speech-dispatcher-0.9.1-me/src/modules/module_utils.h +--- speech-dispatcher-0.9.1-me/src/modules/module_utils.h.me 2020-02-25 10:33:56.263622197 +0100 ++++ speech-dispatcher-0.9.1-me/src/modules/module_utils.h 2020-02-25 11:12:04.739496911 +0100 +@@ -49,23 +49,23 @@ typedef struct SPDMarks { + gboolean stop; + } SPDMarks; + +-int log_level; ++extern int log_level; + +-AudioID *module_audio_id; ++extern AudioID *module_audio_id; + +-SPDMsgSettings msg_settings; +-SPDMsgSettings msg_settings_old; ++extern SPDMsgSettings msg_settings; ++extern SPDMsgSettings msg_settings_old; + +-int current_index_mark; ++extern int current_index_mark; + +-int Debug; +-FILE *CustomDebugFile; ++extern int Debug; ++extern FILE *CustomDebugFile; + +-configfile_t *configfile; +-configoption_t *module_dc_options; +-int module_num_dc_options; ++extern configfile_t *configfile; ++extern configoption_t *module_dc_options; ++extern int module_num_dc_options; + +-const char *module_name; ++extern const char *module_name; + + #define CLEAN_OLD_SETTINGS_TABLE() do { \ + msg_settings_old.rate = -101;\ +@@ -395,7 +395,7 @@ configoption_t *add_config_option(config + #define INDEX_MARK_BODY_LEN 6 + #define INDEX_MARK_BODY "__spd_" + +-char *module_index_mark; ++extern char *module_index_mark; + + /* This macro must be placed at the initialization of the module so that the + later functions are possible to use */ +diff -up speech-dispatcher-0.9.1-me/src/modules/module_utils_addvoice.c.me speech-dispatcher-0.9.1-me/src/modules/module_utils_addvoice.c +diff -up speech-dispatcher-0.9.1-me/src/server/compare.c.me speech-dispatcher-0.9.1-me/src/server/compare.c +diff -up speech-dispatcher-0.9.1-me/src/server/compare.h.me speech-dispatcher-0.9.1-me/src/server/compare.h +--- speech-dispatcher-0.9.1-me/src/server/compare.h.me 2020-02-25 10:04:13.609883115 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/compare.h 2020-02-25 10:04:52.487176465 +0100 +@@ -27,7 +27,7 @@ gint compare_message_uid(gconstpointer e + gpointer x); + + /* Pointer to function compare_message_uid */ +-gint(*p_msg_lc) (); +-gint(*p_msg_uid_lc) (); ++extern gint(*p_msg_lc) (); ++extern gint(*p_msg_uid_lc) (); + + #endif /* COMPARE_H */ +diff -up speech-dispatcher-0.9.1-me/src/server/configuration.c.me speech-dispatcher-0.9.1-me/src/server/configuration.c +--- speech-dispatcher-0.9.1-me/src/server/configuration.c.me 2020-02-25 10:32:59.478177483 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/configuration.c 2020-02-25 10:33:27.484396815 +0100 +@@ -34,6 +34,9 @@ + + static TFDSetClientSpecific *cl_spec_section; + ++configoption_t *spd_options; ++int spd_num_options; ++ + /* So that gcc doesn't comply about casts to char* */ + + /* == CONFIGURATION MANAGEMENT FUNCTIONS */ +diff -up speech-dispatcher-0.9.1-me/src/server/configuration.h.me speech-dispatcher-0.9.1-me/src/server/configuration.h +--- speech-dispatcher-0.9.1-me/src/server/configuration.h.me 2020-02-25 10:32:35.318988280 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/configuration.h 2020-02-25 10:32:50.666108472 +0100 +@@ -29,8 +29,8 @@ + #define SPEECHD_DEFAULT_PORT 6560 + + /* Loading options from DotConf */ +-configoption_t *spd_options; +-int spd_num_options; ++extern configoption_t *spd_options; ++extern int spd_num_options; + + configoption_t *load_config_options(int *num_options); + void free_config_options(configoption_t * opts, int *num); +diff -up speech-dispatcher-0.9.1-me/src/server/speaking.c.me speech-dispatcher-0.9.1-me/src/server/speaking.c +--- speech-dispatcher-0.9.1-me/src/server/speaking.c.me 2020-02-25 10:17:46.504027581 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/speaking.c 2020-02-25 10:19:49.819993326 +0100 +@@ -45,6 +45,13 @@ static SPDPriority highest_priority = 0; + + int SPEAKING = 0; + int poll_count; ++OutputModule *speaking_module; ++int speaking_uid; ++int speaking_gid; ++int pause_requested; ++int pause_requested_fd; ++int pause_requested_uid; ++int resume_requested; + + /* + Speak() is responsible for getting right text from right +diff -up speech-dispatcher-0.9.1-me/src/server/speaking.h.me speech-dispatcher-0.9.1-me/src/server/speaking.h +--- speech-dispatcher-0.9.1-me/src/server/speaking.h.me 2020-02-25 10:01:08.728488059 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/speaking.h 2020-02-25 10:19:28.585827036 +0100 +@@ -26,15 +26,15 @@ + + #include + +-OutputModule *speaking_module; +-int speaking_uid; +-int speaking_gid; ++extern OutputModule *speaking_module; ++extern int speaking_uid; ++extern int speaking_gid; + + /* Pause and resume handling */ +-int pause_requested; +-int pause_requested_fd; +-int pause_requested_uid; +-int resume_requested; ++extern int pause_requested; ++extern int pause_requested_fd; ++extern int pause_requested_uid; ++extern int resume_requested; + + /* Speak() is responsible for getting right text from right + * queue in right time and saying it loud through corresponding +diff -up speech-dispatcher-0.9.1-me/src/server/speechd.c.me speech-dispatcher-0.9.1-me/src/server/speechd.c +--- speech-dispatcher-0.9.1-me/src/server/speechd.c.me 2020-02-25 10:21:09.589618040 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/speechd.c 2020-02-25 10:32:06.402761826 +0100 +@@ -60,11 +60,36 @@ void destroy_pid_file(); + /* Server socket file descriptor */ + int server_socket; + ++TSpeechDMode spd_mode; ++ + GMainLoop *main_loop = NULL; + gint server_timeout_source = 0; + + int client_count = 0; + ++struct SpeechdOptions SpeechdOptions; ++struct SpeechdStatus SpeechdStatus; ++pthread_t speak_thread; ++pthread_mutex_t logging_mutex; ++pthread_mutex_t element_free_mutex; ++pthread_mutex_t output_layer_mutex; ++pthread_mutex_t socket_com_mutex; ++GHashTable *fd_settings; ++GHashTable *language_default_modules; ++GHashTable *fd_uid; ++TSpeechDQueue *MessageQueue; ++GList *MessagePausedList; ++GList *client_specific_settings; ++GList *last_p5_block; ++TFDSetElement GlobalFDSet; ++int speaking_pipe[2]; ++GHashTable *speechd_sockets_status; ++FILE *logfile; ++FILE *custom_logfile; ++char *custom_log_kind; ++FILE *debug_logfile; ++TSpeechDMode spd_mode; ++ + static gboolean speechd_client_terminate(gpointer key, gpointer value, gpointer user); + static gboolean speechd_reload_dead_modules(gpointer user_data); + static gboolean speechd_load_configuration(gpointer user_data); +diff -up speech-dispatcher-0.9.1-me/src/server/speechd.h.me speech-dispatcher-0.9.1-me/src/server/speechd.h +--- speech-dispatcher-0.9.1-me/src/server/speechd.h.me 2020-02-25 10:03:39.505625770 +0100 ++++ speech-dispatcher-0.9.1-me/src/server/speechd.h 2020-02-25 10:30:13.186875177 +0100 +@@ -123,7 +123,7 @@ typedef enum { + SPD_MODE_SINGLE /* */ + } TSpeechDMode; + +-TSpeechDMode spd_mode; ++extern TSpeechDMode spd_mode; + + /* TSpeechDQueue is a queue for messages. */ + typedef struct { +@@ -148,7 +148,7 @@ typedef struct { + #include "alloc.h" + #include "speaking.h" + +-struct { ++extern struct SpeechdOptions { + char *communication_method; + int communication_method_set; + char *socket_path; +@@ -172,48 +172,48 @@ struct { + int server_timeout_set; + } SpeechdOptions; + +-struct { ++extern struct SpeechdStatus { + int max_uid; /* The largest assigned uid + 1 */ + int max_gid; /* The largest assigned gid + 1 */ + int max_fd; + } SpeechdStatus; + + /* speak() thread defined in speaking.c */ +-pthread_t speak_thread; +-pthread_mutex_t logging_mutex; +-pthread_mutex_t element_free_mutex; +-pthread_mutex_t output_layer_mutex; +-pthread_mutex_t socket_com_mutex; ++extern pthread_t speak_thread; ++extern pthread_mutex_t logging_mutex; ++extern pthread_mutex_t element_free_mutex; ++extern pthread_mutex_t output_layer_mutex; ++extern pthread_mutex_t socket_com_mutex; + + /* Table of all configured (and succesfully loaded) output modules */ + extern GList *output_modules; + + /* Table of settings for each active client (=each active socket)*/ +-GHashTable *fd_settings; ++extern GHashTable *fd_settings; + /* Table of default output modules for different languages */ +-GHashTable *language_default_modules; ++extern GHashTable *language_default_modules; + /* Table of relations between client file descriptors and their uids */ +-GHashTable *fd_uid; ++extern GHashTable *fd_uid; + + /* Speech Dispatcher main priority queue for messages */ +-TSpeechDQueue *MessageQueue; ++extern TSpeechDQueue *MessageQueue; + /* List of messages from paused clients waiting for resume */ +-GList *MessagePausedList; ++extern GList *MessagePausedList; + + /* List of different entries of client-specific configuration */ +-GList *client_specific_settings; ++extern GList *client_specific_settings; + + /* Saves the last received priority progress message */ +-GList *last_p5_block; ++extern GList *last_p5_block; + + /* Global default settings */ +-TFDSetElement GlobalFDSet; ++extern TFDSetElement GlobalFDSet; + + /* Inter thread comm pipe */ +-int speaking_pipe[2]; ++extern int speaking_pipe[2]; + + /* Managing sockets communication */ +-GHashTable *speechd_sockets_status; ++extern GHashTable *speechd_sockets_status; + typedef struct { + int awaiting_data; + int inside_block; +@@ -234,10 +234,10 @@ void MSG2(int level, char *kind, char *f + #define FATAL(msg) do { fatal_error(); MSG(-1,"Fatal error [%s:%d]:"msg, __FILE__, __LINE__); exit(EXIT_FAILURE); } while (0) + #define DIE(msg) do { MSG(0,"Error [%s:%d]:"msg, __FILE__, __LINE__); exit(EXIT_FAILURE); } while (0) + +-FILE *logfile; +-FILE *custom_logfile; +-char *custom_log_kind; +-FILE *debug_logfile; ++extern FILE *logfile; ++extern FILE *custom_logfile; ++extern char *custom_log_kind; ++extern FILE *debug_logfile; + + /* For debugging purposes, does nothing */ + void fatal_error(void); diff --git a/speech-dispatcher.spec b/speech-dispatcher.spec index c0a216a..8a85c71 100644 --- a/speech-dispatcher.spec +++ b/speech-dispatcher.spec @@ -2,7 +2,7 @@ Name: speech-dispatcher Version: 0.9.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: To provide a high-level device independent layer for speech synthesis # Almost all files are under GPLv2+, however @@ -14,6 +14,7 @@ Source0: https://github.com/brailcom/speechd/releases/download/%{version}/ Source1: http://www.freebsoft.org/pub/projects/sound-icons/sound-icons-0.1.tar.gz Patch1: 0001-Remove-pyxdg-dependency.patch +Patch2: 0002-Fix-global-variable-gcc10.patch BuildRequires: gcc gcc-c++ BuildRequires: alsa-lib-devel @@ -223,6 +224,9 @@ sed 's/# AudioOutputMethod "pulse,alsa"/AudioOutputMethod "pulse,alsa"/' %{build %{python3_sitearch}/speechd* %changelog +* Tue Feb 25 2020 Than Ngo - 0.9.1-6 +- Fixed FTBFS + * Fri Jan 31 2020 Fedora Release Engineering - 0.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild