diff options
author | wiz <wiz@pkgsrc.org> | 2016-09-12 15:40:13 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2016-09-12 15:40:13 +0000 |
commit | 0b3cde65bf0b1b49f9aab689efa015924aca11dc (patch) | |
tree | 31bb7970df2cdc58394e81e788b5a16439d41ab2 /net | |
parent | 7b2e818d272b99847a2f51c9d0b85464084ae552 (diff) | |
download | pkgsrc-0b3cde65bf0b1b49f9aab689efa015924aca11dc.tar.gz |
Updated libfilezilla to 0.6.1.
2016-07-27 - libfilezilla 0.6.1 released
Bugfixes and minor changes:
Fix UTF-8 conversion functions and added a testcase
2016-07-20 - libfilezilla 0.6.0 released
New features:
Add fz::sprintf, a safe replacement for for the C sprintf function
Diffstat (limited to 'net')
-rw-r--r-- | net/libfilezilla/Makefile | 5 | ||||
-rw-r--r-- | net/libfilezilla/PLIST | 3 | ||||
-rw-r--r-- | net/libfilezilla/distinfo | 12 | ||||
-rw-r--r-- | net/libfilezilla/patches/patch-lib_string.cpp | 84 | ||||
-rw-r--r-- | net/libfilezilla/patches/patch-tests_string.cpp | 54 |
5 files changed, 9 insertions, 149 deletions
diff --git a/net/libfilezilla/Makefile b/net/libfilezilla/Makefile index e0815e27eb8..39c9d61adb3 100644 --- a/net/libfilezilla/Makefile +++ b/net/libfilezilla/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.5 2016/08/07 22:11:46 wiz Exp $ +# $NetBSD: Makefile,v 1.6 2016/09/12 15:40:13 wiz Exp $ -DISTNAME= libfilezilla-0.5.3 -PKGREVISION= 1 +DISTNAME= libfilezilla-0.6.1 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=filezilla/} EXTRACT_SUFX= .tar.bz2 diff --git a/net/libfilezilla/PLIST b/net/libfilezilla/PLIST index 166ed91765a..e3ff8c67a8b 100644 --- a/net/libfilezilla/PLIST +++ b/net/libfilezilla/PLIST @@ -1,9 +1,10 @@ -@comment $NetBSD: PLIST,v 1.1 2016/04/29 11:54:06 wiz Exp $ +@comment $NetBSD: PLIST,v 1.2 2016/09/12 15:40:13 wiz Exp $ include/libfilezilla/apply.hpp include/libfilezilla/event.hpp include/libfilezilla/event_handler.hpp include/libfilezilla/event_loop.hpp include/libfilezilla/file.hpp +include/libfilezilla/format.hpp include/libfilezilla/glue/wx.hpp include/libfilezilla/iputils.hpp include/libfilezilla/libfilezilla.hpp diff --git a/net/libfilezilla/distinfo b/net/libfilezilla/distinfo index d96073b72be..c951d341f47 100644 --- a/net/libfilezilla/distinfo +++ b/net/libfilezilla/distinfo @@ -1,8 +1,6 @@ -$NetBSD: distinfo,v 1.4 2016/07/21 17:16:17 wiz Exp $ +$NetBSD: distinfo,v 1.5 2016/09/12 15:40:13 wiz Exp $ -SHA1 (libfilezilla-0.5.3.tar.bz2) = 035c79d677ee7ab00aaf7b3b65e47139e955f072 -RMD160 (libfilezilla-0.5.3.tar.bz2) = bcc0905c81030c0b8ec563bd3017b404f82271cd -SHA512 (libfilezilla-0.5.3.tar.bz2) = 73c1e5a8940e08dc96f511dc5dce7bdc17d2feada131b4459e8a65c074e48a04b7eb884e55a59ac1e04c72ae47cd596c8f668cd7086f302f86bdbb14a32e83cd -Size (libfilezilla-0.5.3.tar.bz2) = 376339 bytes -SHA1 (patch-lib_string.cpp) = 00632aede9d27348efa664bfa84f6dbe90f92dd2 -SHA1 (patch-tests_string.cpp) = 7c55ccccfebdf81e50bbe8f8f44351b41505f554 +SHA1 (libfilezilla-0.6.1.tar.bz2) = 0ea791c80bb6ad575222a84aa019392bf7e55351 +RMD160 (libfilezilla-0.6.1.tar.bz2) = c3acac0d27fe3142d3bf0e63b51de603fdd1c950 +SHA512 (libfilezilla-0.6.1.tar.bz2) = 586fa7be30d70b8f2998f4f510367ba5ce75d0afdf22f69a06881cee22059ab5f626396079d779ad51e49bbc6c539408867f852c870045820bf1b57873a77bc5 +Size (libfilezilla-0.6.1.tar.bz2) = 379625 bytes diff --git a/net/libfilezilla/patches/patch-lib_string.cpp b/net/libfilezilla/patches/patch-lib_string.cpp deleted file mode 100644 index 65b1c6fcd4f..00000000000 --- a/net/libfilezilla/patches/patch-lib_string.cpp +++ /dev/null @@ -1,84 +0,0 @@ -$NetBSD: patch-lib_string.cpp,v 1.4 2016/07/21 17:16:17 wiz Exp $ - -SVN 7668 - ---- lib/string.cpp.orig 2016-06-20 08:08:07.000000000 +0000 -+++ lib/string.cpp -@@ -95,6 +95,59 @@ std::wstring to_wstring(std::string cons - // Depending which one is used, declare iconv_second_arg_type as either char* or char const* - extern "C" typedef size_t (*iconv_prototype_with_const)(iconv_t, char const**, size_t *, char**, size_t *); - typedef std::conditional<std::is_same<decltype(&iconv), iconv_prototype_with_const>::value, char const*, char*>::type iconv_second_arg_type; -+ -+namespace { -+// On some platforms, e.g. those derived from SunOS, iconv does not understand "WCHAR_T", so we -+// need to guess an encoding. -+char const* const calc_wchar_t_encoding() -+{ -+ auto try_encoding = [](char const* const encoding) -> bool { -+ iconv_t cd = iconv_open(encoding, "UTF-8"); -+ if (cd == reinterpret_cast<iconv_t>(-1)) { -+ return false; -+ } -+ iconv_close(cd); -+ return true; -+ -+ }; -+ if (try_encoding("WCHAR_T")) { -+ return "WCHAR_T"; -+ } -+ else { -+ // Explicitly specify endianess, otherwise we'll get a BOM prefixed to everything -+ -+ int const i = 1; -+ char const* p = reinterpret_cast<char const*>(&i); -+ bool little_endian = p[0] == 1; -+ -+ if (sizeof(wchar_t) == 4) { -+ if (little_endian && try_encoding("UTF-32LE")) { -+ return "UTF-32LE"; -+ } -+ if (!little_endian && try_encoding("UTF-32BE")) { -+ return "UTF-32BE"; -+ } -+ } -+ else if (sizeof(wchar_t) == 2) { -+ if (little_endian && try_encoding("UTF-16LE")) { -+ return "UTF-16LE"; -+ } -+ if (!little_endian && try_encoding("UTF-16BE")) { -+ return "UTF-16BE"; -+ } -+ } -+ } -+ -+ // Oh dear... -+ return "WCHAR_T"; -+} -+ -+char const* wchar_t_encoding() -+{ -+ static char const* const encoding = calc_wchar_t_encoding(); -+ return encoding; -+} -+} - #endif - - std::wstring to_wstring_from_utf8(std::string const& in) -@@ -111,7 +164,7 @@ std::wstring to_wstring_from_utf8(std::s - MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, in_p, len, out_p, len); - } - #else -- iconv_t cd = iconv_open("WCHAR_T", "UTF-8"); -+ iconv_t cd = iconv_open(wchar_t_encoding(), "UTF-8"); - if (cd != reinterpret_cast<iconv_t>(-1)) { - auto in_p = const_cast<iconv_second_arg_type>(in.c_str()); - size_t in_len = in.size(); -@@ -175,7 +228,7 @@ std::string FZ_PUBLIC_SYMBOL to_utf8(std - WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, in_p, len, out_p, len, 0, 0); - } - #else -- iconv_t cd = iconv_open("UTF-8", "WCHAR_T"); -+ iconv_t cd = iconv_open("UTF-8", wchar_t_encoding()); - if (cd != reinterpret_cast<iconv_t>(-1)) { - auto in_p = reinterpret_cast<iconv_second_arg_type>(const_cast<wchar_t*>(in.c_str())); - size_t in_len = in.size() * sizeof(wchar_t); diff --git a/net/libfilezilla/patches/patch-tests_string.cpp b/net/libfilezilla/patches/patch-tests_string.cpp deleted file mode 100644 index 2d6e337d211..00000000000 --- a/net/libfilezilla/patches/patch-tests_string.cpp +++ /dev/null @@ -1,54 +0,0 @@ -$NetBSD: patch-tests_string.cpp,v 1.1 2016/07/21 17:16:17 wiz Exp $ - -SVN 7667 - ---- tests/string.cpp.orig 2016-01-31 10:35:01.000000000 +0000 -+++ tests/string.cpp -@@ -11,6 +11,7 @@ class string_test : public CppUnit::Test - CPPUNIT_TEST_SUITE(string_test); - CPPUNIT_TEST(test_conversion); - CPPUNIT_TEST(test_conversion2); -+ CPPUNIT_TEST(test_conversion_utf8); - CPPUNIT_TEST_SUITE_END(); - - public: -@@ -19,6 +20,7 @@ public: - - void test_conversion(); - void test_conversion2(); -+ void test_conversion_utf8(); - }; - - CPPUNIT_TEST_SUITE_REGISTRATION(string_test); -@@ -43,7 +45,7 @@ void string_test::test_conversion() - - void string_test::test_conversion2() - { -- wchar_t p[] = { 'M', 'o', 't', 0xf6, 'r', 'h', 'e', 'a', 'd', 0 }; -+ wchar_t const p[] = { 'M', 'o', 't', 0xf6, 'r', 'h', 'e', 'a', 'd', 0 }; - std::wstring const w(p); - - std::string const s = fz::to_string(w); -@@ -54,3 +56,22 @@ void string_test::test_conversion2() - - ASSERT_EQUAL(w, w2); - } -+ -+void string_test::test_conversion_utf8() -+{ -+ wchar_t const p[] = { 'M', 'o', 't', 0xf6, 'r', 'h', 'e', 'a', 'd', 0 }; -+ unsigned char const p_utf8[] = { 'M', 'o', 't', 0xc3, 0xb6, 'r', 'h', 'e', 'a', 'd', 0 }; -+ -+ std::wstring const w(p); -+ std::string const u(reinterpret_cast<char const*>(p_utf8)); -+ -+ std::string const s = fz::to_utf8(w); -+ -+ CPPUNIT_ASSERT(s.size() >= w.size()); -+ -+ ASSERT_EQUAL(s, u); -+ -+ std::wstring const w2 = fz::to_wstring_from_utf8(s); -+ -+ ASSERT_EQUAL(w, w2); -+} |