Subject: Re: How to enable USE_GNU_ICONV for glib2?
To: None <tech-pkg@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-pkg
Date: 01/06/2006 18:55:09
On 1/6/06, Bernd Ernesti <netbsd@lists.veego.de> 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=
s
>  able to transliterate unavailable characters if transliteration is
>  supported by GLib. If you want to use transliteration, rebuild devel/gli=
b2
>  with USE_GNU_ICONV=3Dyes.
>
> I tried to build irssi with a glib2 which used our iconv, but then it was=
n't
> possible to enable the special new feature. Where it was possible to use =
it
> 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=
tions.mk
> and used 'PKG_OPTIONS.glib2 +=3D gnu-iconv' in /etc/mk.conf.
>
> --- options.mk  25 Nov 2005 21:30:17 -0000      1.1
> +++ options.mk  6 Jan 2006 14:35:03 -0000
> @@ -1,10 +1,15 @@
>  # $NetBSD: options.mk,v 1.1 2005/11/25 21:30:17 wiz Exp $
>
>  PKG_OPTIONS_VAR=3D       PKG_OPTIONS.glib2
> -PKG_SUPPORTED_OPTIONS=3D debug
> +PKG_SUPPORTED_OPTIONS=3D debug gnu-iconv
>
>  .include "../../mk/bsd.options.mk"
>
>  .if !empty(PKG_OPTIONS:Mdebug)
>  CONFIGURE_ARGS+=3D       --enable-debug=3Dyes
>  .endif
> +
> +.if !empty(PKG_OPTIONS:Mgnu-iconv)
> +USE_GNU_ICONV=3D YES
> +.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 buildlink3.mk 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=
conv
will surely cause problems if both libraries are loaded at the same time by=
 a
concrete program.  I hit this problem -- random crashes -- with different S=
SL
implementations.  (And this is one of the reasons I added the plural handli=
ng
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=
east.
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=
y,
e.g., irssi?

--
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/
The NetBSD Project - http://www.NetBSD.org/