aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2010-08-26 19:17:44 +0800
committerPhilip Paeps <philip@FreeBSD.org>2010-08-26 19:17:44 +0800
commit809735997156a1acedc7a456bf5c6391e2fd9965 (patch)
tree1386e620f95cca880e131ccb15f75a4dbaf176a9 /games
parentce65cc69b71d8d6606dd6e87fa4339f14fef83c1 (diff)
downloadfreebsd-ports-gnome-809735997156a1acedc7a456bf5c6391e2fd9965.tar.gz
freebsd-ports-gnome-809735997156a1acedc7a456bf5c6391e2fd9965.tar.zst
freebsd-ports-gnome-809735997156a1acedc7a456bf5c6391e2fd9965.zip
Remove NLS option, plug gettext no-op for WITHOUT_NLS.
PR: ports/148880 Submitted by: Anonymous <swell.k@gmail.com>
Diffstat (limited to 'games')
-rw-r--r--games/wesnoth/Makefile5
-rw-r--r--games/wesnoth/files/patch-src-gettext.cpp15
-rw-r--r--games/wesnoth/files/patch-src-gettext.hpp25
3 files changed, 40 insertions, 5 deletions
diff --git a/games/wesnoth/Makefile b/games/wesnoth/Makefile
index 16943dd39fab..d64caf7b4631 100644
--- a/games/wesnoth/Makefile
+++ b/games/wesnoth/Makefile
@@ -55,7 +55,6 @@ OPTIONS= BWMON "Enable bandwidth monitoring for server" Off \
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 \
@@ -195,10 +194,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
diff --git a/games/wesnoth/files/patch-src-gettext.cpp b/games/wesnoth/files/patch-src-gettext.cpp
new file mode 100644
index 000000000000..5efa34c5afe9
--- /dev/null
+++ b/games/wesnoth/files/patch-src-gettext.cpp
@@ -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);
diff --git a/games/wesnoth/files/patch-src-gettext.hpp b/games/wesnoth/files/patch-src-gettext.hpp
new file mode 100644
index 000000000000..fd910d11a583
--- /dev/null
+++ b/games/wesnoth/files/patch-src-gettext.hpp
@@ -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*);