Sfoglia il codice sorgente

rtorrent: import from packages and update to 0.9.4

libtorrent: import from packages and update to 0.13.4

Signed-off-by: Peter Wagner <tripolar@gmx.at>
Peter Wagner 10 anni fa
parent
commit
4c89b9da1a

+ 71
- 0
libs/libtorrent/Makefile Vedi File

@@ -0,0 +1,71 @@
1
+#
2
+# Copyright (C) 2007-2013 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=libtorrent
11
+PKG_VERSION:=0.13.4-git
12
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
13
+
14
+PKG_SOURCE_PROTO:=git
15
+PKG_SOURCE_URL:=https://github.com/rakshasa/libtorrent.git
16
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17
+PKG_SOURCE_VERSION:=51cd5ea8913a5f5062813d9f5b6256c76d41ea11
18
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19
+
20
+PKG_FIXUP:=autoreconf
21
+PKG_BUILD_PARALLEL:=1
22
+PKG_INSTALL:=1
23
+
24
+include $(INCLUDE_DIR)/package.mk
25
+
26
+define Package/libtorrent
27
+  SECTION:=libs
28
+  CATEGORY:=Libraries
29
+  TITLE:=Rakshasa's BitTorrent library
30
+  URL:=http://libtorrent.rakshasa.no/
31
+  DEPENDS:=+libopenssl +libsigcxx
32
+endef
33
+
34
+define Package/libtorrent/description
35
+ LibTorrent is a BitTorrent library written in C++ for *nix, with a focus on
36
+ high performance and good code. The library differentiates itself from other
37
+ implementations by transfering directly from file pages to the network stack.
38
+ On high-bandwidth connections it is able to seed at 3 times the speed of the
39
+ official client.
40
+endef
41
+
42
+TARGET_LDFLAGS += $(LIBGCC_S)
43
+
44
+CONFIGURE_ARGS+= \
45
+	--enable-shared \
46
+	--enable-static \
47
+	--enable-aligned \
48
+	--disable-debug \
49
+	--enable-openssl \
50
+	--disable-instrumentation
51
+
52
+define Build/Configure
53
+	( cd $(PKG_BUILD_DIR); ./autogen.sh );
54
+	$(call Build/Configure/Default)
55
+endef
56
+
57
+define Build/InstallDev
58
+	$(INSTALL_DIR) $(1)/usr/include
59
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/torrent $(1)/usr/include/
60
+	$(INSTALL_DIR) $(1)/usr/lib
61
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.{a,so*} $(1)/usr/lib/
62
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
63
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent.pc $(1)/usr/lib/pkgconfig/
64
+endef
65
+
66
+define Package/libtorrent/install
67
+	$(INSTALL_DIR) $(1)/usr/lib
68
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent.so.* $(1)/usr/lib/
69
+endef
70
+
71
+$(eval $(call BuildPackage,libtorrent))

+ 41
- 0
libs/libtorrent/patches/100-fix_cross_compile.patch Vedi File

@@ -0,0 +1,41 @@
1
+--- a/configure.ac
2
++++ b/configure.ac
3
+@@ -19,7 +19,6 @@ AC_SUBST(LIBTORRENT_INTERFACE_VERSION_NO
4
+ 
5
+ AM_INIT_AUTOMAKE
6
+ AC_CONFIG_HEADERS(config.h)
7
+-AM_PATH_CPPUNIT(1.9.6)
8
+ 
9
+ AC_PROG_CXX
10
+ 
11
+--- a/scripts/checks.m4
12
++++ b/scripts/checks.m4
13
+@@ -96,7 +96,7 @@ AC_DEFUN([TORRENT_CHECK_KQUEUE], [
14
+ AC_DEFUN([TORRENT_CHECK_KQUEUE_SOCKET_ONLY], [
15
+   AC_MSG_CHECKING(whether kqueue supports pipes and ptys)
16
+ 
17
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
18
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
19
+       #include <fcntl.h>
20
+       #include <stdlib.h>
21
+       #include <unistd.h>
22
+--- a/scripts/common.m4
23
++++ b/scripts/common.m4
24
+@@ -223,7 +223,7 @@ dnl   Need to fix this so that it uses t
25
+ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
26
+   AC_MSG_CHECKING(for execinfo.h)
27
+ 
28
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
29
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
30
+       #include <execinfo.h>
31
+       int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
32
+       ])],
33
+@@ -238,7 +238,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
34
+ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
35
+   AC_MSG_CHECKING(the byte alignment)
36
+ 
37
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
38
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
39
+       #include <inttypes.h>
40
+       int main() {
41
+         char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };

+ 26
- 0
libs/libtorrent/patches/120-fix-ipv6_socket_datagram.patch Vedi File

@@ -0,0 +1,26 @@
1
+--- a/src/net/socket_datagram.cc
2
++++ b/src/net/socket_datagram.cc
3
+@@ -73,6 +73,23 @@ SocketDatagram::write_datagram(const voi
4
+   int r;
5
+ 
6
+   if (sa != NULL) {
7
++#ifdef RAK_USE_INET6
8
++    if (m_ipv6_socket && sa->family() == rak::socket_address::pf_inet) {
9
++      uint32_t addr32[4];
10
++      sockaddr_in6 mapped_addr;
11
++      memset(&mapped_addr, 0, sizeof(mapped_addr));
12
++      mapped_addr.sin6_family = AF_INET6;
13
++      addr32[0] = 0;
14
++      addr32[1] = 0;
15
++      addr32[2] = htonl(0xffff);
16
++      addr32[3] = sa->sa_inet()->address_n();
17
++      memcpy(mapped_addr.sin6_addr.s6_addr, addr32, sizeof(uint32_t) * 4);
18
++      mapped_addr.sin6_port = sa->sa_inet()->port_n();
19
++      r = ::sendto(m_fileDesc, buffer, length, 0, (sockaddr*)&mapped_addr, sizeof(mapped_addr));
20
++    } else if (m_ipv6_socket && sa->family() == rak::socket_address::pf_inet6) {
21
++      r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet6()->c_sockaddr(), sizeof(rak::socket_address_inet6));
22
++    } else
23
++#endif
24
+     r = ::sendto(m_fileDesc, buffer, length, 0, sa->sa_inet()->c_sockaddr(), sizeof(rak::socket_address_inet));
25
+   } else {
26
+     r = ::send(m_fileDesc, buffer, length, 0);

+ 92
- 0
net/rtorrent/Makefile Vedi File

@@ -0,0 +1,92 @@
1
+#
2
+# Copyright (C) 2007-2013 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=rtorrent
11
+PKG_VERSION:=0.9.4-git
12
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)-1
13
+
14
+PKG_SOURCE_PROTO:=git
15
+PKG_SOURCE_URL:=https://github.com/rakshasa/rtorrent.git
16
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17
+PKG_SOURCE_VERSION:=6a3234eaa79f15857260df31f98711ef24266191
18
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
19
+
20
+PKG_FIXUP:=autoreconf
21
+PKG_BUILD_PARALLEL:=1
22
+PKG_INSTALL:=1
23
+
24
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
25
+
26
+include $(INCLUDE_DIR)/package.mk
27
+
28
+define Package/rtorrent/Default
29
+  SUBMENU:=BitTorrent
30
+  SECTION:=net
31
+  CATEGORY:=Network
32
+  TITLE:=BitTorrent client for ncurses
33
+  URL:=http://libtorrent.rakshasa.no/
34
+  DEPENDS:=+libcurl +libtorrent +libncursesw +libsigcxx +libpthread
35
+endef
36
+
37
+define Package/rtorrent/Default/description
38
+ rTorrent is a BitTorrent client for ncurses, using the libtorrent library.
39
+ The client and library is written in C++ with emphasis on speed and
40
+ efficiency, while delivering equivalent features to those found in GUI based
41
+ clients in an ncurses client.
42
+endef
43
+
44
+define Package/rtorrent
45
+$(call Package/rtorrent/Default)
46
+  VARIANT:=norpc
47
+endef
48
+
49
+define Package/rtorrent/description
50
+$(call Package/rtorrent/Default/description)
51
+ This package is built without xmlrpc support
52
+endef
53
+
54
+define Package/rtorrent-rpc
55
+$(call Package/rtorrent/Default)
56
+  VARIANT:=rpc
57
+  DEPENDS+=+xmlrpc-c-server
58
+  TITLE+=(with rpc support)
59
+endef
60
+
61
+define Package/rtorrent-rpc/description
62
+$(call Package/rtorrent/Default/description)
63
+ This package is built with xmlrpc support
64
+endef
65
+
66
+TARGET_LDFLAGS += -lpthread -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
67
+
68
+CONFIGURE_ARGS+= \
69
+	--enable-shared \
70
+	--disable-static \
71
+	--disable-debug
72
+
73
+ifeq ($(BUILD_VARIANT),rpc)
74
+	CONFIGURE_ARGS += \
75
+		--with-xmlrpc-c
76
+endif
77
+
78
+
79
+define Build/Configure
80
+	( cd $(PKG_BUILD_DIR); ./autogen.sh );
81
+	$(call Build/Configure/Default)
82
+endef
83
+
84
+define Package/rtorrent/install
85
+	$(INSTALL_DIR) $(1)/usr/bin
86
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rtorrent $(1)/usr/bin/
87
+endef
88
+
89
+Package/rtorrent-rpc/install = $(Package/rtorrent/install)
90
+
91
+$(eval $(call BuildPackage,rtorrent))
92
+$(eval $(call BuildPackage,rtorrent-rpc))

+ 30
- 0
net/rtorrent/patches/100-fix-cross_compile.patch Vedi File

@@ -0,0 +1,30 @@
1
+--- a/configure.ac
2
++++ b/configure.ac
3
+@@ -4,7 +4,6 @@ AC_DEFINE(API_VERSION, 8, api version)
4
+ 
5
+ AM_INIT_AUTOMAKE
6
+ AC_CONFIG_HEADERS(config.h)
7
+-AM_PATH_CPPUNIT(1.9.6)
8
+ 
9
+ AC_PROG_CXX
10
+ AC_PROG_LIBTOOL
11
+--- a/scripts/common.m4
12
++++ b/scripts/common.m4
13
+@@ -223,7 +223,7 @@ dnl   Need to fix this so that it uses t
14
+ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
15
+   AC_MSG_CHECKING(for execinfo.h)
16
+ 
17
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
18
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
19
+       #include <execinfo.h>
20
+       int main() { backtrace((void**)0, 0); backtrace_symbols((char**)0, 0); return 0;}
21
+       ])],
22
+@@ -238,7 +238,7 @@ AC_DEFUN([TORRENT_CHECK_EXECINFO], [
23
+ AC_DEFUN([TORRENT_CHECK_ALIGNED], [
24
+   AC_MSG_CHECKING(the byte alignment)
25
+ 
26
+-  AC_RUN_IFELSE([AC_LANG_SOURCE([
27
++  AC_LINK_IFELSE([AC_LANG_SOURCE([
28
+       #include <inttypes.h>
29
+       int main() {
30
+         char buf@<:@8@:>@ = { 0, 0, 0, 0, 1, 0, 0, 0 };

+ 11
- 0
net/rtorrent/patches/120-fix-ncurses.patch Vedi File

@@ -0,0 +1,11 @@
1
+--- a/src/display/canvas.h
2
++++ b/src/display/canvas.h
3
+@@ -48,7 +48,7 @@ class Canvas {
4
+ public:
5
+   typedef std::vector<Attributes> attributes_list;
6
+ 
7
+-  Canvas(int x = 0, int y = 0, int width = 0, int height = 0);
8
++  Canvas(int x = 0, int y = 0, int width = 1, int height = 1);
9
+   ~Canvas() { delwin(m_window); }
10
+ 
11
+   void                refresh()                                               { wnoutrefresh(m_window); }