From bfea461be31e37bed96c20aca312d3c627aa23e6 Mon Sep 17 00:00:00 2001 From: schnoebe Date: Fri, 21 Dec 2012 00:10:59 +0000 Subject: Add two new patches: * handle building with NetBSD 6's 64bit time_t on a 32 bit platform * reorder src/utf8/checked.h to define the append() function before using it later on in the same file. Also updated the MASTER_SITES to reference the new download site. --- chat/spectrum/Makefile | 6 +- chat/spectrum/distinfo | 4 +- chat/spectrum/patches/patch-src_statshandler.cpp | 24 +++++++ chat/spectrum/patches/patch-src_utf8_checked.h | 79 ++++++++++++++++++++++++ 4 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 chat/spectrum/patches/patch-src_statshandler.cpp create mode 100644 chat/spectrum/patches/patch-src_utf8_checked.h (limited to 'chat/spectrum') diff --git a/chat/spectrum/Makefile b/chat/spectrum/Makefile index 9388099a000..2f072baaefa 100644 --- a/chat/spectrum/Makefile +++ b/chat/spectrum/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.27 2012/12/15 10:36:25 ryoon Exp $ +# $NetBSD: Makefile,v 1.28 2012/12/21 00:10:59 schnoebe Exp $ DISTNAME= spectrum-1.4.8 -PKGREVISION= 15 +PKGREVISION= 16 CATEGORIES= chat -MASTER_SITES= http://spectrum.im/attachments/download/43/ +MASTER_SITES= http://cloud.github.com/downloads/hanzz/libtransport/ MAINTAINER= schnoebe@NetBSD.org HOMEPAGE= http://spectrum.im/ diff --git a/chat/spectrum/distinfo b/chat/spectrum/distinfo index 1d3a08bf65f..38c7d280ea3 100644 --- a/chat/spectrum/distinfo +++ b/chat/spectrum/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.4 2012/06/25 08:52:17 fhajny Exp $ +$NetBSD: distinfo,v 1.5 2012/12/21 00:10:59 schnoebe Exp $ SHA1 (spectrum-1.4.8.tar.gz) = 9323f8f89eb1f84e36e1d64845741cbebbf0d249 RMD160 (spectrum-1.4.8.tar.gz) = 859c1d0f6f1c4d535bbada13c1c11f2b4550805a @@ -9,4 +9,6 @@ SHA1 (patch-spectrumctl_spectrum_env.py) = 0c266de23d0af8d317fcd4efdfec64bb85714 SHA1 (patch-spectrumctl_spectrumctl.py) = 56166fa6477a3dba56b30501f2112cd6d21db40f SHA1 (patch-src_geventloop.h) = b28685cb69b9759ea3496e163d48de641a49eccb SHA1 (patch-src_spectrum_util.cpp) = 19201297fe085f093010346c8600399332a60265 +SHA1 (patch-src_statshandler.cpp) = 0748f6561a2ec8801ba22828722587e8c29054a3 SHA1 (patch-src_transport.h) = 11c7541c8b41556cbaa7a0d99046dd4edc4293e0 +SHA1 (patch-src_utf8_checked.h) = aef4e9214e89b97c6dae2c56ea2ce934702d5ac8 diff --git a/chat/spectrum/patches/patch-src_statshandler.cpp b/chat/spectrum/patches/patch-src_statshandler.cpp new file mode 100644 index 00000000000..e34078e04df --- /dev/null +++ b/chat/spectrum/patches/patch-src_statshandler.cpp @@ -0,0 +1,24 @@ +$NetBSD: patch-src_statshandler.cpp,v 1.1 2012/12/21 00:10:59 schnoebe Exp $ + +Force the seconds of uptime to be an integer quantity. + +Shouldn't cause a problem, as I doubt any system will be ever be up for +30+ years, so representing in a signed, potentially 32 bit quantity +shouldn't be a problem. + +--- src/statshandler.cpp.orig 2011-06-11 13:17:44.000000000 +0000 ++++ src/statshandler.cpp +@@ -172,7 +172,12 @@ Tag* GlooxStatsHandler::handleTag (Tag * + t = new Tag("stat"); + t->addAttribute("name","uptime"); + t->addAttribute("units","seconds"); +- t->addAttribute("value",seconds - m_startTime); ++ // no more than integer number of seconds ++ // of uptime (NetBSD 6.0 and later have time_t ++ // as a 64 bit qauntity, but I doubt any single ++ // system will ever be up 30 years, so an int ++ // (32 bits on some platforms) should suffice) ++ t->addAttribute("value", (int)(seconds - m_startTime)); + query->addChild(t); + } else if (name == "users/registered") { + t = new Tag("stat"); diff --git a/chat/spectrum/patches/patch-src_utf8_checked.h b/chat/spectrum/patches/patch-src_utf8_checked.h new file mode 100644 index 00000000000..8d2e41b3bd8 --- /dev/null +++ b/chat/spectrum/patches/patch-src_utf8_checked.h @@ -0,0 +1,79 @@ +$NetBSD: patch-src_utf8_checked.h,v 1.1 2012/12/21 00:10:59 schnoebe Exp $ + +Reorder the template definitions so append() was defined in the class +before its first use. + +--- src/utf8/checked.h.orig 2010-10-08 07:15:22.000000000 +0000 ++++ src/utf8/checked.h +@@ -65,6 +65,35 @@ namespace utf8 + + /// The library API - functions intended to be called by the users + ++ template ++ octet_iterator append(uint32_t cp, octet_iterator result) ++ { ++ if (!internal::is_code_point_valid(cp)) ++ throw invalid_code_point(cp); ++ ++ if (cp < 0x80) // one octet ++ *(result++) = static_cast(cp); ++ else if (cp < 0x800) { // two octets ++ *(result++) = static_cast((cp >> 6) | 0xc0); ++ *(result++) = static_cast((cp & 0x3f) | 0x80); ++ } ++ else if (cp < 0x10000) { // three octets ++ *(result++) = static_cast((cp >> 12) | 0xe0); ++ *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); ++ *(result++) = static_cast((cp & 0x3f) | 0x80); ++ } ++ else if (cp <= internal::CODE_POINT_MAX) { // four octets ++ *(result++) = static_cast((cp >> 18) | 0xf0); ++ *(result++) = static_cast(((cp >> 12)& 0x3f) | 0x80); ++ *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); ++ *(result++) = static_cast((cp & 0x3f) | 0x80); ++ } ++ else ++ throw invalid_code_point(cp); ++ ++ return result; ++ } ++ + template + output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement) + { +@@ -104,35 +133,6 @@ namespace utf8 + } + + template +- octet_iterator append(uint32_t cp, octet_iterator result) +- { +- if (!internal::is_code_point_valid(cp)) +- throw invalid_code_point(cp); +- +- if (cp < 0x80) // one octet +- *(result++) = static_cast(cp); +- else if (cp < 0x800) { // two octets +- *(result++) = static_cast((cp >> 6) | 0xc0); +- *(result++) = static_cast((cp & 0x3f) | 0x80); +- } +- else if (cp < 0x10000) { // three octets +- *(result++) = static_cast((cp >> 12) | 0xe0); +- *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); +- *(result++) = static_cast((cp & 0x3f) | 0x80); +- } +- else if (cp <= internal::CODE_POINT_MAX) { // four octets +- *(result++) = static_cast((cp >> 18) | 0xf0); +- *(result++) = static_cast(((cp >> 12)& 0x3f) | 0x80); +- *(result++) = static_cast(((cp >> 6) & 0x3f) | 0x80); +- *(result++) = static_cast((cp & 0x3f) | 0x80); +- } +- else +- throw invalid_code_point(cp); +- +- return result; +- } +- +- template + uint32_t next(octet_iterator& it, octet_iterator end) + { + uint32_t cp = 0; -- cgit v1.2.3