From swell.k@gmail.com  Fri Jul 23 21:27:23 2010
Return-Path: <swell.k@gmail.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A82A1065676
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Jul 2010 21:27:23 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 280328FC13
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Jul 2010 21:27:22 +0000 (UTC)
Received: by fxm13 with SMTP id 13so5753656fxm.13
        for <FreeBSD-gnats-submit@freebsd.org>; Fri, 23 Jul 2010 14:27:22 -0700 (PDT)
Received: by 10.223.109.2 with SMTP id h2mr3738917fap.95.1279920441234;
        Fri, 23 Jul 2010 14:27:21 -0700 (PDT)
Received: from localhost (load-me-in-a-browser-if-this-tor-node-is-causing-you-grief.riseup.net [77.109.139.87])
        by mx.google.com with ESMTPS id e20sm236054fak.23.2010.07.23.14.27.19
        (version=SSLv3 cipher=RC4-MD5);
        Fri, 23 Jul 2010 14:27:20 -0700 (PDT)
Message-Id: <86fwz9j3lk.fsf@gmail.com>
Date: Sat, 24 Jul 2010 01:22:15 +0400
From: Anonymous <swell.k@gmail.com>
To: FreeBSD-gnats-submit@freebsd.org
Subject: [patch] games/wesnoth: remove NLS option, plug gettext no-op for WITHOUT_NLS

>Number:         148880
>Category:       ports
>Synopsis:       [patch] games/wesnoth: remove NLS option, plug gettext no-op for WITHOUT_NLS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    philip
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 23 21:30:06 UTC 2010
>Closed-Date:    Thu Aug 26 11:18:00 UTC 2010
>Last-Modified:  Thu Aug 26 11:20:08 UTC 2010
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
>Description:
Most ports don't use NLS knob in OPTIONS. This one doesn't even compile
with default options + WITHOUT_NLS. So, make NLS even stronger default.
In rare case user hates gettext provide a no-op fix for compilation.
>How-To-Repeat:
>Fix:
--- a.diff begins here ---
Index: games/wesnoth/Makefile
===================================================================
RCS file: /a/.cvsup/ports/games/wesnoth/Makefile,v
retrieving revision 1.81
diff -u -p -r1.81 Makefile
--- games/wesnoth/Makefile	20 Jul 2010 10:57:06 -0000	1.81
+++ games/wesnoth/Makefile	23 Jul 2010 12:56:26 -0000
@@ -54,7 +54,6 @@ OPTIONS=	BWMON	 "Enable bandwidth monito
 		EDITOR	 "Enable map editor"		On \
 		FRIBIDI	 "Enable bidirectional support"	On \
 		LOWMEM	 "Reduce memory usage (disables animations)" Off \
-		NLS	 "Enable localization"		On \
 		NOTIFY	 "Enable desktop notifications"	On \
 		POOLALLOC "Use wesnoth own memory allocator" Off \
 		PYTHON	 "Enable python developer tools" On \
@@ -194,10 +193,6 @@ PLIST_SUB+=		TOOLS=""
 CONFIGURE_ARGS+=	--docdir=${WRKDIR}/docs
 .endif
 
-.if (defined(WITH_CAMPAIGN) || defined(WITH_SERVER) || defined(WITH_TOOLS)) && defined(WITHOUT_NLS)
-BROKEN=		you need NLS support for `campaignd' or `wesnothd' or tools to link against gettext
-.endif
-
 .if defined(NOPORTDATA)
 IGNORE=		game data is required, undefine NOPORTDATA
 .endif
Index: games/wesnoth/files/patch-src-gettext.cpp
===================================================================
RCS file: games/wesnoth/files/patch-src-gettext.cpp
diff -N games/wesnoth/files/patch-src-gettext.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/wesnoth/files/patch-src-gettext.cpp	23 Jul 2010 12:44:38 -0000
@@ -0,0 +1,15 @@
+--- src/gettext.cpp~
++++ src/gettext.cpp
+@@ -18,6 +18,12 @@
+ 
+ #include <cstring>
+ 
++#ifndef ENABLE_NLS
++char *textdomain (const char *domainname) {
++  return "dummy";
++}
++#endif
++
+ char const *egettext(char const *msgid)
+ {
+ 	return msgid[0] == '\0' ? msgid : gettext(msgid);
Index: games/wesnoth/files/patch-src-gettext.hpp
===================================================================
RCS file: games/wesnoth/files/patch-src-gettext.hpp
diff -N games/wesnoth/files/patch-src-gettext.hpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ games/wesnoth/files/patch-src-gettext.hpp	23 Jul 2010 13:47:02 -0000
@@ -0,0 +1,25 @@
+--- src/gettext.hpp~
++++ src/gettext.hpp
+@@ -35,7 +35,21 @@
+ 
+ // gettext-related declarations
+ 
+-#include <libintl.h>
++#include "wesconfig.h"
++
++#ifdef ENABLE_NLS
++# include <libintl.h>
++#else
++# define bind_textdomain_codeset(Domain,Codeset) "C"
++# define bindtextdomain(Domain,Dir) "/nonexistent"
++# define gettext(String) gettext_noop(String)
++# define ngettext(String1,String2,Int) gettext_noop(Int == 1 ? String1 : String2)
++# define dgettext(Domain,String) gettext_noop(String)
++# define dngettext(Domain,String1,String2,Int) gettext_noop(Int == 1 ? String1 : String2)
++# define dcgettext(Domain,String,Int) gettext_noop(String)
++# define dcngettext(Domain,String1,String2,Int1,Int2) gettext_noop(Int1 == 1 ? String1 : String2)
++char *textdomain (const char *domainname);
++#endif
+ 
+ const char* egettext(const char*);
+ const char* sgettext(const char*);
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->philip 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Jul 23 21:30:19 UTC 2010 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148880 

From: Paul Shepel <tacid@tacid.kiev.ua>
To: bug-followup@FreeBSD.org, swell.k@gmail.com
Cc:  
Subject: Re: ports/148880: [patch] games/wesnoth: remove NLS option, plug
 gettext no-op for WITHOUT_NLS
Date: Tue, 10 Aug 2010 16:38:04 +0300

 Approve. New version compiles and works for me with this patch
 
 I've done all the tests from 
 http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-testing.html
 
 Thanks swell.k

From: Paul Shepel <tacid@tacid.kiev.ua>
To: Anonymous <swell.k@gmail.com>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/148880: [patch] games/wesnoth: remove NLS option, plug
 gettext no-op for WITHOUT_NLS
Date: Tue, 10 Aug 2010 20:03:34 +0300

 10.08.2010 18:02, Anonymous пишет:
 > Paul Shepel<tacid@tacid.kiev.ua>  writes:
 >
 >    
 >> Approve. New version compiles and works for me with this patch
 >>
 >> I've done all the tests from
 >> http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/porting-testing.html
 >>      
 > Compilation aside, did you test NLS during runtime? Try
 >
 > - WITH_NLS, try to use russian localization (assuming you know the language)
 > - WITHOUT_NLS, try to find any side effects in english strings (menu, dialogs, etc.)
 >    
 Sorry I've missed PR. This message was for ports/149485
 
 I've checked WITH_NLS (Russian localization works well) and WITHOUT_NLS 
 - all is fine
 
State-Changed-From-To: open->closed 
State-Changed-By: philip 
State-Changed-When: Thu Aug 26 11:17:59 UTC 2010 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=148880 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/148880: commit references a PR
Date: Thu, 26 Aug 2010 11:18:02 +0000 (UTC)

 philip      2010-08-26 11:17:44 UTC
 
   FreeBSD ports repository
 
   Modified files:
     games/wesnoth        Makefile 
   Added files:
     games/wesnoth/files  patch-src-gettext.cpp 
                          patch-src-gettext.hpp 
   Log:
   Remove NLS option, plug gettext no-op for WITHOUT_NLS.
   
   PR:             ports/148880
   Submitted by:   Anonymous <swell.k@gmail.com>
   
   Revision  Changes    Path
   1.83      +0 -5      ports/games/wesnoth/Makefile
   1.1       +15 -0     ports/games/wesnoth/files/patch-src-gettext.cpp (new)
   1.1       +25 -0     ports/games/wesnoth/files/patch-src-gettext.hpp (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
