In the "Developers" forum I badly copy&pasted these patches. I
resubmit them here to make them clearer since it seems some of them
didn't hit the CVS.

They are applied in this order:
Patch0:         %{name}-0.4.3-as_needed.patch
Patch1:         %{name}-0.4.3-cflags.patch
Patch2:         %{name}-0.4.3-f0r_init.patch (from CVS)
Patch3:         %{name}-0.4.3-gtk.patch (from CVS)
Patch4:         %{name}-0.4.3-undefined.patch
Patch5:         %{name}-0.4.3-aliasing.patch
Patch6:         %{name}-0.4.3-desktop_files.patch
Patch7:         %{name}-0.4.3-no_plugin_sym.patch
Patch8:         %{name}-0.4.3-pkg_config.patch


- as_needed (not applied)
Needed to be able to compile/link with --as-needed ld option.
Basically libraries must go to LIBS and not to LDFLAGS. If they are in
LDFLAGS they are inserted before the object files, and the linker only
searchs for undefined symbols in libraries that are *after* the object
files.
In the process libgmerlin_gtk is linked against libgmerlin, that was missing.

- cflags (not applied)
This is more cosmetic than anything else. When detecting the CFLAGS
needed by a library the CFLAGS specified by the user were also taken.
This duplicated the user provided cflags multiple times.

- undefined (applied)
Typo that made gcc nervous.

- aliasing  (not applied)
It seems equivalent code, but there is a subtle problem in the
original code. See "Casting does not work as expected when
optimization is turned on" in http://gcc.gnu.org/bugs/#nonbugs_c

- desktop_files (applied)
Freedesktop has desktop-file-validator
(http://freedesktop.org/wiki/Software/desktop-file-utils) to check
they follow the standard. The "Application" category is deprectaed, as
is "Encoding". Also icons that are not specified with an absolute path
must not include the file extension

- no_plugin_sym (wrongly applied? added to EXTRA_DIST but not removed
from pkgdata)
I don't think plugin.sym needs to be installed, true? It's only used
in the linking of plugin files.

- pkg_config (only half applied? gmerlin-gtk.pc.in was patched but
gmerlin.pc.in wasn't)
When dynamically linking you don't want to include all the
dependencies recursively.
Index: apps/camelot/vloopback.c
===================================================================
--- apps/camelot/vloopback.c.orig
+++ apps/camelot/vloopback.c
@@ -660,7 +660,7 @@ static void put_frame_ioctl(bg_vloopback
     
     v->output_open = 1;
     
-    ioctl_nr = *(unsigned long*)(buffer);
+    memcpy(&ioctl_nr, buffer, sizeof(ioctl_nr));
     arg = &buffer[sizeof(unsigned long)];
 
     if(!ioctl_nr)
Index: configure.ac
===================================================================
--- configure.ac.orig
+++ configure.ac
@@ -237,11 +237,9 @@ if test x$have_x = xtrue; then
 
 OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
-OLD_LDFLAGS=$LDFLAGS
-                                                                               
+
 CFLAGS=$X_FLAGS
-LDFLAGS="$X_LIBS $LDFLAGS -lXinerama"
-LIBS=$X_LIBS
+LIBS="$X_LIBS -lXinerama"
 
 AC_MSG_CHECKING(for xinerama)
 AC_TRY_LINK([#include <X11/Xlib.h>
@@ -261,7 +259,6 @@ fi
 AC_SUBST(XINERAMA_LIBS)
 
 CFLAGS=$OLD_CFLAGS
-LDFLAGS=$OLD_LDFLAGS
 LIBS=$OLD_LIBS
 
 fi
@@ -280,11 +277,9 @@ if test x$have_x = xtrue; then
 
 OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
-OLD_LDFLAGS=$LDFLAGS
                                                                                
 CFLAGS=$X_FLAGS
-LDFLAGS="$X_LIBS $LDFLAGS -lXtst"
-LIBS=$X_LIBS
+LIBS="$X_LIBS -lXtst"
 
 AC_MSG_CHECKING(for xtest)
 AC_TRY_LINK([#include <X11/Xlib.h>
@@ -304,7 +299,6 @@ fi
 AC_SUBST(XTEST_LIBS)
 
 CFLAGS=$OLD_CFLAGS
-LDFLAGS=$OLD_LDFLAGS
 LIBS=$OLD_LIBS
 
 fi
@@ -325,10 +319,8 @@ if test x$have_x = xtrue; then
 
 OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
-OLD_LDFLAGS=$LDFLAGS                                                                               
 CFLAGS=$X_FLAGS
-LIBS=$X_LIBS
-LDFLAGS="$X_LIBS $LDFLAGS -lXv"
+LIBS="$X_LIBS -lXv"
 
 AC_MSG_CHECKING(for xv)
 AC_TRY_LINK([#include <X11/Xlib.h>
@@ -349,7 +341,6 @@ AC_SUBST(XV_LIBS)
 
 CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
-LDFLAGS=$OLD_LDFLAGS
 
 fi
 
@@ -369,10 +360,8 @@ if test x$have_x = xtrue; then
 
 OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
-OLD_LDFLAGS=$LDFLAGS                                                                               
 CFLAGS=$X_FLAGS
-LIBS=$X_LIBS
-LDFLAGS="$X_LIBS $LDFLAGS -lXext"
+LIBS="$X_LIBS -lXext"
 
 AC_MSG_CHECKING(for x11 dpms)
 AC_TRY_LINK([#include <X11/Xlib.h>
@@ -393,7 +382,6 @@ AC_SUBST(XDPMS_LIBS)
 
 CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
-LDFLAGS=$OLD_LDFLAGS
 
 fi
 
@@ -411,10 +399,8 @@ if test x$have_x = xtrue; then
 
 OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
-OLD_LDFLAGS=$LDFLAGS                                                                               
 CFLAGS=$X_FLAGS
-LIBS=$X_LIBS
-LDFLAGS="$X_LIBS $LDFLAGS -lXfixes"
+LIBS="$X_LIBS -lXfixes"
 
 AC_MSG_CHECKING(for x11 dpms)
 AC_TRY_LINK([#include <X11/Xlib.h>
@@ -435,7 +421,6 @@ AC_SUBST(XFIXES_LIBS)
 
 CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
-LDFLAGS=$OLD_LDFLAGS
 
 fi
 
Index: lib/gtk/Makefile.am
===================================================================
--- lib/gtk/Makefile.am.orig
+++ lib/gtk/Makefile.am
@@ -63,5 +63,5 @@ urllink.c \
 urlselect.c \
 vumeter.c
 
-libgmerlin_gtk_la_LIBADD = @GTK_LIBS@
+libgmerlin_gtk_la_LIBADD = @GTK_LIBS@ $(top_builddir)/lib/libgmerlin.la
 
Index: lib/Makefile.am
===================================================================
--- lib/Makefile.am.orig
+++ lib/Makefile.am
@@ -31,7 +31,7 @@ else
 sem_sources = uthread_sem.c
 endif
 
-SUBDIRS = $(gtk_subdirs) $(x11_subdirs)
+SUBDIRS = $(x11_subdirs) . $(gtk_subdirs)
 
 AM_CFLAGS = \
 @FONTCONFIG_CFLAGS@ \
Index: m4/check_funcs.m4
===================================================================
--- m4/check_funcs.m4.orig
+++ m4/check_funcs.m4
@@ -577,11 +577,9 @@ esac],[test_libtiff=true])
 
 if test x$test_libtiff = xtrue; then
    
-OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
 
 LIBS="$LIBS -ltiff"
-CFLAGS="$CFLAGS"
    
 AC_MSG_CHECKING(for libtiff)
 AC_TRY_LINK([#include <tiffio.h>],
@@ -596,11 +594,9 @@ AC_TRY_LINK([#include <tiffio.h>],
 case $have_libtiff in
   true) AC_DEFINE(HAVE_LIBTIFF)
         AC_MSG_RESULT(yes)
-        TIFF_LIBS=$LIBS;
-        TIFF_CFLAGS=$CFLAGS ;;
+        TIFF_LIBS=$LIBS;;
   false) AC_MSG_RESULT(no); TIFF_LIBS=""; TIFF_CFLAGS="";;
 esac
-CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
 
 fi
@@ -755,11 +751,9 @@ esac],[test_libpng=true])
 
 if test x$test_libpng = xtrue; then
    
-OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
 
 LIBS="$LIBS -lpng -lm -lz"
-CFLAGS="$CFLAGS"
  
 AC_MSG_CHECKING(for libpng)
 AC_TRY_LINK([#include <png.h>],
@@ -772,11 +766,9 @@ AC_TRY_LINK([#include <png.h>],
 case $have_libpng in
   true) AC_DEFINE(HAVE_LIBPNG)
         AC_MSG_RESULT(yes)
-        PNG_LIBS=$LIBS;
-        PNG_CFLAGS=$CFLAGS ;;
+        PNG_LIBS=$LIBS;;
   false) AC_MSG_RESULT(no); PNG_LIBS=""; PNG_CFLAGS="";;
 esac
-CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
 
 fi
@@ -1572,10 +1564,8 @@ esac],[test_libjpeg=true])
 
 if test x$test_libjpeg = xtrue; then
 
-OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
 LIBS="$LIBS -ljpeg"
-CFLAGS="$CFLAGS"
 
 AC_MSG_CHECKING(for libjpeg)
 AC_TRY_LINK([#include <stdio.h>
@@ -1586,13 +1576,11 @@ AC_TRY_LINK([#include <stdio.h>
 case $have_libjpeg in
   true) AC_DEFINE(HAVE_LIBJPEG)
         AC_MSG_RESULT(yes)
-        JPEG_LIBS=$LIBS;
-        JPEG_CFLAGS=$CFLAGS;;
+        JPEG_LIBS=$LIBS;;
   false) AC_MSG_RESULT(no); JPEG_LIBS=""; JPEG_CFLAGS="";;
   * ) AC_MSG_RESULT("Somethings wrong: $have_libjpeg") ;;
 esac
 
-CFLAGS=$OLD_CFLAGS
 LIBS=$OLD_LIBS
 
 fi
@@ -1635,7 +1623,6 @@ dnl
 dnl Search for OpenGL libraries
 dnl
 
-OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
 
 have_GL="true"
@@ -1648,17 +1635,14 @@ int main() { if(0) glBegin(GL_QUADS); re
 ],[],[have_GL="false"])
 fi
 
-GL_CFLAGS=$CFLAGS
 GL_LIBS=$LIBS
 
-CFLAGS="$OLD_CFLAGS"
 LIBS="$OLD_LIBS"
 
 dnl
 dnl Check for GLX
 dnl
 
-OLD_CFLAGS=$CFLAGS
 OLD_LIBS=$LIBS
 
 have_GLX="true"
@@ -1671,10 +1655,8 @@ int main() { if(0) glXChooseFBConfig(NUL
 	NULL, NULL); return 0;}],[],[have_GLX="false"])
 fi
 
-GLX_CFLAGS=$CFLAGS
 GLX_LIBS=$LIBS
 
-CFLAGS="$OLD_CFLAGS"
 LIBS="$OLD_LIBS"
 
 if test "x$have_GL" = "xtrue"; then
Index: apps/alsamixer/gmerlin-alsamixer.desktop
===================================================================
--- apps/alsamixer/gmerlin-alsamixer.desktop.orig
+++ apps/alsamixer/gmerlin-alsamixer.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin mixer
 Name[de]=Gmerlin mixer
 Comment=Alsa mixer
 Comment[de]=Alsa mixer
 Exec=gmerlin_alsamixer
-Icon=gmerlin-alsamixer.png
+Icon=gmerlin-alsamixer
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;Audio;Mixer;
Index: apps/camelot/gmerlin-camelot.desktop
===================================================================
--- apps/camelot/gmerlin-camelot.desktop.orig
+++ apps/camelot/gmerlin-camelot.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Camelot
 Name[de]=Camelot
 Comment=Gmerlin webcam application
 Comment[de]=Gmerlin Webcam Programm
 Exec=camelot
-Icon=gmerlin-camelot.png
+Icon=gmerlin-camelot
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;AudioVideoEditing;
Index: apps/kbd/gmerlin-kbd.desktop
===================================================================
--- apps/kbd/gmerlin-kbd.desktop.orig
+++ apps/kbd/gmerlin-kbd.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin KBD
 Name[de]=Gmerlin KBD
 Comment=Configure the Gmerlin keyboard daemon
 Comment[de]=Gmerlin keyboard daemon konfigurieren
 Exec=gmerlin_kbd_config
-Icon=gmerlin-kbd.png
+Icon=gmerlin-kbd
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;AudioVideoEditing;
Index: apps/player/gmerlin-player.desktop
===================================================================
--- apps/player/gmerlin-player.desktop.orig
+++ apps/player/gmerlin-player.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin player
 Name[de]=Gmerlin player
 Comment=Multiformat mediaplayer
 Comment[de]=Multiformat mediaplayer
 Exec=gmerlin
-Icon=gmerlin-player.png
+Icon=gmerlin-player
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;Player;
Index: apps/plugincfg/gmerlin-plugincfg.desktop
===================================================================
--- apps/plugincfg/gmerlin-plugincfg.desktop.orig
+++ apps/plugincfg/gmerlin-plugincfg.desktop
@@ -1,10 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin plugin configurator
 Name[de]=Gmerlin plugin configurator
 Comment=Configure gmerlin plugins
 Comment[de]=Gmerlin Plugins konfigurieren
 Exec=gmerlin_plugincfg
-Icon=gmerlin-plugincfg.png
+Icon=gmerlin-plugincfg
 Type=Application
-Categories=Application;AudioVideo;
+Categories=AudioVideo;AudioVideoEditing;
Index: apps/recorder/gmerlin-recorder.desktop
===================================================================
--- apps/recorder/gmerlin-recorder.desktop.orig
+++ apps/recorder/gmerlin-recorder.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin recorder
 Name[de]=Gmerlin recorder
 Comment=Audio/video recorder
 Comment[de]=Audio/video recorder
 Exec=gmerlin_recorder
-Icon=gmerlin-recorder.png
+Icon=gmerlin-recorder
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;AudioVideoEditing;
Index: apps/transcoder/gmerlin-transcoder.desktop
===================================================================
--- apps/transcoder/gmerlin-transcoder.desktop.orig
+++ apps/transcoder/gmerlin-transcoder.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin transcoder
 Name[de]=Gmerlin transcoder
 Comment=Gmerlin multimedia transcoder
 Comment[de]=Gmerlin multimedia transcoder
 Exec=gmerlin_transcoder
-Icon=gmerlin-transcoder.png
+Icon=gmerlin-transcoder
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;AudioVideoEditing;
Index: apps/visualizer/gmerlin-visualizer.desktop
===================================================================
--- apps/visualizer/gmerlin-visualizer.desktop.orig
+++ apps/visualizer/gmerlin-visualizer.desktop
@@ -1,11 +1,9 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gmerlin visualizer
 Name[de]=Gmerlin visualisierer
 Comment=Run visualization plugins
 Comment[de]=Visualisierungs Plugins laufen lassen
 Exec=gmerlin_visualizer
-Icon=gmerlin-visualizer.png
+Icon=gmerlin-visualizer
 Type=Application
-Categories=Application;AudioVideo;
-
+Categories=AudioVideo;AudioVideoEditing;
Index: Makefile.am
===================================================================
--- Makefile.am.orig
+++ Makefile.am
@@ -12,9 +12,5 @@ SUBDIRS = po lib plugins tests apps icon
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gmerlin.pc $(gtk_pc) 
 
-pkgdatadir = $(datadir)/gmerlin/
-pkgdata_DATA = plugin.sym
-dist_pkgdata_DATA = plugin.sym
 
-
-EXTRA_DIST= config.rpath gmerlin.spec.in gmerlin.pc.in autogen.sh cvs_clean.sh cpuinfo.sh make_potfiles 
+EXTRA_DIST= config.rpath gmerlin.spec.in gmerlin.pc.in autogen.sh cvs_clean.sh cpuinfo.sh make_potfiles plugin.sym
Index: gmerlin-gtk.pc.in
===================================================================
--- gmerlin-gtk.pc.in.orig
+++ gmerlin-gtk.pc.in
@@ -6,7 +6,7 @@ included...@includedir@
 Name: Gmerlin-gtk
 Description: Gmerlin Gtk support library
 Version: @VERSION@
-Requires: gmerlin gtk+-2.0
-Libs: -L${libdir} -lgmerlin_gtk -lgmerlin
+Requires.private: gmerlin gtk+-2.0
+Libs: -L${libdir} -lgmerlin_gtk
 Cflags: -I${includedir}
 
Index: gmerlin.pc.in
===================================================================
--- gmerlin.pc.in.orig
+++ gmerlin.pc.in
@@ -6,7 +6,7 @@ included...@includedir@
 Name: Gmerlin
 Description: Gmerlin libraries
 Version: @VERSION@
-Requires: libxml-2.0 gavl
+Requires.private: libxml-2.0 gavl
 Libs: -L${libdir} -lgmerlin
 Cflags: -I${includedir}
 
Index: lib/x11/x11_window.c
===================================================================
--- lib/x11/x11_window.c.orig
+++ lib/x11/x11_window.c
@@ -748,9 +748,8 @@ static int create_window(bg_x11_window_t
       set_min_size(w, w->normal.win, w->min_width, w->min_height);
 
     w->normal.toplevel = w->normal.win;
-    
-    w->normal.focus_child =
-      w->normal.focus_child = XCreateSimpleWindow(w->dpy, w->normal.win,
+
+    w->normal.focus_child = XCreateSimpleWindow(w->dpy, w->normal.win,
                                                   -1, -1, 1, 1, 0,
                                                   0, 0);
     XSelectInput(w->dpy, w->normal.focus_child,
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Gmerlin-general mailing list
Gmerlin-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gmerlin-general

Reply via email to