From owner-cvs-ports@FreeBSD.ORG Tue Mar 2 05:20:11 2004 Return-Path: Delivered-To: cvs-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E88B716A4CE; Tue, 2 Mar 2004 05:20:10 -0800 (PST) Received: from srv01.sparkit.no (srv01.sparkit.no [193.69.116.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4663743D2F; Tue, 2 Mar 2004 05:20:10 -0800 (PST) (envelope-from eivind@FreeBSD.org) Received: from ws ([193.69.114.88]) by srv01.sparkit.no (8.12.10/8.12.10) with ESMTP id i22DK6SD024221; Tue, 2 Mar 2004 14:20:06 +0100 (CET) (envelope-from eivind@FreeBSD.org) Received: from ws (localhost [127.0.0.1]) by ws (8.12.9/8.12.10) with ESMTP id i22DIomd058690; Tue, 2 Mar 2004 13:18:51 GMT (envelope-from eivind@ws) Received: (from eivind@localhost) by ws (8.12.9/8.12.10/Submit) id i22DIoVq058582; Tue, 2 Mar 2004 13:18:50 GMT (envelope-from eivind) Date: Tue, 2 Mar 2004 13:17:49 +0000 From: Eivind Eklund To: Kris Kennaway Message-ID: <20040302131749.GG27008@FreeBSD.org> References: <200402040638.i146cVAi035977@repoman.freebsd.org> <20040229233524.GA48293@dragon.nuxi.com> <1078098236.62463.50.camel@shumai.marcuscom.com> <20040301104026.GC27008@FreeBSD.org> <20040301115006.GA64348@xor.obsecurity.org> <20040301154440.GC71640@dragon.nuxi.com> <20040301162624.GE27008@FreeBSD.org> <20040302035808.GA1535@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040302035808.GA1535@xor.obsecurity.org> User-Agent: Mutt/1.5.4i cc: cvs-ports@FreeBSD.org cc: Joe Marcus Clarke cc: cvs-all@FreeBSD.org cc: David O'Brien cc: ports-committers@FreeBSD.org Subject: Re: Gettext issues (was Re: cvs commit: ports CHANGES) X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Mar 2004 13:20:11 -0000 On Mon, Mar 01, 2004 at 07:58:08PM -0800, Kris Kennaway wrote: > On Mon, Mar 01, 2004 at 04:26:24PM +0000, Eivind Eklund wrote: > > > The knob is there for a number of ports (but much fewer than I had > > thought - I actually thought it was fairly universal): > > > > devel/bison/Makefile > > devel/gmake/Makefile > > ftp/wget/Makefile > > mail/mutt-devel/Makefile > > mail/mutt/Makefile > > net/darkstat/Makefile > > > > This has actually seemed to be enough to stop most of the problems I > > have with gettext (which shows you what kind of programs I run ;) > > > > I think we should try to have it become universal - getting rid of > > gettext is very useful for most of us. > > I successfully removed gettext from a number of my installed ports, > but it looks like glib20 and everything that depends on it absolutely > requires gettext (there's a note in the ChangeLog suggesting that it > was a design decision). That means pretty much everything GNOME and > KDE requires it, but it's still a step forward to proceed with other > ports. Looking at the code, I think you're wrong - it just autodetect. Or at least the code autodetect and contain ifdef's on ENABLE_NLS to enable/disable code sections based on whether NLS is available or not. For the more general case: I think we can use a dummy gettext library to get around things needing gettext. The gettext calls generally index on the english string, making a dummy implementation very easy. Below is an implementation (not tested) which should compliant with the basic interface, and hopefully work. A better variant might be actually have all of this defined as inline functions in a header. The docs I've found are at http://www.scit.wlv.ac.uk/cgi-bin/mansec?3C+gettext and http://www.gnu.org/software/gettext/manual/html_node/gettext_145.html#SEC145 Eivind. >>> gettext.h: char *textdomain (const char *domain_name); char *gettext(const char *msgid); char *dgettext(const char *domain_name, const char *msgid); char *dcgettext(const char *domain_name, const char *msgid, int category); char *bindtextdomain (const char *domain_name, const char *dir_name); >>> gettext.c: char * textdomain(const char *domain_name) { return domain_name ? NULL : "messages"; } char * gettext(const char *msgid) { return msgid; } char * dgettext(const char *domain_name, const char *msgid) { return msgid; } char * dcgettext(const char *domain_name, const char *msgid, int category) { return msgid; } char * bindtextdomain(const char *domain_name, const char *dir_name) { if (domain_name == NULL || strcmp(domain_name, "") == 0) { return NULL; } else { return "messages"; } }