[mingw-gtkhtml3: 2/20] Initial import
epienbro
epienbro at fedoraproject.org
Tue Mar 6 20:03:59 UTC 2012
commit cc01e20b1219628e3b7bd0efb39404f4ace6c65a
Author: epienbro <epienbro at fedoraproject.org>
Date: Mon Dec 14 18:11:45 2009 +0000
Initial import
.cvsignore | 1 +
gtkhtml-dont-search-for-gnome-icon-theme.patch | 14 +
gtkhtml-make-gconf-optional.patch | 258 ++++++++++++++++++++
gtkhtml-make-iso-codes-optional.patch | 11 +
...tml-perform-g-thread-init-in-test-program.patch | 11 +
gtkhtml_enable_static_build.patch | 20 ++
mingw32-gtkhtml3.spec | 184 ++++++++++++++
sources | 1 +
8 files changed, 500 insertions(+), 0 deletions(-)
---
diff --git a/.cvsignore b/.cvsignore
index e69de29..a71e694 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -0,0 +1 @@
+gtkhtml-3.29.3.tar.bz2
diff --git a/gtkhtml-dont-search-for-gnome-icon-theme.patch b/gtkhtml-dont-search-for-gnome-icon-theme.patch
new file mode 100644
index 0000000..57d795b
--- /dev/null
+++ b/gtkhtml-dont-search-for-gnome-icon-theme.patch
@@ -0,0 +1,14 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -178,11 +183,6 @@ AM_CONDITIONAL(HAVE_SOUP, test x$have_soup != xno)
+ AM_CONDITIONAL(HAVE_NEWSOUP, test x$HAVE_NEWSOUP != xno)
+
+ dnl **************************************************
+-dnl * Gnome Icon Theme
+-dnl **************************************************
+-PKG_CHECK_MODULES(GIT, gnome-icon-theme >= gnome_icon_theme_minimum_version)
+-
+-dnl **************************************************
+ dnl * iso-codes
+ dnl **************************************************
+
diff --git a/gtkhtml-make-gconf-optional.patch b/gtkhtml-make-gconf-optional.patch
new file mode 100644
index 0000000..8c65d45
--- /dev/null
+++ b/gtkhtml-make-gconf-optional.patch
@@ -0,0 +1,258 @@
+diff --git a/configure.ac b/configure.ac
+index 2e28dbe..5d2f5a9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -136,11 +136,16 @@ PKG_CHECK_MODULES(GTHREAD, $GTHREAD_MODULES)
+ AC_SUBST(GTHREAD_CFLAGS)
+ AC_SUBST(GTHREAD_LIBS)
+
+-GTKHTML_MODULES="gtk+-2.0 >= gtk_minimum_version enchant gconf-2.0 iso-codes"
++GTKHTML_MODULES="gtk+-2.0 >= gtk_minimum_version enchant iso-codes"
++PKG_CHECK_MODULES(GCONF, gconf-2.0, have_gconf=yes, have_gconf=no)
++if test "$have_gconf" = "true" ; then
++ GTKHTML_MODULES="$GTKHTML_MODULES gconf-2.0"
++fi
+ PKG_CHECK_MODULES(GTKHTML, $GTKHTML_MODULES)
+ AC_SUBST(GTKHTML_CFLAGS)
+ AC_SUBST(GTKHTML_LIBS)
+ AC_SUBST(GTKHTML_MODULES)
++AM_CONDITIONAL(HAVE_GCONF, test x$have_gconf != xno)
+
+ # Glade catalog files
+ AC_ARG_WITH(glade-catalog,
+diff --git a/gtkhtml/Makefile.am b/gtkhtml/Makefile.am
+index 6ac2d02..9e781c0 100644
+--- a/gtkhtml/Makefile.am
++++ b/gtkhtml/Makefile.am
+@@ -12,6 +12,10 @@ if HAVE_NEWSOUP
+ have_new_soup = -DHAVE_NEWSOUP
+ endif
+
++if HAVE_GCONF
++have_gconf = -DHAVE_GCONF
++endif
++
+ AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(srcdir) \
+@@ -19,6 +23,7 @@ AM_CPPFLAGS = \
+ $(SOUP_CFLAGS) \
+ $(I18N_LIB_CFLAGS) \
+ -DG_LOG_DOMAIN=\"gtkhtml\" \
++ ${have_gconf} \
+ ${have_new_soup}
+
+ AM_CFLAGS = \
+diff --git a/gtkhtml/gtkhtml-properties.h b/gtkhtml/gtkhtml-properties.h
+index ebfacf2..6eed7d7 100644
+--- a/gtkhtml/gtkhtml-properties.h
++++ b/gtkhtml/gtkhtml-properties.h
+@@ -27,7 +27,11 @@
+ #define GTK_HTML_GNOME_CONFIG_PREFIX "/gtkhtml/Settings/"
+
+ #include <gtk/gtk.h>
++#ifdef HAVE_GCONF
+ #include <gconf/gconf-client.h>
++#else
++typedef void* GConfClient;
++#endif
+
+ #include "gtkhtml-types.h"
+ #include "gtkhtml.h"
+diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
+index 6aa0cef..7ed2d0d 100644
+--- a/gtkhtml/gtkhtml.c
++++ b/gtkhtml/gtkhtml.c
+@@ -128,8 +128,10 @@ struct _ClipboardContents {
+
+ static GtkLayoutClass *parent_class = NULL;
+
++#ifdef HAVE_GCONF
+ static GConfClient *gconf_client = NULL;
+ static GError *gconf_error = NULL;
++#endif
+
+ enum {
+ TITLE_CHANGED,
+@@ -791,7 +793,9 @@ destroy (GtkObject *object)
+ }
+
+ if (html->priv->notify_monospace_font_id) {
++#ifdef HAVE_GCONF
+ gconf_client_notify_remove (gconf_client, html->priv->notify_monospace_font_id);
++#endif
+ html->priv->notify_monospace_font_id = 0;
+ }
+
+@@ -832,13 +836,19 @@ gtk_html_get_top_html (GtkHTML *html)
+ static cairo_font_options_t *
+ get_font_options (void)
+ {
+- gchar *antialiasing, *hinting, *subpixel_order;
++ gchar *antialiasing = NULL;
++ gchar *hinting = NULL;
++ gchar *subpixel_order = NULL;
++#ifdef HAVE_GCONF
+ GConfClient *gconf = gconf_client_get_default ();
++#endif
+ cairo_font_options_t *font_options = cairo_font_options_create ();
+
+ /* Antialiasing */
++#ifdef HAVE_GCONF
+ antialiasing = gconf_client_get_string (gconf,
+ "/desktop/gnome/font_rendering/antialiasing", NULL);
++#endif
+ if (antialiasing == NULL) {
+ cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
+ } else {
+@@ -851,8 +861,10 @@ get_font_options (void)
+ else
+ cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT);
+ }
++#ifdef HAVE_GCONF
+ hinting = gconf_client_get_string (gconf,
+ "/desktop/gnome/font_rendering/hinting", NULL);
++#endif
+ if (hinting == NULL) {
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
+ } else {
+@@ -867,8 +879,10 @@ get_font_options (void)
+ else
+ cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT);
+ }
++#ifdef HAVE_GCONF
+ subpixel_order = gconf_client_get_string (gconf,
+ "/desktop/gnome/font_rendering/rgba_order", NULL);
++#endif
+ if (subpixel_order == NULL) {
+ cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT);
+ } else {
+@@ -886,7 +900,9 @@ get_font_options (void)
+ g_free (antialiasing);
+ g_free (hinting);
+ g_free (subpixel_order);
++#ifdef HAVE_GCONF
+ g_object_unref (gconf);
++#endif
+ return font_options;
+ }
+
+@@ -925,6 +941,7 @@ gtk_html_set_fonts (GtkHTML *html, HTMLPainter *painter)
+ }
+ }
+
++#ifdef HAVE_GCONF
+ if (!fixed_name) {
+ GConfClient *gconf;
+
+@@ -943,6 +960,7 @@ gtk_html_set_fonts (GtkHTML *html, HTMLPainter *painter)
+ }
+ g_object_unref (gconf);
+ }
++#endif
+
+ if (!fixed_name) {
+ fixed_family = "Monospace";
+@@ -2365,6 +2383,7 @@ setup_class_properties (GtkHTML *html)
+ if (!klass->properties) {
+ klass->properties = gtk_html_class_properties_new (GTK_WIDGET (html));
+
++#ifdef HAVE_GCONF
+ if (!gconf_is_initialized ()) {
+ gchar *argv[] = { (gchar *) "gtkhtml", NULL };
+
+@@ -2381,6 +2400,7 @@ setup_class_properties (GtkHTML *html)
+ gconf_client_add_dir (gconf_client, GTK_HTML_GCONF_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, &gconf_error);
+ if (gconf_error)
+ g_error ("gconf error: %s\n", gconf_error->message);
++#endif
+ }
+ }
+
+@@ -2751,13 +2771,16 @@ drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint t
+ static void
+ read_key_theme (GtkHTMLClass *html_class)
+ {
+- gchar *key_theme;
++ gchar *key_theme = NULL;
+
++#ifdef HAVE_GCONF
+ key_theme = gconf_client_get_string (gconf_client_get_default (), "/desktop/gnome/interface/gtk_key_theme", NULL);
++#endif
+ html_class->use_emacs_bindings = key_theme && !strcmp (key_theme, "Emacs");
+ g_free (key_theme);
+ }
+
++#ifdef HAVE_GCONF
+ static void
+ client_notify_key_theme (GConfClient* client, guint cnxn_id, GConfEntry* entry, gpointer data)
+ {
+@@ -2783,6 +2806,7 @@ client_notify_cursor_blink (GConfClient* client, guint cnxn_id, GConfEntry* entr
+ else
+ html_engine_set_cursor_blink_timeout (0);
+ }
++#endif
+
+ static void
+ gtk_html_direction_changed (GtkWidget *widget, GtkTextDirection previous_dir)
+@@ -2823,7 +2847,9 @@ gtk_html_class_init (GtkHTMLClass *klass)
+ GtkLayoutClass *layout_class;
+ GtkContainerClass *container_class;
+ gchar *filename;
++#ifdef HAVE_GCONF
+ GConfClient *client;
++#endif
+
+ html_class = (GtkHTMLClass *) klass;
+ #ifdef USE_PROPS
+@@ -3178,6 +3204,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
+ html_class->emacs_bindings = gtk_binding_set_find ("gtkhtml-bindings-emacs");
+ read_key_theme (html_class);
+
++#ifdef HAVE_GCONF
+ client = gconf_client_get_default ();
+
+ gconf_client_notify_add (client, "/desktop/gnome/interface/gtk_key_theme",
+@@ -3188,6 +3215,7 @@ gtk_html_class_init (GtkHTMLClass *klass)
+ client_notify_cursor_blink (client, 0, NULL, NULL);
+
+ g_object_unref (client);
++#endif
+ }
+
+ static void
+@@ -3195,8 +3223,10 @@ init_properties_widget (GtkHTML *html)
+ {
+ setup_class_properties (html);
+
++#ifdef HAVE_GCONF
+ if (!gconf_client)
+ gconf_client = gconf_client_get_default ();
++#endif
+
+ }
+
+@@ -3478,9 +3508,11 @@ gtk_html_init (GtkHTML* html)
+ g_signal_connect (G_OBJECT (html->priv->im_context), "delete_surrounding",
+ G_CALLBACK (gtk_html_im_delete_surrounding_cb), html);
+
++#ifdef HAVE_GCONF
+ html->priv->notify_monospace_font_id =
+ gconf_client_notify_add (gconf_client_get_default (), "/desktop/gnome/interface/monospace_font_name",
+ client_notify_monospace_font, html, NULL, &gconf_error);
++#endif
+
+ gtk_html_construct (html);
+ }
+@@ -6042,7 +6074,11 @@ gtk_html_edit_make_cursor_visible (GtkHTML *html)
+ gboolean
+ gtk_html_build_with_gconf (void)
+ {
++#ifdef HAVE_GCONF
+ return TRUE;
++#else
++ return FALSE;
++#endif
+ }
+
+ static void
diff --git a/gtkhtml-make-iso-codes-optional.patch b/gtkhtml-make-iso-codes-optional.patch
new file mode 100644
index 0000000..8c227b8
--- /dev/null
+++ b/gtkhtml-make-iso-codes-optional.patch
@@ -0,0 +1,11 @@
+--- gtkhtml-3.28.0/configure.ac.orig 2009-09-24 19:01:36.394784545 +0200
++++ gtkhtml-3.28.0/configure.ac 2009-09-24 19:01:56.310533792 +0200
+@@ -137,7 +137,7 @@
+ AC_SUBST(GTHREAD_CFLAGS)
+ AC_SUBST(GTHREAD_LIBS)
+
+-GTKHTML_MODULES="gtk+-2.0 >= gtk_minimum_version enchant iso-codes"
++GTKHTML_MODULES="gtk+-2.0 >= gtk_minimum_version enchant"
+ PKG_CHECK_MODULES(GCONF, gconf-2.0, have_gconf=yes, have_gconf=no)
+ if test "$have_gconf" = "true" ; then
+ GTKHTML_MODULES="$GTKHTML_MODULES gconf-2.0"
diff --git a/gtkhtml-perform-g-thread-init-in-test-program.patch b/gtkhtml-perform-g-thread-init-in-test-program.patch
new file mode 100644
index 0000000..6f530cf
--- /dev/null
+++ b/gtkhtml-perform-g-thread-init-in-test-program.patch
@@ -0,0 +1,11 @@
+--- gtkhtml/testgtkhtml.c.orig 2009-09-24 19:50:51.248533238 +0200
++++ gtkhtml/testgtkhtml.c 2009-09-24 19:52:46.923783930 +0200
+@@ -1190,6 +1190,8 @@
+ gpointer p = malloc (1024); /* to make linker happy with ccmalloc */
+ #endif
+
++ if (!g_thread_supported ()) g_thread_init (NULL);
++
+ gtk_init(&argc, &argv);
+
+ app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
diff --git a/gtkhtml_enable_static_build.patch b/gtkhtml_enable_static_build.patch
new file mode 100644
index 0000000..d0b3b5e
--- /dev/null
+++ b/gtkhtml_enable_static_build.patch
@@ -0,0 +1,20 @@
+--- gtkhtml/dllmain.c.orig 2009-07-03 06:46:11.000000000 +0200
++++ gtkhtml/dllmain.c 2009-09-24 19:12:41.653533555 +0200
+@@ -84,6 +84,8 @@
+ #undef DATADIR
+ #include <windows.h>
+
++#ifndef GLIB_STATIC_COMPILATION
++
+ /* Silence gcc with a prototype */
+ BOOL WINAPI DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+@@ -103,6 +105,8 @@
+ return TRUE;
+ }
+
++#endif
++
+ /* Include gtkhtml-private.h now to get prototypes for the getter
+ * functions, to silence gcc. Can't include it earlier as we need the
+ * definitions of the *DIR macros from the Makefile above, and
diff --git a/mingw32-gtkhtml3.spec b/mingw32-gtkhtml3.spec
new file mode 100644
index 0000000..9b77f8e
--- /dev/null
+++ b/mingw32-gtkhtml3.spec
@@ -0,0 +1,184 @@
+%global __strip %{_mingw32_strip}
+%global __objdump %{_mingw32_objdump}
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_mingw32_findrequires}
+%global __find_provides %{_mingw32_findprovides}
+%define __debug_install_post %{_mingw32_debug_install_post}
+
+Name: mingw32-gtkhtml3
+Version: 3.29.3
+Release: 2%{?dist}
+Summary: MinGW library for embedding a lightweight web browser in GTK programs
+
+License: LGPLv2+
+Group: Development/Libraries
+URL: http://projects.gnome.org/evolution/
+Source: http://download.gnome.org/sources/gtkhtml/3.29/gtkhtml-%{version}.tar.bz2
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+# GConf doesn't work well on Win32 and it's only used by GtkHTML
+# to figure out font-related settings like antialiasing. Even if
+# we enable GConf support it doesn't make any sense as Windows maintains
+# such settings in the Win32 registry and there isn't a relation between
+# the GConf registry and the Win32 registry. This patch makes the
+# GConf dependency optional and makes GtkHTML use the default font settings
+Patch0: gtkhtml-make-gconf-optional.patch
+
+# The configure script searches for the presence of the pkgconfig file for
+# gnome-icon-theme which we don't have for Fedora-MinGW (as it only contains
+# a collection of icons and no source code). This patch strips out the
+# dependency for gnome-icon-theme and shouldn't cause any side-effects
+Patch1: gtkhtml-dont-search-for-gnome-icon-theme.patch
+
+# The same situation as with Patch1 also applies to the iso-codes dependency
+Patch2: gtkhtml-make-iso-codes-optional.patch
+
+# Normally GtkHTML always exports a function named 'DllMain' on
+# Win32 environments. When GtkHTML is built as a static library, this
+# function doesn't serve any purpose and it can introduce potential
+# conflicts with other static libraries which may export a 'DllMain' function
+# This patch causes the DllMain function to be ignore when GtkHTML is
+# being built as a static library
+Patch3: gtkhtml_enable_static_build.patch
+
+# When executing the testgtkhtml.exe program an error occurs mentioning
+# that the GLib threads system wasn't initialized yet. This patch
+# adds that initialisation
+Patch4: gtkhtml-perform-g-thread-init-in-test-program.patch
+
+BuildArch: noarch
+
+BuildRequires: mingw32-filesystem >= 53
+BuildRequires: mingw32-gcc
+BuildRequires: mingw32-binutils
+BuildRequires: mingw32-gtk2
+BuildRequires: mingw32-libgnurx
+BuildRequires: mingw32-libsoup
+BuildRequires: mingw32-enchant
+
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: intltool
+BuildRequires: glib2-devel
+
+Requires: pkgconfig
+
+%description
+GtkHTML is a lightweight HTML rendering/printing/editing engine
+This is the MinGW build of GtkHTML
+
+
+%package static
+Summary: Static version of the MinGW Windows GtkHTML library
+Requires: %{name} = %{version}-%{release}
+Group: Development/Libraries
+
+%description static
+Static version of the MinGW Windows GtkHTML library.
+
+
+%{_mingw32_debug_package}
+
+
+%prep
+%setup -q -n gtkhtml-%{version}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p0
+%patch4 -p0
+
+autoreconf
+libtoolize --copy --force
+
+
+%build
+# GtkHTML can't build static and shared libraries in one go, so we
+# build GtkHTML twice here
+mkdir build_static
+pushd build_static
+ %{_mingw32_configure} --enable-static --disable-shared CFLAGS="$CFLAGS -DGLIB_STATIC_COMPILATION -DGOBJECT_STATIC_COMPILATION"
+ make %{?_smp_mflags}
+popd
+
+mkdir build_shared
+pushd build_shared
+ %{_mingw32_configure} --disable-static --enable-shared
+ make %{?_smp_mflags}
+popd
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+# First install all the files belonging to the shared build
+make -C build_shared DESTDIR=$RPM_BUILD_ROOT install
+
+# Install all the files from the static build in a seperate folder
+# and move the static libraries to the right location
+make -C build_static DESTDIR=$RPM_BUILD_ROOT/build_static install
+mv $RPM_BUILD_ROOT/build_static%{_mingw32_libdir}/*.a $RPM_BUILD_ROOT%{_mingw32_libdir}
+
+# Manually merge the libtool files
+sed -i s/"old_library=''"/"old_library='libgtkhtml-3.14.a'"/ $RPM_BUILD_ROOT%{_mingw32_libdir}/libgtkhtml-3.14.la
+sed -i s/"old_library=''"/"old_library='libgtkhtml-editor.a'"/ $RPM_BUILD_ROOT%{_mingw32_libdir}/libgtkhtml-editor.la
+
+# Drop the folder which was temporary used for installing the static bits
+rm -rf $RPM_BUILD_ROOT/build_static
+
+# Install a small test program
+install -m0755 build_shared/gtkhtml/.libs/testgtkhtml.exe $RPM_BUILD_ROOT%{_mingw32_bindir}/testgtkhtml.exe
+
+%find_lang gtkhtml-3.14
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files -f gtkhtml-3.14.lang
+%defattr(-,root,root,-)
+%doc COPYING.LIB
+%{_mingw32_bindir}/gtkhtml-editor-test.exe
+%{_mingw32_bindir}/libgtkhtml-3.14-19.dll
+%{_mingw32_bindir}/libgtkhtml-editor-0.dll
+%{_mingw32_bindir}/testgtkhtml.exe
+%{_mingw32_includedir}/libgtkhtml-3.14
+%{_mingw32_libdir}/libgtkhtml-3.14.dll.a
+%{_mingw32_libdir}/libgtkhtml-3.14.la
+%{_mingw32_libdir}/libgtkhtml-editor.dll.a
+%{_mingw32_libdir}/libgtkhtml-editor.la
+%{_mingw32_libdir}/pkgconfig/libgtkhtml-3.14.pc
+%{_mingw32_libdir}/pkgconfig/gtkhtml-editor.pc
+%{_mingw32_datadir}/gtkhtml-3.14
+
+%files static
+%defattr(-,root,root,-)
+%{_mingw32_libdir}/libgtkhtml-3.14.a
+%{_mingw32_libdir}/libgtkhtml-editor.a
+
+
+%changelog
+* Fri Dec 11 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 3.29.3-2
+- Looks like the original license tag was correct: LGPLv2+
+- Bundle COPYING.LIB instead of COPYING
+
+* Fri Dec 11 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 3.29.3-1
+- Update to 3.29.3
+- Renamed 'webbrowser' in the summary to 'web browser' to keep rpmlint happy
+- Fixed the license tag
+
+* Thu Sep 24 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 3.28.0-1
+- Update to 3.28.0
+- Use %%global instead of %%define
+- Automatically generate debuginfo subpackage
+- Simplified the original patch to strip unnecessary deps
+- Added translations
+
+* Fri Apr 3 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 3.25.90-2
+- Added -static subpackage
+
+* Fri Feb 13 2009 Erik van Pienbroek <epienbro at fedoraproject.org> - 3.25.90-1
+- Initial release
+
diff --git a/sources b/sources
index e69de29..1bfff72 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+1439783818e20933c69199fa08a87e19 gtkhtml-3.29.3.tar.bz2
More information about the scm-commits
mailing list