Subject: Re: GLib conversion failure on OpenBSD when building gtk2
To: Tobias Nygren <tnn@NetBSD.org>
From: Alexander Nasonov <alnsn@yandex.ru>
List: pkgsrc-users
Date: 05/12/2007 13:36:02
Alexander Nasonov wrote:
> Tobias Nygren wrote:
> > nl_langinfo(CODESET) returning 646 is not a problem.
> > Does this work?
> > $ echo "hello" | /usr/bin/iconv -f UTF-8 -t 646
> 
> # /usr/sbin/pkg_add libiconv-1.9.2p3
> libiconv-1.9.2p3: complete
> #
> # echo "hello" | /usr/local/bin/iconv -f UTF-8 -t 646
> iconv: conversion to 646 unsupported

BTW, converters/libiconv does support 646 too:

$ echo "hello" | /usr/pkg/bin/iconv -f UTF-8 -t 646
/usr/pkg/bin/iconv: conversion to 646 unsupported
/usr/pkg/bin/iconv: try '/usr/pkg/bin/iconv -l' to get the list of supported encodings

> > If not, their iconv implementation is broken.
> > You can work around that by putting this in mk.conf:
> > _INCOMPAT_ICONV=   OpenBSD-*-*
> 
> Thanks, I'll try this.

It didn't work. For now, I put a patch to $LOCALPATCHES/devel/glib2:

--- glib/libcharset/localcharset.c.pkgsrc	Sat May 12 13:17:37 2007
+++ glib/libcharset/localcharset.c	Sat May 12 13:18:34 2007
@@ -252,7 +252,11 @@
 
 #if !(defined WIN32 || defined OS2)
 
-# if HAVE_LANGINFO_CODESET
+# if defined(__OpenBSD__)
+
+  codeset = "ISO8859-1";
+
+# elif HAVE_LANGINFO_CODESET
 
   /* Most systems support nl_langinfo (CODESET) nowadays.  */
   codeset = nl_langinfo (CODESET);

-- 
Alexander Nasonov
http://nasonov.blogspot.com