Subject: Re: How to enable USE_GNU_ICONV for glib2?
To: None <>
From: Julio M. Merino Vidal <>
List: tech-pkg
Date: 01/06/2006 18:55:09
On 1/6/06, Bernd Ernesti <> wrote:
> Hi,
> irssi needs an glib2 build with USE_GNU_ICONV to enable the recode
> function.
> From the not yet commited irrsi update to 0.8.10 MESSAGE file:
>  This version of irssi has support for character set conversions. Irssi i=
>  able to transliterate unavailable characters if transliteration is
>  supported by GLib. If you want to use transliteration, rebuild devel/gli=
>  with USE_GNU_ICONV=3Dyes.
> I tried to build irssi with a glib2 which used our iconv, but then it was=
> possible to enable the special new feature. Where it was possible to use =
> with glib2 and USE_GNU_ICONV, but this fails with other packages which
> knows nothing about USE_GNU_ICONV for glib2.
> This is how i Did it, adding the follwoing patch to pkgsrc/devel/glib2/op=
> and used 'PKG_OPTIONS.glib2 +=3D gnu-iconv' in /etc/mk.conf.
> ---  25 Nov 2005 21:30:17 -0000      1.1
> +++  6 Jan 2006 14:35:03 -0000
> @@ -1,10 +1,15 @@
>  # $NetBSD:,v 1.1 2005/11/25 21:30:17 wiz Exp $
> +PKG_SUPPORTED_OPTIONS=3D debug gnu-iconv
>  .include "../../mk/"
>  .if !empty(PKG_OPTIONS:Mdebug)
>  CONFIGURE_ARGS+=3D       --enable-debug=3Dyes
>  .endif
> +
> +.if !empty(PKG_OPTIONS:Mgnu-iconv)
> +.endif
> +
> Later I discovered that some packages, like arts and ORBit2 doesn't build
> shared libraries for some of the libraries anymore:

This might be because you haven't patched glib2's file to
pull in gnu iconv as well, so it is not adding the correct libraries in the
buildlink directory.

It seems dangerous to me to make this option package-specific.  Having
a mixture of packages (libraries) built with different implementations of i=
will surely cause problems if both libraries are loaded at the same time by=
concrete program.  I hit this problem -- random crashes -- with different S=
implementations.  (And this is one of the reasons I added the plural handli=
hack in gettext-lib.)

I don't know how we'd solve this... asking the user to rebuild one package
with different options to get another one working is... ugly, at the very l=
Maybe we'd have a glib2-gnu package that relies on gnu iconv and gnu
gettext, which might be parallel installable with glib2 and could be used b=
e.g., irssi?

Julio M. Merino Vidal <>
The Julipedia -
The NetBSD Project -