Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jul 2010 01:22:15 +0400
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/148880: [patch] games/wesnoth: remove NLS option, plug gettext no-op for WITHOUT_NLS
Message-ID:  <86fwz9j3lk.fsf@gmail.com>
Resent-Message-ID: <201007232130.o6NLU6uP057195@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 23 21:30:06 UTC 2010
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86fwz9j3lk.fsf>