CC kn@ because of a mentioned upcoming update for libtorrent-rasterbar
and deluge with the import of devel/py-rencode.
https://marc.info/?l=openbsd-ports&m=156979797828503&w=2
This is an update for net/libtorrent-rasterbar 1.2.3, released Dec
19, 2019. It is needed for an update to deluge, sent in a separate
e-mail. This update:
- uses cmake
- turns on unit tests
Changelog: https://github.com/arvidn/libtorrent/releases/tag/libtorrent-1_2_3
Full unit test log: https://gist.github.com/namtsui/3f935dc120431d3063a85e0b833d4ce6
98% tests passed, 2 tests failed out of 98
Total Test time (real) = 1038.26 sec
The following tests FAILED:
41 - test_lsd (Failed)
84 - test_upnp (Failed)
test_lsd and test_upnp are not important unit tests because they deal
with fringe features. I focused my efforts on tests dealing with web
seeding, which I viewed as a more important feature.
test_lsd (local service discovery)
==================================
This doesn't work because it returns an error code on
s->set_option(enable_loopback(loopback), ec);
in broadcast_socket::open_multicast_socket. Multicast is disabled by default on OpenBSD.
Sources:
ip(4) under "Multicast Options"
https://www.boost.org/doc/libs/1_66_0/doc/html/boost_asio/reference/ip__multicast__enable_loopback.html
https://www.boost.org/doc/libs/1_71_0/doc/html/boost_asio/reference/ip__multicast__join_group.html
http://bittorrent.org/beps/bep_0014.html
00:00:00.000: ses1: [lsd_error] Local Service Discovery error: Invalid argument
00:00:00.000: ses1: [add_torrent] added torrent: temporary
00:00:00.000: ses2: [lsd_error] Local Service Discovery error: Invalid argument
00:00:00.000: ses2: [add_torrent] added torrent: temporary
test_upnp
=========
There is a comment saying that upnp_test is only available for UPnP routers.
test_web_seed_http_pw, test_web_seed_http and test_url_seed
===========================================================
I opened an issue upstream
(https://github.com/arvidn/libtorrent/issues/4211) with these patches.
- patch-test_http_py: fixes test_url_seed but I am unsure about this
- patch-test_web_server_py: fixes test_web_seed_http*
misc
====
patch-include_libtorrent_buffer_hpp:
comments from file:
// the actual allocation may be larger than we requested. If so, let the
// user take advantage of every single byte
OpenBSD does not have malloc_usable_size or malloc_size, so it seems
more portable / safer to just not use this optimization.
Python 2 is used because python 3 is currently problematic, as
reported by FreeBSD. https://github.com/arvidn/libtorrent/issues/4204
Testing
=======
Feedback and tests are welcome because this is a major update. I tested
it by downloading and seeding a linux ISO. I did not get to test a thin
client / server setup for example.
Index: Makefile
===================================================================
RCS file: /cvs/ports/net/libtorrent-rasterbar/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile 12 Jul 2019 20:48:31 -0000 1.8
+++ Makefile 30 Dec 2019 02:32:22 -0000
@@ -2,10 +2,10 @@
COMMENT = C++ library implementing a BitTorrent client
-MODPY_EGG_VERSION = 1.1.13
+MODPY_EGG_VERSION = 1.2.3
DISTNAME = libtorrent-rasterbar-${MODPY_EGG_VERSION}
-SHARED_LIBS += torrent-rasterbar 1.0 # 9.0.0
+SHARED_LIBS += torrent-rasterbar 2.0 # 9.0.0
CATEGORIES = net devel
@@ -14,13 +14,16 @@ HOMEPAGE = https://libtorrent.org/
# BSD3
PERMIT_PACKAGE = Yes
-WANTLIB += boost_chrono-mt boost_python boost_random-mt boost_system-mt
-WANTLIB += crypto m ssl
+WANTLIB += boost_python-mt boost_system-mt
+WANTLIB += crypto iconv m ssl
WANTLIB += ${COMPILER_LIBCXX} ${MODPY_WANTLIB}
MASTER_SITES = https://github.com/arvidn/libtorrent/releases/download/libtorrent-${MODPY_EGG_VERSION:S/./_/g}/
-MODULES = lang/python
+MODULES = devel/cmake \
+ lang/python
+
+MODPY_SETUPTOOLS = Yes
BUILD_DEPENDS = devel/libtool
@@ -30,22 +33,13 @@ LIB_DEPENDS = converters/libiconv \
# boost
COMPILER = base-clang ports-gcc
-CONFIGURE_STYLE = gnu
-CONFIGURE_ARGS = --enable-python-binding \
- --with-boost-system=boost_system-mt \
- --with-libiconv
-CONFIGURE_ENV += CPPFLAGS="-Wno-deprecated-declarations \
- -Wno-macro-redefined \
- -pthread" \
- PYTHON_CXXFLAGS="${PYTHON_CXXFLAGS} -std=gnu++14"
-MAKE_ENV = CC="${CC}" CXX="${CXX}"
-CXXFLAGS += -std=gnu++14
-
-.ifdef DEBUG
-CONFIGURE_ARGS += --enable-debug
-.endif
+CONFIGURE_ARGS = -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_CXX_STANDARD=14 \
+ -Dpython-bindings=ON \
+ -Dbuild_tests=ON \
+ -G Ninja
-pre-configure:
- sed -i 's,-Os,,g' ${WRKSRC}/configure
+post-patch:
+ ${SUBST_CMD} ${WRKDIST}/test/setup_transfer.cpp
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/libtorrent-rasterbar/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo 30 Apr 2019 16:45:26 -0000 1.5
+++ distinfo 30 Dec 2019 02:32:22 -0000
@@ -1,2 +1,2 @@
-SHA256 (libtorrent-rasterbar-1.1.13.tar.gz) = MAQHGYWOPAZjR2TgwXeHOOtC7NC0XoFK+nRjKalI6tc=
-SIZE (libtorrent-rasterbar-1.1.13.tar.gz) = 3896007
+SHA256 (libtorrent-rasterbar-1.2.3.tar.gz) = FYL9u9BEm8/k/64sy55b8Fd0WaMrslYE4BrMuEfaGi0=
+SIZE (libtorrent-rasterbar-1.2.3.tar.gz) = 4145859
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-CMakeLists_txt 30 Dec 2019 02:32:22 -0000
@@ -0,0 +1,35 @@
+$OpenBSD$
+
+link to -liconv for libtorrent-rasterbar.so
+
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -600,25 +600,8 @@ target_optional_compile_definitions(torrent-rasterbar
+ target_optional_compile_definitions(torrent-rasterbar PUBLIC FEATURE NAME mutable-torrents DEFAULT ON
+ DESCRIPTION "Enables mutable torrent support" DISABLED TORRENT_DISABLE_MUTABLE_TORRENTS)
+
+-find_public_dependency(Iconv)
+-if(MSVC)
+- set(iconv_package_type OPTIONAL)
+-else()
+- set(iconv_package_type RECOMMENDED)
+-endif()
+-
+-set_package_properties(Iconv
+- PROPERTIES
+- URL "https://www.gnu.org/software/libiconv/"
+- DESCRIPTION "GNU encoding conversion library"
+- TYPE ${iconv_package_type}
+- PURPOSE "Convert strings between various encodings"
+-)
+-
+-if(Iconv_FOUND)
+- target_compile_definitions(torrent-rasterbar PUBLIC TORRENT_USE_ICONV)
+- target_link_libraries(torrent-rasterbar PRIVATE Iconv::Iconv)
+-endif()
++find_library(ICONV_LIB iconv)
++target_link_libraries(torrent-rasterbar PRIVATE "${ICONV_LIB}")
+
+ find_public_dependency(OpenSSL)
+ set_package_properties(OpenSSL
Index: patches/patch-include_libtorrent_buffer_hpp
===================================================================
RCS file: patches/patch-include_libtorrent_buffer_hpp
diff -N patches/patch-include_libtorrent_buffer_hpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_libtorrent_buffer_hpp 30 Dec 2019 02:32:22 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: include/libtorrent/buffer.hpp
+--- include/libtorrent/buffer.hpp.orig
++++ include/libtorrent/buffer.hpp
+@@ -50,7 +50,7 @@ POSSIBILITY OF SUCH DAMAGE.
+ #elif defined __FreeBSD__
+ #include <malloc_np.h>
+ #elif defined TORRENT_BSD
+-#include <malloc/malloc.h>
++#include <sys/malloc.h>
+
No comments:
Post a Comment