On Tue, 2008-02-05 at 19:01 -0430, Efrain Valles Pulgar wrote: > I have generated a new patch with very important changes. As a result of > my last fix the timed scores failed to work. I have fixed this issue by > editing the Makefile.in . Please, disregard my last patch and consider > this new submition as my definite fix for this issue.
Thanks! I'm attaching a patch to add this to the package, for the maintainer to review. It might be a bit intrusive as I also removed the (non-working) patch to disable music playback. Just say the word and I can commit this to pkg-gnome svn. -- Cheers, Sven Arvidsson http://www.whiz.se PGP Key ID 760BDD22
Index: patches/editmakefile.patch
===================================================================
--- patches/editmakefile.patch (revision 0)
+++ patches/editmakefile.patch (revision 0)
@@ -0,0 +1,25 @@
+diff -Nur gweled-0.7/Makefile.in gweled-0.7.new/Makefile.in
+--- gweled-0.7/Makefile.in 2005-05-25 15:41:41.000000000 -0400
++++ gweled-0.7.new/Makefile.in 2008-02-05 18:32:59.000000000 -0430
+@@ -634,6 +634,8 @@
+ fi \
+ done \
+ fi
++ -$(mkinstalldirs) $(DESTDIR)$(scoredir)
++ -if test "x$(setgid)" = "xtrue"; then chgrp $(scores_group) $(DESTDIR)$(bindir)/gweled && chmod 2555 $(DESTDIR)$(bindir)/gweled ; fi
+ if test -d $(srcdir)/sounds; then \
+ $(mkinstalldirs) $(DESTDIR)$(datadir)/sounds/$(PACKAGE); \
+ for sound in $(srcdir)/sounds/*; do \
+@@ -642,12 +644,6 @@
+ fi \
+ done \
+ fi
+- -$(mkinstalldirs) $(DESTDIR)$(scoredir)
+- touch $(DESTDIR)$(scoredir)/gweled.easy.scores
+- -chown $(scores_user):$(scores_group) $(DESTDIR)$(scoredir)/gweled.easy.scores
+- -chmod 664 $(DESTDIR)$(scoredir)/gweled.easy.scores
+- -if test "x$(setgid)" = "xtrue"; then chgrp $(scores_group) $(DESTDIR)$(bindir)/gweled && chmod 2555 $(DESTDIR)$(bindir)/gweled ; fi
+-
+ dist-hook:
+ if test -d pixmaps; then \
+ mkdir $(distdir)/pixmaps; \
Index: patches/gweled_music_option.diff
===================================================================
--- patches/gweled_music_option.diff (revision 15376)
+++ patches/gweled_music_option.diff (working copy)
@@ -1,319 +0,0 @@
-diff -urN gweled-0.7.orig/src/board_engine.h gweled-0.7/src/board_engine.h
---- gweled-0.7.orig/src/board_engine.h 2005-05-25 23:03:04.000000000 +0200
-+++ gweled-0.7/src/board_engine.h 2007-05-31 07:34:13.000000000 +0200
-@@ -4,6 +4,7 @@
- typedef struct s_gweled_prefs
- {
- gboolean timer_mode;
-+ gboolean music_on;
- gint tile_width;
- gint tile_height;
- }GweledPrefs;
-diff -urN gweled-0.7.orig/src/callbacks.c gweled-0.7/src/callbacks.c
---- gweled-0.7.orig/src/callbacks.c 2005-05-25 23:14:58.000000000 +0200
-+++ gweled-0.7/src/callbacks.c 2007-05-31 07:34:13.000000000 +0200
-@@ -7,6 +7,7 @@
- #include <mikmod.h>
-
- #include "callbacks.h"
-+#include "music.h"
-
- #include "sge_core.h"
- #include "board_engine.h"
-@@ -340,3 +341,14 @@
- BOARD_HEIGHT * prefs.tile_height);
- }
- }
-+
-+void
-+on_music_checkbutton_toggled (GtkToggleButton * togglebutton, gpointer user_data)
-+{
-+ if (gtk_toggle_button_get_active (togglebutton)) {
-+ music_play();
-+ }
-+ else {
-+ music_stop();
-+ }
-+}
-diff -urN gweled-0.7.orig/src/callbacks.h gweled-0.7/src/callbacks.h
---- gweled-0.7.orig/src/callbacks.h 2003-11-05 00:00:00.000000000 +0100
-+++ gweled-0.7/src/callbacks.h 2007-05-31 07:34:13.000000000 +0200
-@@ -133,3 +133,7 @@
- void
- on_largeRadiobutton_toggled (GtkToggleButton *togglebutton,
- gpointer user_data);
-+
-+void
-+on_music_checkbutton_toggled (GtkToggleButton *togglebutton,
-+ gpointer user_data);
-diff -urN gweled-0.7.orig/src/gweled.glade gweled-0.7/src/gweled.glade
---- gweled-0.7.orig/src/gweled.glade 2004-09-14 20:36:00.000000000 +0200
-+++ gweled-0.7/src/gweled.glade 2007-05-31 07:32:12.000000000 +0200
-@@ -675,6 +675,21 @@
- <property name="fill">True</property>
- </packing>
- </child>
-+ <child>
-+ <widget class="GtkCheckButton" id="music_checkbutton">
-+ <property name="visible">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-+ <property name="label" translatable="yes">Play background music</property>
-+ <property name="draw_indicator">True</property>
-+ <signal name="toggled" handler="on_music_checkbutton_toggled"/>
-+ </widget>
-+ <packing>
-+ <property name="padding">0</property>
-+ <property name="expand">True</property>
-+ <property name="fill">True</property>
-+ </packing>
-+ </child>
- </widget>
- <packing>
- <property name="padding">0</property>
-diff -urN gweled-0.7.orig/src/main.c gweled-0.7/src/main.c
---- gweled-0.7.orig/src/main.c 2005-05-25 23:44:04.000000000 +0200
-+++ gweled-0.7/src/main.c 2007-05-31 07:37:28.000000000 +0200
-@@ -35,6 +35,7 @@
- #include "sge_core.h"
- #include "board_engine.h"
- #include "graphic_engine.h"
-+#include "music.h"
-
- // GLOBALS
- GnomeProgram *g_program;
-@@ -51,11 +52,12 @@
- GRand *g_random_generator;
-
- GweledPrefs prefs;
-+pthread_t thread;
-
--MODULE *module;
-+/*MODULE *module;*/
- SAMPLE *swap_sfx, *click_sfx;
-
--static pthread_t thread;
-+/*static pthread_t thread;*/
-
- void save_preferences(void)
- {
-@@ -91,6 +93,7 @@
- prefs.tile_width = 48;
- prefs.tile_height = 48;
- prefs.timer_mode = FALSE;
-+ prefs.music_on = TRUE;
-
- save_preferences();
- }
-@@ -122,6 +125,13 @@
- }
- if (radio_button)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radio_button), TRUE);
-+
-+ //Is the music playing at start ?
-+ radio_button = glade_xml_get_widget(gweled_xml, "music_checkbutton");
-+ if (prefs.music_on)
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radio_button), TRUE);
-+ else
-+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radio_button), FALSE);
- }
-
- void show_hiscores (int newscore_rank)
-@@ -232,15 +242,6 @@
- gtk_widget_destroy (box);
- }
- }
--
--
--void mikmod_thread(void *ptr)
--{
-- while (1) {
-- usleep(10000);
-- MikMod_Update();
-- }
--}
-
- int main (int argc, char **argv)
- {
-@@ -252,20 +253,8 @@
- gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, argc,
- argv, GNOME_PARAM_APP_DATADIR,
- PACKAGE_DATA_DIR, NULL);
--
-- /* register all the drivers */
-- MikMod_RegisterAllDrivers();
--
-- /* register all the module loaders */
-- MikMod_RegisterAllLoaders();
--
-- /* initialize the library */
-- if (MikMod_Init(""))
-- {
-- fprintf(stderr, "Could not initialize sound, reason: %s\n", MikMod_strerror(MikMod_errno));
-- //return; don't fail on sound problems
-- }
--
-+
-+ music_init ();
- sge_init ();
-
- g_random_generator = g_rand_new_with_seed (time (NULL));
-@@ -305,9 +294,6 @@
-
- gi_game_running = 0;
-
-- // load module
-- module = Player_Load(PACKAGE_DATA_DIR "/sounds/gweled/autonom.s3m", 64, 0);
--
- // load sound fx
- swap_sfx = Sample_Load(PACKAGE_DATA_DIR "/sounds/gweled/swap.wav");
- if (!swap_sfx) {
-@@ -330,13 +316,8 @@
-
- MikMod_EnableOutput();
-
-- if (module) {
-- Player_Start(module);
-- Player_SetVolume(64);
-- pthread_create(&thread, NULL, (void *)&mikmod_thread, NULL);
--
-- } else
-- fprintf(stderr, "Could not load module, reason: %s\n", MikMod_strerror(MikMod_errno));
-+ if (prefs.music_on)
-+ music_play();
-
- board_engine_id = gtk_timeout_add (100, board_engine_loop, NULL);
- sge_set_drawing_area (g_drawing_area, g_buffer_pixmap,
-@@ -353,15 +334,10 @@
- sge_destroy ();
- gtk_timeout_remove (board_engine_id);
- g_rand_free (g_random_generator);
-- g_object_unref(G_OBJECT(gweled_xml));
-+ g_object_unref(G_OBJECT(gweled_xml));
-+
-+ music_stop();
-
-- if (module)
-- {
-- pthread_cancel(thread);
-- pthread_join(thread, NULL);
-- Player_Stop();
-- Player_Free(module);
-- }
- if(swap_sfx)
- Sample_Free(swap_sfx);
- if(click_sfx)
-diff -urN gweled-0.7.orig/src/Makefile.am gweled-0.7/src/Makefile.am
---- gweled-0.7.orig/src/Makefile.am 2003-12-11 00:00:00.000000000 +0100
-+++ gweled-0.7/src/Makefile.am 2007-05-31 07:34:13.000000000 +0200
-@@ -13,7 +13,8 @@
- graphic_engine.c graphic_engine.h \
- sge_core.c sge_core.h \
- sge_utils.c sge_utils.h \
-- callbacks.c callbacks.h
-+ music.c music.h \
-+ callbacks.c callbacks.h
-
- EXTRA_DIST = \
- $(Data_DATA)
-diff -urN gweled-0.7.orig/src/music.c gweled-0.7/src/music.c
---- gweled-0.7.orig/src/music.c 1970-01-01 01:00:00.000000000 +0100
-+++ gweled-0.7/src/music.c 2007-05-31 07:38:55.000000000 +0200
-@@ -0,0 +1,84 @@
-+
-+
-+#include <mikmod.h>
-+#include <pthread.h>
-+#include <glib.h>
-+
-+#include "music.h"
-+#include "board_engine.h"
-+
-+extern GweledPrefs prefs;
-+extern pthread_t thread;
-+
-+static MODULE *module;
-+static gboolean is_playing;
-+
-+void music_init()
-+{
-+ /* register all the drivers */
-+ MikMod_RegisterDriver(&drv_AF);
-+ MikMod_RegisterDriver(&drv_esd);
-+ MikMod_RegisterDriver(&drv_alsa);
-+ MikMod_RegisterDriver(&drv_oss);
-+ MikMod_RegisterDriver(&drv_nos);
-+
-+ /* register all the module loaders */
-+ MikMod_RegisterAllLoaders();
-+
-+ /* initialize the library */
-+ if (MikMod_Init(""))
-+ {
-+ fprintf(stderr, "Could not initialize sound, reason: %s\n", MikMod_strerror(MikMod_errno));
-+ //return; don't fail on sound problems
-+ }
-+ is_playing = FALSE;
-+
-+}
-+
-+void music_thread(void *ptr)
-+{
-+ while (1) {
-+ usleep(10000);
-+ MikMod_Update();
-+ }
-+}
-+
-+void music_play()
-+{
-+ if (!music_isplaying())
-+ {
-+ // load module
-+ module = Player_Load(PACKAGE_DATA_DIR "/sounds/gweled/autonom.s3m", 64, 0);
-+ if (module) {
-+ Player_Start(module);
-+ Player_SetVolume(64);
-+ pthread_create(&thread, NULL, (void *)&music_thread, NULL);
-+ prefs.music_on = TRUE;
-+ is_playing = TRUE;
-+
-+ } else
-+ fprintf(stderr, "Could not load module, reason: %s\n", MikMod_strerror(MikMod_errno));
-+ }
-+}
-+
-+void music_stop()
-+{
-+ if (music_isplaying()){
-+ if (module)
-+ {
-+ Player_Stop();
-+ Player_Free(module);
-+ pthread_cancel(thread);
-+ pthread_join(thread, NULL);
-+ prefs.music_on = FALSE;
-+ is_playing = FALSE;
-+ }
-+ }
-+
-+}
-+
-+gboolean music_isplaying()
-+{
-+ return is_playing;
-+}
-+
-diff -urN gweled-0.7.orig/src/music.h gweled-0.7/src/music.h
---- gweled-0.7.orig/src/music.h 1970-01-01 01:00:00.000000000 +0100
-+++ gweled-0.7/src/music.h 2007-05-31 07:34:13.000000000 +0200
-@@ -0,0 +1,9 @@
-+#include <mikmod.h>
-+
-+void music_init();
-+void music_thread(void *ptr);
-+void music_play();
-+void music_stop();
-+int music_isplaying();
-+
-+
Index: changelog
===================================================================
--- changelog (revision 15376)
+++ changelog (working copy)
@@ -1,9 +1,16 @@
-gweled (0.7-3) unstable; urgency=low
+gweled (0.7-3) UNRELEASED; urgency=low
+ [ Ondřej Surý ]
* Add option to disable music (#398250) (Courtesy of Lionel Dricot)
- -- Ondřej Surý <[EMAIL PROTECTED]> Thu, 31 May 2007 07:40:04 +0200
+ [ Sven Arvidsson ]
+ * New patch, editmakefile, to fix high scores not getting saved,
+ (LP: #110268), thanks Efrain Valles Pulgar. (Closes: #406884)
+ * Remove gweled_music_option, it doesn't build and causes a crash by
+ being incompatible with existing configuration files.
+ -- Sven Arvidsson <[EMAIL PROTECTED]> Mon, 24 Mar 2008 21:49:24 +0100
+
gweled (0.7-2) unstable; urgency=low
* Disable disk writer driver in MikMod initialization
signature.asc
Description: This is a digitally signed message part

