summaryrefslogtreecommitdiff
path: root/chat/spectrum
diff options
context:
space:
mode:
authorschnoebe <schnoebe>2012-12-21 00:10:59 +0000
committerschnoebe <schnoebe>2012-12-21 00:10:59 +0000
commitbfea461be31e37bed96c20aca312d3c627aa23e6 (patch)
tree448e4c6e39a8f282e2f04a35315b7429988904b8 /chat/spectrum
parent580257647350208e006c2d3604c5aa4d3efae421 (diff)
downloadpkgsrc-bfea461be31e37bed96c20aca312d3c627aa23e6.tar.gz
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.
Diffstat (limited to 'chat/spectrum')
-rw-r--r--chat/spectrum/Makefile6
-rw-r--r--chat/spectrum/distinfo4
-rw-r--r--chat/spectrum/patches/patch-src_statshandler.cpp24
-rw-r--r--chat/spectrum/patches/patch-src_utf8_checked.h79
4 files changed, 109 insertions, 4 deletions
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 <typename octet_iterator>
++ 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<uint8_t>(cp);
++ else if (cp < 0x800) { // two octets
++ *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else if (cp < 0x10000) { // three octets
++ *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else if (cp <= internal::CODE_POINT_MAX) { // four octets
++ *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
++ *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
++ *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
++ }
++ else
++ throw invalid_code_point(cp);
++
++ return result;
++ }
++
+ template <typename octet_iterator, typename output_iterator>
+ output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
+ {
+@@ -104,35 +133,6 @@ namespace utf8
+ }
+
+ template <typename octet_iterator>
+- 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<uint8_t>(cp);
+- else if (cp < 0x800) { // two octets
+- *(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else if (cp < 0x10000) { // three octets
+- *(result++) = static_cast<uint8_t>((cp >> 12) | 0xe0);
+- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else if (cp <= internal::CODE_POINT_MAX) { // four octets
+- *(result++) = static_cast<uint8_t>((cp >> 18) | 0xf0);
+- *(result++) = static_cast<uint8_t>(((cp >> 12)& 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>(((cp >> 6) & 0x3f) | 0x80);
+- *(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
+- }
+- else
+- throw invalid_code_point(cp);
+-
+- return result;
+- }
+-
+- template <typename octet_iterator>
+ uint32_t next(octet_iterator& it, octet_iterator end)
+ {
+ uint32_t cp = 0;