rpms/denemo/devel denemo-0.8.18.patch,NONE,1.1 denemo.spec,1.17,1.18

Roy Rankin rrankin at fedoraproject.org
Wed Jul 14 10:31:05 UTC 2010


Author: rrankin

Update of /cvs/pkgs/rpms/denemo/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv6893

Modified Files:
	denemo.spec 
Added Files:
	denemo-0.8.18.patch 
Log Message:
Patch for gtk incompatibility


denemo-0.8.18.patch:
 print.c |   50 +++++++++++++++++++++++++++++++++++++++++++-------
 view.c  |   28 ++++++++++++++--------------
 2 files changed, 57 insertions(+), 21 deletions(-)

--- NEW FILE denemo-0.8.18.patch ---
--- src/print.c.org	2010-07-12 20:12:45.111950564 +1000
+++ src/print.c	2010-07-12 20:46:10.005825460 +1000
@@ -142,7 +142,8 @@
 gchar *
 get_lily_version_string (void)
 {
-  GError *error = NULL;
+  GError *err = NULL;
+  gboolean ok;
   gchar *version_string;
   double d;
   int standard_output;
@@ -155,7 +156,7 @@
   NULL
   };
 
-  g_spawn_async_with_pipes (NULL,            /* dir */
+  ok = g_spawn_async_with_pipes (NULL,            /* dir */
   arguments, NULL,       /* env */
   G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, /* child setup func */
   NULL,          /* user data */
@@ -163,7 +164,18 @@
   NULL, 	/*standard_input*/
   &standard_output,	/*standard output*/
   NULL,	/*standard error*/
-  &error);
+  &err);
+
+  if (!ok)
+  {
+    if (err)
+    {
+      g_warning ("%s", err->message);
+      g_error_free (err);
+      err = NULL;
+    }
+    return NULL;
+  }
 
   read(standard_output, buf, sizeof(buf));
   return regex_parse_version_number(buf);
@@ -203,6 +215,7 @@
 
 void convert_ly(gchar *lilyfile){
   GError *err = NULL;
+  gboolean ok;
 #ifdef G_OS_WIN32
   gchar *conv_argv[] = {
     "python"
@@ -219,7 +232,7 @@
     NULL
   };
 #endif
-  g_spawn_sync (locatedotdenemo (),		/* dir */
+  ok = g_spawn_sync (locatedotdenemo (),		/* dir */
 		conv_argv, NULL,	/* env */
 		G_SPAWN_SEARCH_PATH, NULL,	/* child setup func */
 		NULL,		/* user data */
@@ -227,7 +240,7 @@
 		NULL,		/* stderr */
 		NULL, &err);
 
-  if (err != NULL)
+  if (!ok && err != NULL)
     {
       g_warning ("%s", err->message);
       if(err) g_error_free (err);
@@ -378,6 +391,7 @@
 void
 run_lilypond(gchar *filename, DenemoGUI *gui){
 
+  gboolean ok;
   gchar *lilyfile = g_strconcat (filename, ".ly", NULL);
   gchar *resolution = g_strdup_printf("-dresolution=%d",(int) Denemo.prefs.resolution);
   gchar *printfile = g_strconcat (filename, "_", NULL);
@@ -438,7 +452,7 @@
   if (!gui->lilycontrol.excerpt)	  
 	  arguments = pdf;
   
-  g_spawn_async_with_pipes (locatedotdenemo (),		/* dir */
+  ok = g_spawn_async_with_pipes (locatedotdenemo (),		/* dir */
 		arguments, NULL,	/* env */
 		G_SPAWN_SEARCH_PATH  | G_SPAWN_DO_NOT_REAP_CHILD, NULL,	/* child setup func */
 		NULL,		/* user data */
@@ -447,6 +461,16 @@
 		NULL,		/* stdout */
 		&errors,		/* stderr */
 		&lily_err);
+  if (!ok)
+  {
+    if (lily_err)
+    {
+      g_warning ("%s", lily_err->message);
+      g_error_free (lily_err);
+      lily_err = NULL;
+    }
+    return;
+  }
   if (gui->lilycontrol.excerpt == TRUE)
     g_child_watch_add (printpid, (GChildWatchFunc)open_pngviewer  /*  GChildWatchFunc function */, filename);
   else
@@ -1011,6 +1035,7 @@
   g_spawn_close_pid (printviewpid);
   printviewpid = GPID_NONE;
   GError *error = NULL;
+  gboolean ok;
   normal_cursor();
   process_printpreview_errors();
   gchar *filename = get_printfile_pathbasename();
@@ -1040,6 +1065,7 @@
 void refresh_print_view (gboolean preview_only) {
   DenemoGUI *gui = Denemo.gui;
   GError *error = NULL;
+  gboolean ok;
   //g_print("preview only %d\n", preview_only);
   if((changecount == Denemo.gui->changecount) && ((gint)g_object_get_data(G_OBJECT(Denemo.gui->printarea), "printviewupdate")==Denemo.gui->changecount)) {
     if(confirm ("No changes since last update", "Cancel refresh of print view?"))
@@ -1116,7 +1142,7 @@
   busy_cursor();
   changecount = Denemo.gui->changecount;// keep track so we know it update is needed
 
-  g_spawn_async_with_pipes (locatedotdenemo (),		/* dir */
+  ok = g_spawn_async_with_pipes (locatedotdenemo (),		/* dir */
 		 arguments, NULL,	/* env */
 		 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL,	/* child setup func */
 		 NULL,		/* user data */
@@ -1126,6 +1152,16 @@
 	         &printpreview_errors,		/* stderr */
 		 &error);
   g_free(lilyfile);
+  if (!ok)
+  {
+    if (error)
+    {
+      g_warning ("%s", error->message);
+      g_error_free (error);
+      error = NULL;
+    }
+    return;
+  }
   g_child_watch_add (printviewpid, (GChildWatchFunc)printview_finished  /*  GChildWatchFunc function */, (gpointer)preview_only);
 }
 
--- src/view.c.orig	2010-07-07 15:12:28.000000000 +1000
+++ src/view.c	2010-07-14 07:01:19.920825277 +1000
@@ -2937,6 +2937,7 @@
 
   //create window system
   create_window();
+
   
   Denemo.prefs.cursor_highlight = TRUE;
 
@@ -4480,10 +4481,7 @@
       button = (GtkToolButton *)gtk_tool_button_new(NULL, NULL);
       label = gtk_label_new(NULL);
       gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
-      GtkWidget *ev = gtk_event_box_new();
-      gtk_container_add (GTK_CONTAINER(ev), label);
-      gtk_tool_button_set_label_widget (button, ev);
-      //gtk_event_box_set_above_child (ev, TRUE);
+      gtk_tool_button_set_label_widget (button, label);
       r->button = button;
     }
   if(!singleton) {
@@ -4639,7 +4637,7 @@
     else
       return;  //FIXME memory leak of r - well pattern is never NULL
     //g_print("rsteps is %p entry is %s, %s\n", r->rsteps, pattern, labelstr);
-    label = LABEL(r->button);
+    label = gtk_tool_button_get_label_widget(r->button);
     gtk_label_set_markup(GTK_LABEL(label), labelstr);
     g_free(labelstr);
   }
@@ -6539,7 +6537,9 @@
 /* set all labels in the hierarchy below widget to use markup */
 static void use_markup(GtkWidget *widget)
 {
-  // show_type(widget, "Widget Type: ");
+  if (!widget)
+	return;
+  //show_type(widget, "Widget Type: ");
 
  
   //g_print("container type %x\n", GTK_IS_CONTAINER(widget));
@@ -6552,7 +6552,7 @@
    // gtk_label_set_use_underline (GTK_LABEL (widget), FALSE); font_desc gets interpreted in GtkLabel but not GtkAccelLabel hmmm...
     //g_print("Before we have %d\n", gtk_label_get_use_markup        (widget));
     //gchar * label = gtk_label_get_label(widget);
-     //g_print("label before is %s\n", label);
+     //g_print("label before is \"%s\"\n", label);
     
     gtk_label_set_use_markup (GTK_LABEL (widget), TRUE);
     //g_print("after we have %d\n", gtk_label_get_use_markup        (widget));
@@ -6874,6 +6874,13 @@
     {"LilyDelete", NULL, N_("Delete Block"),NULL, N_("Delete this block"),G_CALLBACK (delete_lily_cb)}
   };
 
+  {
+  GtkActionGroup *lilyaction_group = gtk_action_group_new ("LilyActions");
+  gtk_action_group_set_translation_domain (lilyaction_group, NULL); 
+  gtk_action_group_add_actions (lilyaction_group, lily_menus,
+				G_N_ELEMENTS (lily_menus), Denemo.gui);
+  gtk_ui_manager_insert_action_group (ui_manager, lilyaction_group, 1);
+  }
   data_file = g_build_filename (
 #ifndef USE_LOCAL_DENEMOUI
 get_data_dir (),
@@ -7084,13 +7091,6 @@
   use_markup(Denemo.window);/* set all the labels to use markup so that we can use the music font. Be aware this means you cannot use labels involving "&" "<" and ">" and so on without escaping them 
 FIXME labels in toolitems are not correct until you do NewWindow.
 Really we should change the default for the class.*/
-  {
-  GtkActionGroup *lilyaction_group = gtk_action_group_new ("LilyActions");
-  gtk_action_group_set_translation_domain (lilyaction_group, NULL); 
-  gtk_action_group_add_actions (lilyaction_group, lily_menus,
-				G_N_ELEMENTS (lily_menus), Denemo.gui);
-  gtk_ui_manager_insert_action_group (ui_manager, lilyaction_group, 1);
-  }
  //  g_print("Turning on the modes\n");
 
 


Index: denemo.spec
===================================================================
RCS file: /cvs/pkgs/rpms/denemo/devel/denemo.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -p -r1.17 -r1.18
--- denemo.spec	11 Jul 2010 11:35:51 -0000	1.17
+++ denemo.spec	14 Jul 2010 10:31:05 -0000	1.18
@@ -1,10 +1,11 @@
-Summary: Graphical music notation program
-Name: denemo
-Version: 0.8.18
-Release: 1%{?dist}
-License: GPLv3+
-Group: Applications/Multimedia
-Source: ftp://ftp.gnu.org/gnu/denemo/denemo-%{version}.tar.gz
+Summary:	Graphical music notation program
+Name:		denemo
+Version:	0.8.18
+Release:	2%{?dist}
+License:	GPLv3+
+Group:		Applications/Multimedia
+Source:		ftp://ftp.gnu.org/gnu/denemo/denemo-%{version}.tar.gz
+Patch:		denemo-%{version}.patch
 
 
 
@@ -18,7 +19,7 @@ BuildRequires: fontpackages-devel lash-d
 BuildRequires: gtksourceview2-devel fluidsynth-devel
 BuildRequires: chrpath
 
-Requires: bug-buddy timidity++
+Requires: bug-buddy timidity++ lilypond
 Requires: denemo-music-fonts
 
 %package music-fonts
@@ -49,11 +50,14 @@ This font set is used by Denemo.
 %prep
 %setup -q
 
+%patch -p0
+
 %build
 %configure --enable-jack --enable-lash
 make %{?_smp_mflags}
 chrpath -d src/denemo
 chrpath -d libsmf/smfsh
+chmod 644 actions/*.scm
 
 %install
 rm -rf %{buildroot}
@@ -66,6 +70,7 @@ desktop-file-install --vendor=""\
 install -m 0755 -d %{buildroot}%{_fontdir}
 rm -f %{buildroot}/%{_bindir}/denemo-lilypond.bat
 
+
 # move the location of the music font
 mv fonts/LICENSE_OFL.txt LICENSE_OFL.txt
 install -m 0644 -p fonts/*.ttf %{buildroot}%{_fontdir}
@@ -98,6 +103,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Jul 12 2010 Roy Rankin <rrankin at ihug.com.au> - 0.8.18-2
+- Require lilypond, patch bug if lilypond not found
+
 * Sun Jul 11 2010 Roy Rankin <rrankin at ihug.com.au> - 0.8.18-1
 -License change GPLV2 to GPLV3+
 -Update for Denemo release 0.8.18  For now features see



More information about the scm-commits mailing list