From 6d51247eace061e3d2014229f2a5fe102001a088 Mon Sep 17 00:00:00 2001 From: Joakim Bergman Date: Mon, 15 Aug 2022 10:46:57 +0200 Subject: [PATCH 1/2] net-p2p/libtorrent-rasterbar: fix python bindings --- net-p2p/libtorrent-rasterbar/Makefile | 3 +++ net-p2p/libtorrent-rasterbar/pkg-plist | 1 + net-p2p/py-libtorrent-rasterbar/Makefile | 14 ++++++++------ net-p2p/py-libtorrent-rasterbar/distinfo | 6 +++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/net-p2p/libtorrent-rasterbar/Makefile b/net-p2p/libtorrent-rasterbar/Makefile index bd415e47300d..1692742f4ad2 100644 --- a/net-p2p/libtorrent-rasterbar/Makefile +++ b/net-p2p/libtorrent-rasterbar/Makefile @@ -30,40 +30,43 @@ DOCFILES= AUTHORS ChangeLog PORTDOCS= ${DOCFILES} docs/* PORTEXAMPLES= *.cpp OPTIONS_DEFINE= DOCS EXAMPLES LOGGING OPTIONS_DEFAULT= LOGGING OPTIONS_SUB= yes LOGGING_DESC= Enable logging to disk EXAMPLES_CMAKE_BOOL= build_examples LOGGING_CMAKE_BOOL= logging PORTSCOUT= limit:^1.* # 2.x is WIP and we don't accept it before qBittorrent does CONFLICTS_INSTALL= libtorrent-rasterbar2 post-patch: @${REINPLACE_CMD} -e 's|return "python3";|return "${PYTHON_CMD}";|' \ ${WRKSRC}/test/setup_transfer.cpp post-install: + # py-bindings seems to link this exact name after v1.2.14 + # TODO: figure out how to make symlinks in Jamfile + /bin/ln -s libtorrent-rasterbar.so.${DISTVERSION} ${STAGEDIR}${PREFIX}/lib/libtorrent-rasterbar.so.10.0.0 @${RM} ${STAGEDIR}${PREFIX}/include/libtorrent/Makefile* post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${DOCFILES:S|^|${WRKSRC}/|} ${STAGEDIR}${DOCSDIR} cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${STAGEDIR}${DOCSDIR} ${RM} ${STAGEDIR}${DOCSDIR}/docs/._* post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${WRKSRC}/examples/${PORTEXAMPLES} \ ${STAGEDIR}${EXAMPLESDIR} do-test: @cd ${BUILD_WRKSRC} && \ ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -Dbuild_tests:BOOL=ON ${CMAKE_SOURCE_PATH} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} test .include diff --git a/net-p2p/libtorrent-rasterbar/pkg-plist b/net-p2p/libtorrent-rasterbar/pkg-plist index 4f8d8ff4b883..84471c859fe8 100644 --- a/net-p2p/libtorrent-rasterbar/pkg-plist +++ b/net-p2p/libtorrent-rasterbar/pkg-plist @@ -235,22 +235,23 @@ include/libtorrent/udp_socket.hpp include/libtorrent/udp_tracker_connection.hpp include/libtorrent/union_endpoint.hpp include/libtorrent/units.hpp include/libtorrent/upnp.hpp include/libtorrent/utf8.hpp include/libtorrent/utp_socket_manager.hpp include/libtorrent/utp_stream.hpp include/libtorrent/vector_utils.hpp include/libtorrent/version.hpp include/libtorrent/web_connection_base.hpp include/libtorrent/web_peer_connection.hpp include/libtorrent/write_resume_data.hpp include/libtorrent/xml_parse.hpp lib/cmake/LibtorrentRasterbar/LibtorrentRasterbarConfig.cmake lib/cmake/LibtorrentRasterbar/LibtorrentRasterbarConfigVersion.cmake lib/cmake/LibtorrentRasterbar/LibtorrentRasterbarTargets-%%CMAKE_BUILD_TYPE%%.cmake lib/cmake/LibtorrentRasterbar/LibtorrentRasterbarTargets.cmake lib/libtorrent-rasterbar.so lib/libtorrent-rasterbar.so.%%SO_VER%% lib/libtorrent-rasterbar.so.%%SHLIB_VER%% +lib/libtorrent-rasterbar.so.10.0.0 libdata/pkgconfig/libtorrent-rasterbar.pc share/cmake/Modules/FindLibtorrentRasterbar.cmake diff --git a/net-p2p/py-libtorrent-rasterbar/Makefile b/net-p2p/py-libtorrent-rasterbar/Makefile index 548a83e953d7..9ac5f8a6d6a2 100644 --- a/net-p2p/py-libtorrent-rasterbar/Makefile +++ b/net-p2p/py-libtorrent-rasterbar/Makefile @@ -1,44 +1,46 @@ PORTNAME= libtorrent-rasterbar DISTVERSIONPREFIX= v -DISTVERSION= 1.2.16 -PORTREVISION= 1 +DISTVERSION= 1.2.18 +PORTREVISION= 0 PORTEPOCH= 2 CATEGORIES= net-p2p python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= yuri@FreeBSD.org COMMENT= Python bindings for libtorrent-rasterbar WWW= https://libtorrent.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/../../COPYING -BROKEN= can't create dynamic relocation R_X86_64_32 against local symbol in readonly segment, see https://github.com/arvidn/libtorrent/issues/6890 - BUILD_DEPENDS= b2:devel/boost_build LIB_DEPENDS= libtorrent-rasterbar.so:net-p2p/libtorrent-rasterbar \ ${PY_BOOST} USES= compiler:c11 iconv localbase:ldflags python:3.6+ USE_GITHUB= yes GH_ACCOUNT= arvidn GH_PROJECT= libtorrent -USE_PYTHON= distutils autoplist +USE_PYTHON= distutils +PYDISTUTILS_PKGNAME= libtorrent +PYDISTUTILS_BUILD_TARGET= build_ext --b2-args="fpic=on libtorrent-link=shared boost-link=shared" +PYDISTUTILS_INSTALL_TARGET= build_ext --b2-args="fpic=on libtorrent-link=shared boost-link=shared" install BINARY_ALIAS= b2=${FILESDIR}/b2 CFLAGS+= -DTORRENT_DISABLE_LOGGING # undefined symbol: https://github.com/arvidn/libtorrent/issues/3331 LDFLAGS+= ${LOCALBASE}/lib/libboost_python${PYTHON_SUFFIX}.so ${LOCALBASE}/lib/libiconv.so # fails to link libs: https://github.com/arvidn/libtorrent/issues/3330 WRKSRC_SUBDIR= bindings/python # ensure python paths are correctly identified CONFIGURE_ENV= PYTHON_INCLUDEDIR="${PYTHON_INCLUDEDIR}" \ PYTHON_VERSION="${PYTHON_VERSION}" PORTSCOUT= limit:^1.* # 2.x is WIP and we don't accept it before qBittorrent does +PLIST_FILES+= ${PYTHON_SITELIBDIR}/${PYDISTUTILS_PKGNAME}/__init__${PYTHON_EXT_SUFFIX}.so post-install: - @${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/libtorrent*.so + @${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PYDISTUTILS_PKGNAME}/__init__${PYTHON_EXT_SUFFIX}.so .include diff --git a/net-p2p/py-libtorrent-rasterbar/distinfo b/net-p2p/py-libtorrent-rasterbar/distinfo index 8f090fecfde8..3ff41462afa4 100644 --- a/net-p2p/py-libtorrent-rasterbar/distinfo +++ b/net-p2p/py-libtorrent-rasterbar/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1654714860 -SHA256 (arvidn-libtorrent-v1.2.16_GH0.tar.gz) = 2ee435c3e2e6dd8825903230b41fbaf0741b7aed57094f2ca0e6214d89fef9d4 -SIZE (arvidn-libtorrent-v1.2.16_GH0.tar.gz) = 3624920 +TIMESTAMP = 1667577329 +SHA256 (arvidn-libtorrent-v1.2.18_GH0.tar.gz) = c4213bfb695db3e3b266be71865a7942f9007200aa4021946818fdc5e5e4a3d3 +SIZE (arvidn-libtorrent-v1.2.18_GH0.tar.gz) = 3633926 -- 2.38.1