[package] update rtorrent to 0.8.4-svn1087 (#4851)
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 3 Apr 2009 09:16:29 +0000 (09:16 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 3 Apr 2009 09:16:29 +0000 (09:16 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@15090 3c298f89-4303-0410-b956-a3cf2f4a3e73

net/rtorrent/Makefile
net/rtorrent/patches/001-configure.patch [deleted file]
net/rtorrent/patches/800-fix-xmlrpc-utf8.diff [new file with mode: 0644]

index 8432d03..fe44345 100644 (file)
@@ -9,12 +9,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rtorrent
-PKG_VERSION:=0.8.2
-PKG_RELEASE:=1
 
+PKG_REV:=1087
+PKG_VERSION:=0.8.4_r$(PKG_REV)
+PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://libtorrent.rakshasa.no/downloads/
-PKG_MD5SUM:=a2456182e1767e5aed7341dbbd058f60
+PKG_SOURCE_URL:=svn://rakshasa.no/libtorrent/trunk/rtorrent
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+PKG_SOURCE_PROTO:=svn
 
 PKG_FIXUP = libtool
 
@@ -26,7 +29,7 @@ define Package/rtorrent
   CATEGORY:=Network
   TITLE:=BitTorrent client for ncurses
   URL:=http://libtorrent.rakshasa.no/
-  DEPENDS:=+libcurl +libtorrent +libncurses +libsigcxx @BROKEN
+  DEPENDS:=+libcurl +libtorrent +libncurses +libsigcxx +xmlrpc-c
 endef
 
 define Package/rtorrent/description
@@ -36,13 +39,19 @@ define Package/rtorrent/description
  based clients in an ncurses client.
 endef
 
+TARGET_CPPFLAGS +=  \
+       -fno-strict-aliasing -fno-inline \
+
 CONFIGURE_ARGS+= \
        --enable-shared \
        --disable-static \
        --disable-debug \
+       --with-xmlrpc-c \
 
-CONFIGURE_VARS += \
-       LIBS="-lm -luClibc++" \
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); ./autogen.sh );
+       $(call Build/Configure/Default)
+endef
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
diff --git a/net/rtorrent/patches/001-configure.patch b/net/rtorrent/patches/001-configure.patch
deleted file mode 100644 (file)
index ca4f9aa..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: rtorrent-0.7.9/configure
-===================================================================
---- rtorrent-0.7.9.orig/configure      2008-04-20 12:43:14.000000000 +0200
-+++ rtorrent-0.7.9/configure   2008-04-20 12:43:14.000000000 +0200
-@@ -20227,11 +20227,11 @@
- echo $ECHO_N "checking for execinfo.h... $ECHO_C" >&6; }
-   if test "$cross_compiling" = yes; then
--  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-+  { { echo "$as_me:$LINENO: warning: cannot run test program while cross compiling
- See \`config.log' for more details." >&5
--echo "$as_me: error: cannot run test program while cross compiling
-+echo "$as_me: warning: cannot run test program while cross compiling
- See \`config.log' for more details." >&2;}
--   { (exit 1); exit 1; }; }
-+   }
- else
-   cat >conftest.$ac_ext <<_ACEOF
- #include <execinfo.h>
diff --git a/net/rtorrent/patches/800-fix-xmlrpc-utf8.diff b/net/rtorrent/patches/800-fix-xmlrpc-utf8.diff
new file mode 100644 (file)
index 0000000..0dedaa0
--- /dev/null
@@ -0,0 +1,42 @@
+# Fix crashes/errors due to rtorrent attempting to pass non-utf-8 strings to xmlrpc.
+# by jdrexler
+Index: rtorrent/src/rpc/xmlrpc.cc
+===================================================================
+--- rtorrent/src/rpc/xmlrpc.cc (revision 1078)
++++ rtorrent/src/rpc/xmlrpc.cc (working copy)
+@@ -371,8 +371,34 @@
+ #endif
+   case torrent::Object::TYPE_STRING:
+-    return xmlrpc_string_new(env, object.as_string().c_str());
++  {
++#ifdef XMLRPC_HAVE_I8
++    // The versions that support I8 do implicit utf-8 validation.
++    xmlrpc_value* result = xmlrpc_string_new(env, object.as_string().c_str());
++#else
++    // In older versions, xmlrpc-c doesn't validate the utf-8 encoding itself.
++    xmlrpc_validate_utf8(env, object.as_string().c_str(), object.as_string().length());
++    xmlrpc_value* result = env->fault_occurred ? NULL : xmlrpc_string_new(env, object.as_string().c_str());
++#endif
++
++    if (env->fault_occurred) {
++      xmlrpc_env_clean(env);
++      xmlrpc_env_init(env);
++
++      const std::string& str = object.as_string();
++      char buffer[str.size() + 1];
++      char* dst = buffer;
++      for (std::string::const_iterator itr = str.begin(); itr != str.end(); ++itr)
++        *dst++ = ((*itr < 0x20 && *itr != '\r' && *itr != '\n' && *itr != '\t') || (*itr & 0x80)) ? '?' : *itr;
++      *dst = 0;
++
++      result = xmlrpc_string_new(env, buffer);
++    }
++
++    return result;
++  }
++
+   case torrent::Object::TYPE_LIST:
+   {
+     xmlrpc_value* result = xmlrpc_array_new(env);