aboutsummaryrefslogtreecommitdiffstats
path: root/games/wesnoth
diff options
context:
space:
mode:
authorphilip <philip@FreeBSD.org>2010-08-26 19:17:44 +0800
committerphilip <philip@FreeBSD.org>2010-08-26 19:17:44 +0800
commit24abb1b59edc5f53986959a3507776d6e4ee91d6 (patch)
tree0ce4d46e22b5df21c0734129148f27aeedc65c8b /games/wesnoth
parent555a07819bdecef3e96fe4000318945e6ac23927 (diff)
downloadfreebsd-ports-gnome-24abb1b59edc5f53986959a3507776d6e4ee91d6.tar.gz
freebsd-ports-gnome-24abb1b59edc5f53986959a3507776d6e4ee91d6.tar.zst
freebsd-ports-gnome-24abb1b59edc5f53986959a3507776d6e4ee91d6.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/wesnoth')
-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*);