Subject: Re: gkrellm2 package
To: Julio Merino <jmmv@menta.net>
From: Quentin Garnier <netbsd@quatriemek.com>
List: tech-pkg
Date: 04/02/2003 20:34:46
Le Sat, 15 Mar 2003 15:58:41 +0000
Julio Merino a ecrit :
> On Sat, 15 Mar 2003 15:02:17 +0100
> Quentin Garnier <netbsd@quatriemek.com> wrote:
> 
> > Speaking of the locales, there seem to be an issue with them, since
> > the.po files use iso-8859-1 charset and are not well rendered by GTK+2
> > with the default font. gtk2+-pan has no problems with accents and the
> > only relevant difference I found between how are compiled pan and
> > gkrellm is the charset of the .po files. Converting a sample string to
> > UTF8 in a .po file did the trick, but I doubt adding a rule in the
> > Makefile to convert the .po files (using iconv as a build dependancy)
> > is the Right Thing To Do. There's no such conversion in the FreeBSD
> > package, but anyway I couldn't make it work to test it (it complains
> > about missing fonts, and I didn't want to waste my time trying to make
> > it work under FreeBSD).
> 
> I have trouble with accented letters in many applications that use gtk
> 1/2(gaim comes to my mind now). So there is a problem hidden
> somewhere... It shouldn't be gkrellm's fault.

I think I finally found the issue here.

Converting locales to UTF8 apparently needs an iconv-enabled gettext,
which is not the case of the one in base. So when binaries or libs get
linked against /usr/lib/libintl.so, locale conversion will not work. This
is clearly apparent with GTK+ 2 application since displayed strings must
be in Unicode.

Now glib2 depends on libintl, and gets linked against /usr/lib/libintl.so,
and this dependency is propagated through libraries and binaries, so we
end up sometimes with binaries that erroneously depend on both libintl.so
from base and from pkgsrc. Of course at run-time the wrong gettext
functions are used, conversion doesn't happen and pango/gtk outputs some
error messages.

For the glib2/gtk2/gkrellm2 chain, the following patch get the correct
libintl.so used by all libraries and binaries involved.

I don't know if it is entirely correct to do that change, but note that at
least gtk+2 shouldn't .include gettext-lib's buildlink2.mk file since
glib2 does it.

Another solution, I think, would be to make /usr/lib/libintl.so symbols
weak so they're superseded in case the pkg one is loaded too.

I hope my explanations were clear.

Index: devel/glib2/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/glib2/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- devel/glib2/Makefile	2003/02/15 10:12:33	1.20
+++ devel/glib2/Makefile	2003/04/02 18:31:24
@@ -17,6 +17,7 @@
 USE_PKGLOCALEDIR=	yes
 USE_GMAKE=		yes
 USE_PERL5=		yes
+USE_GNU_GETTEXT=	yes
 
 USE_LIBTOOL=		yes
 LIBTOOL_OVERRIDE=	${WRKSRC}/libtool
Index: devel/glib2/buildlink2.mk
===================================================================
RCS file: /cvsroot/pkgsrc/devel/glib2/buildlink2.mk,v
retrieving revision 1.8
diff -u -r1.8 buildlink2.mk
--- devel/glib2/buildlink2.mk	2002/12/24 03:36:58	1.8
+++ devel/glib2/buildlink2.mk	2003/04/02 18:31:25
@@ -17,6 +17,8 @@
 BUILDLINK_FILES.glib2+=	lib/libgobject-2.0.*
 BUILDLINK_FILES.glib2+=	lib/libgthread-2.0.*
 
+USE_GNU_GETTEXT=	yes
+
 .include "../../converters/libiconv/buildlink2.mk"
 .include "../../devel/gettext-lib/buildlink2.mk"
 .include "../../devel/pkgconfig/buildlink2.mk"
Index: x11/gtk2/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/gtk2/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- x11/gtk2/Makefile	2003/02/15 11:02:29	1.23
+++ x11/gtk2/Makefile	2003/04/02 18:31:25
@@ -49,7 +49,7 @@
 	${INSTALL_DATA_DIR} ${PREFIX}/lib/gtk-2.0/modules
 
 .include "../../devel/atk/buildlink2.mk"
-.include "../../devel/gettext-lib/buildlink2.mk"
+#.include "../../devel/gettext-lib/buildlink2.mk"
 .include "../../devel/glib2/buildlink2.mk"
 .include "../../devel/pango/buildlink2.mk"
 .include "../../devel/pkgconfig/buildlink2.mk"
Index: x11/gtk2/buildlink2.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/gtk2/buildlink2.mk,v
retrieving revision 1.6
diff -u -r1.6 buildlink2.mk
--- x11/gtk2/buildlink2.mk	2003/01/11 18:23:46	1.6
+++ x11/gtk2/buildlink2.mk	2003/04/02 18:31:25
@@ -20,7 +20,7 @@
 USE_X11=	YES
 
 .include "../../devel/atk/buildlink2.mk"
-.include "../../devel/gettext-lib/buildlink2.mk"
+#.include "../../devel/gettext-lib/buildlink2.mk"
 .include "../../devel/glib2/buildlink2.mk"
 .include "../../devel/pango/buildlink2.mk"
 .include "../../devel/pkgconfig/buildlink2.mk"


-- 
Quentin Garnier - cube@cubidou.net
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.