From be4fb4ebe8e7f94f87a7f6b6f225675d0e5b65a4 Mon Sep 17 00:00:00 2001 From: kwm Date: Sat, 19 Jun 2010 08:39:24 +0000 Subject: Use propper patch, from upstream. git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@14257 df743ca5-7f9a-e211-a948-0013205c9059 --- devel/glibmm/Makefile | 4 +-- devel/glibmm/files/patch-glib_glibmm_ustring.cc | 47 +++++++++++++++---------- 2 files changed, 31 insertions(+), 20 deletions(-) (limited to 'devel/glibmm') diff --git a/devel/glibmm/Makefile b/devel/glibmm/Makefile index 776dac846..bdf813467 100644 --- a/devel/glibmm/Makefile +++ b/devel/glibmm/Makefile @@ -3,12 +3,12 @@ # Whom: Adam Weinberger # # $FreeBSD$ -# $MCom$ +# $MCom: ports/devel/glibmm/Makefile,v 1.92 2010/06/18 20:09:31 kwm Exp $ # PORTNAME= glibmm PORTVERSION= 2.25.2 -PORTREVISION?= 0 +PORTREVISION?= 1 PORTEPOCH= 1 CATEGORIES= devel MASTER_SITES= GNOME diff --git a/devel/glibmm/files/patch-glib_glibmm_ustring.cc b/devel/glibmm/files/patch-glib_glibmm_ustring.cc index dbcfc7dde..7d63f5029 100644 --- a/devel/glibmm/files/patch-glib_glibmm_ustring.cc +++ b/devel/glibmm/files/patch-glib_glibmm_ustring.cc @@ -1,20 +1,31 @@ ---- glib/glibmm/ustring.cc.orig 2010-06-18 21:49:11.000000000 +0200 -+++ glib/glibmm/ustring.cc 2010-06-18 22:03:33.000000000 +0200 -@@ -1361,7 +1361,7 @@ - Glib::Error::throw_exception(error); - } +--- glib/glibmm/ustring.cc.orig 2010-06-01 15:36:11.000000000 +0200 ++++ glib/glibmm/ustring.cc 2010-06-19 09:44:25.000000000 +0200 +@@ -1354,7 +1354,12 @@ std::wistream& operator>>(std::wistream& + glong n_bytes = 0; + const ScopedPtr buf (g_utf16_to_utf8(reinterpret_cast(wstr.data()), + wstr.size(), 0, &n_bytes, &error)); +-#endif //GLIBMM_EXCEPTIONS_ENABLED ++#else ++ gsize n_bytes = 0; ++ const ScopedPtr buf (g_convert(reinterpret_cast(wstr.data()), ++ wstr.size() * sizeof(std::wstring::value_type), ++ "UTF-8", "WCHAR_T", 0, &n_bytes, &error)); ++#endif // !(__STDC_ISO_10646__ || G_OS_WIN32) -- utf8_string.assign(buf.get(), buf.get() + n_bytes); -+// utf8_string.assign(buf.get(), buf.get() + n_bytes); + if (error) + { +@@ -1378,7 +1383,13 @@ std::wostream& operator<<(std::wostream& + // Avoid going through iconv if wchar_t always contains UTF-16. + const ScopedPtr buf (g_utf8_to_utf16(utf8_string.raw().data(), + utf8_string.raw().size(), 0, 0, &error)); +-#endif //GLIBMM_EXCEPTIONS_ENABLED ++#else ++ // TODO: For some reason the conversion from UTF-8 to WCHAR_T doesn't work ++ // with g_convert(), while iconv on the command line handles it just fine. ++ // Maybe a bug in GLib? ++ const ScopedPtr buf (g_convert(utf8_string.raw().data(), utf8_string.raw().size(), ++ "WCHAR_T", "UTF-8", 0, 0, &error)); ++#endif // !(__STDC_ISO_10646__ || G_OS_WIN32) - return is; - } -@@ -1392,7 +1392,7 @@ - // NUL. Given this, there doesn't seem much of a point in allowing NUL in - // formatted output. The semantics would be unclear anyway: what's the - // screen width of a NUL? -- os << reinterpret_cast(buf.get()); -+// os << reinterpret_cast(buf.get()); - - return os; - } + if (error) + { -- cgit v1.2.3