aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfjoe <fjoe@FreeBSD.org>2003-11-04 12:11:35 +0800
committerfjoe <fjoe@FreeBSD.org>2003-11-04 12:11:35 +0800
commit7445cf1ef7a813885da31e0aa04fdfcad0750064 (patch)
tree7c520e04833122d6c1125ee15eaa827b3aaa0888
parent1f337db689c693e92370b7a5bb96d947bc32b72e (diff)
downloadfreebsd-ports-gnome-7445cf1ef7a813885da31e0aa04fdfcad0750064.tar.gz
freebsd-ports-gnome-7445cf1ef7a813885da31e0aa04fdfcad0750064.tar.zst
freebsd-ports-gnome-7445cf1ef7a813885da31e0aa04fdfcad0750064.zip
Add WITH_UNICODE knob (should be enabled by default when WITH_GTK2 is enabled?).
Patch is obtained from wxWindows CVS.
-rw-r--r--x11-toolkits/wxgtk-devel/Makefile12
-rw-r--r--x11-toolkits/wxgtk-devel/files/patch-src-common-datetime.cpp56
2 files changed, 67 insertions, 1 deletions
diff --git a/x11-toolkits/wxgtk-devel/Makefile b/x11-toolkits/wxgtk-devel/Makefile
index 5e4d0ab5a7ca..390fb030780c 100644
--- a/x11-toolkits/wxgtk-devel/Makefile
+++ b/x11-toolkits/wxgtk-devel/Makefile
@@ -7,7 +7,7 @@
PORTNAME= wxgtk
PORTVERSION= 2.4.2
-PORTREVISION?= 2
+PORTREVISION?= 3
CATEGORIES= x11-toolkits
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \
ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/
@@ -49,6 +49,16 @@ USE_GNOME= gtk12
.include <bsd.port.pre.mk>
+.if defined(WITH_UNICODE)
+WITH_GTK2= yes
+
+.if ${OSVERSION} < 500000
+BROKEN= Unicode mode is not supported on your system
+.else
+CONFIGURE_ARGS+=--enable-unicode
+.endif
+.endif # WITH_UNICODE
+
.if defined(WITH_GTK2)
CONFIGURE_ARGS+=--enable-gtk2 ${MACHINE_ARCH}-portbld-freebsd${OSREL}
.else
diff --git a/x11-toolkits/wxgtk-devel/files/patch-src-common-datetime.cpp b/x11-toolkits/wxgtk-devel/files/patch-src-common-datetime.cpp
new file mode 100644
index 000000000000..f4931273f720
--- /dev/null
+++ b/x11-toolkits/wxgtk-devel/files/patch-src-common-datetime.cpp
@@ -0,0 +1,56 @@
+--- src/common/datetime.cpp.orig Tue Nov 4 09:50:09 2003
++++ src/common/datetime.cpp Tue Nov 4 09:52:02 2003
+@@ -349,6 +349,35 @@
+ return wxString(buf);
+ }
+
++#ifdef HAVE_STRPTIME
++
++// Unicode-friendly strptime() wrapper
++static const wxChar *
++CallStrptime(const wxChar *input, const char *fmt, tm *tm)
++{
++ // the problem here is that strptime() returns pointer into the string we
++ // passed to it while we're really interested in the pointer into the
++ // original, Unicode, string so we try to transform the pointer back
++#if wxUSE_UNICODE
++ wxCharBuffer inputMB(wxConvertWX2MB(input));
++#else // ASCII
++ const char * const inputMB = input;
++#endif // Unicode/Ascii
++
++ const char *result = strptime(inputMB, fmt, tm);
++ if ( !result )
++ return NULL;
++
++#if wxUSE_UNICODE
++ // FIXME: this is wrong in presence of surrogates &c
++ return input + (result - inputMB.data());
++#else // ASCII
++ return result;
++#endif // Unicode/Ascii
++}
++
++#endif // HAVE_STRPTIME
++
+ // if year and/or month have invalid values, replace them with the current ones
+ static void ReplaceDefaultYearMonthWithCurrent(int *year,
+ wxDateTime::Month *month)
+@@ -2920,7 +2949,7 @@
+ // to our generic code anyhow (FIXME !Unicode friendly)
+ {
+ struct tm tm;
+- const wxChar *result = strptime(input, "%x", &tm);
++ const wxChar *result = CallStrptime(input, "%x", &tm);
+ if ( result )
+ {
+ input = result;
+@@ -2985,7 +3014,7 @@
+ {
+ // use strptime() to do it for us (FIXME !Unicode friendly)
+ struct tm tm;
+- input = strptime(input, "%X", &tm);
++ input = CallStrptime(input, "%X", &tm);
+ if ( !input )
+ {
+ return (wxChar *)NULL;