updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / 3 / gtk3_support.patch
blob7a99574c35ef271ca82230ea67566502f95c7775
1 === modified file 'Makefile.am'
2 --- old/Makefile.am 2010-01-08 22:13:05 +0000
3 +++ new/Makefile.am 2011-07-23 21:39:04 +0000
4 @@ -1,8 +1,14 @@
5 SUBDIRS=gtkspell examples docs po
7 pkgconfigdir=$(libdir)/pkgconfig
9 +if USE_GTK3
10 +pkgconfig_DATA=gtkspell3-2.0.pc
11 +DISTCLEANFILES=gtkspell3-2.0.pc
12 +else
13 pkgconfig_DATA=gtkspell-2.0.pc
14 DISTCLEANFILES=gtkspell-2.0.pc
15 +endif
17 dist-hook:
18 $(MAKE) -C "$(srcdir)/po" "$(GETTEXT_PACKAGE).pot"
20 === modified file 'configure.ac'
21 --- old/configure.ac 2010-01-08 22:13:05 +0000
22 +++ new/configure.ac 2011-07-24 00:34:17 +0000
23 @@ -15,11 +15,32 @@
24 SPELLER_LIB=-lenchant
26 AC_SUBST(SPELLER_LIB)
27 -GTKSPELL_PACKAGES=gtk+-2.0
29 +AC_ARG_WITH([gtk],
30 + [AS_HELP_STRING([--with-gtk],
31 + [Which version of gtk to use @<:@default=2@:>@])],
32 + [],
33 + [with_gtk=3])
34 +AS_IF([test "x$with_gtk" = x3],
35 + [PKG_CHECK_MODULES(GTKSPELL, gtk+-3.0
36 + enchant >= 0.4.0)
37 + GTKSPELL_PACKAGES=gtk+-3.0
38 + AC_SUBST(GTKSPELL_CFLAGS)
39 + AC_SUBST(GTKSPELL_LIBS)
40 + AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available])
41 + ],
42 + [test "x$with_gtk" = x2],
43 + [PKG_CHECK_MODULES(GTKSPELL, gtk+-2.0
44 + enchant >= 0.4.0)
45 + GTKSPELL_PACKAGES=gtk+-2.0
46 + AC_SUBST(GTKSPELL_CFLAGS)
47 + AC_SUBST(GTKSPELL_LIBS)
48 + ],
49 + [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
51 +AM_CONDITIONAL(USE_GTK3, [test "x$with_gtk" = x3])
53 AC_SUBST(GTKSPELL_PACKAGES)
54 -PKG_CHECK_MODULES(GTKSPELL, $GTKSPELL_PACKAGES enchant >= 0.4.0 )
55 -AC_SUBST(GTKSPELL_CFLAGS)
56 -AC_SUBST(GTKSPELL_LIBS)
58 # check Pango version so we can use PANGO_UNDERLINE_ERROR when available:
59 PKG_CHECK_MODULES(PANGO, [pango >= 1.3.5],
60 @@ -90,7 +111,7 @@
62 dnl AM_MAINTAINER_MODE
64 -AC_CONFIG_FILES(Makefile gtkspell/Makefile examples/Makefile gtkspell-2.0.pc gtkspell.spec docs/Makefile po/Makefile.in)
65 +AC_CONFIG_FILES(Makefile gtkspell/Makefile examples/Makefile gtkspell-2.0.pc gtkspell3-2.0.pc gtkspell.spec docs/Makefile po/Makefile.in)
67 GTK_DOC_CHECK(1.0)
70 === modified file 'examples/Makefile.am'
71 --- old/examples/Makefile.am 2005-09-06 13:00:45 +0000
72 +++ new/examples/Makefile.am 2011-07-23 21:39:04 +0000
73 @@ -1,6 +1,10 @@
74 noinst_PROGRAMS = simple advanced
75 AM_CFLAGS = @GTKSPELL_CFLAGS@ -I$(top_builddir)
76 INCLUDES = -I$(top_srcdir)
77 +if USE_GTK3
78 +LDADD = @GTKSPELL_LIBS@ $(top_builddir)/gtkspell/libgtkspell3.la
79 +else
80 LDADD = @GTKSPELL_LIBS@ $(top_builddir)/gtkspell/libgtkspell.la
81 +endif
82 simple_SOURCES = simple.c
83 advanced_SOURCES = advanced.c
85 === modified file 'gtkspell/Makefile.am'
86 --- old/gtkspell/Makefile.am 2005-09-06 13:00:45 +0000
87 +++ new/gtkspell/Makefile.am 2011-07-23 21:39:04 +0000
88 @@ -1,6 +1,20 @@
89 -lib_LTLIBRARIES=libgtkspell.la
90 +if USE_GTK3
91 +VER=3
92 +lib_LTLIBRARIES = libgtkspell3.la
93 +else
94 +VER=
95 +lib_LTLIBRARIES = libgtkspell.la
96 +endif
98 AM_CFLAGS=@GTKSPELL_CFLAGS@ -DG_LOG_DOMAIN=\"gtkspell\" -DLOCALEDIR=\""$(datadir)/locale"\"
99 +if USE_GTK3
100 +libgtkspell3_la_LIBADD=@GTKSPELL_LIBS@ @SPELLER_LIB@
101 +libgtkspell3_la_includedir=$(includedir)/gtkspell3-2.0/gtkspell
102 +libgtkspell3_la_include_HEADERS=gtkspell.h
103 +libgtkspell3_la_SOURCES=gtkspell.c deprecated.c gtkspell.h
104 +else
105 libgtkspell_la_LIBADD=@GTKSPELL_LIBS@ @SPELLER_LIB@
106 libgtkspell_la_includedir=$(includedir)/gtkspell-2.0/gtkspell
107 libgtkspell_la_include_HEADERS=gtkspell.h
108 libgtkspell_la_SOURCES=gtkspell.c deprecated.c gtkspell.h
109 +endif
111 === modified file 'gtkspell/gtkspell.c'
112 --- old/gtkspell/gtkspell.c 2010-01-08 22:13:05 +0000
113 +++ new/gtkspell/gtkspell.c 2011-07-23 21:39:04 +0000
114 @@ -310,7 +310,8 @@
116 get_word_extents_from_mark(spell->buffer, &start, &end, spell->mark_click);
117 oldword = gtk_text_buffer_get_text(spell->buffer, &start, &end, FALSE);
118 - newword = gtk_label_get_text(GTK_LABEL(GTK_BIN(menuitem)->child));
119 + newword =
120 + gtk_label_get_text(GTK_LABEL(gtk_bin_get_child(GTK_BIN(menuitem))));
122 if (debug) {
123 g_print("old word: '%s'\n", oldword);
125 === added file 'gtkspell3-2.0.pc.in'
126 --- old/gtkspell3-2.0.pc.in 1970-01-01 00:00:00 +0000
127 +++ new/gtkspell3-2.0.pc.in 2011-07-23 21:39:04 +0000
128 @@ -0,0 +1,13 @@
129 +prefix=@prefix@
130 +exec_prefix=@exec_prefix@
131 +libdir=@libdir@
132 +includedir=@includedir@
134 +Name: GTKSpell
135 +Description: GTK spelling library
136 +Version: @VERSION@
137 +Requires: @GTKSPELL_PACKAGES@
138 +Libs: -L${libdir} -lgtkspell3
139 +Libs.private: @SPELLER_LIB@
140 +Cflags: -I${includedir}/gtkspell3-2.0