commit:     b9429c4dc799f2dc53453f5ee194113ec6f3365d
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Mon Jan 29 17:19:20 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 30 09:58:41 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b9429c4d

net-libs/libtorrent-rasterbar: exclude broken tests + add examples

Closes: https://bugs.gentoo.org/888825
Closes: https://bugs.gentoo.org/889832
Closes: https://bugs.gentoo.org/915512
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/35081
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libtorrent-rasterbar-2.0.9-r1.ebuild           | 112 +++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-2.0.9-r1.ebuild 
b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-2.0.9-r1.ebuild
new file mode 100644
index 000000000000..a2451165ead0
--- /dev/null
+++ b/net-libs/libtorrent-rasterbar/libtorrent-rasterbar-2.0.9-r1.ebuild
@@ -0,0 +1,112 @@
+# Copyright 2021-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# no 3.12 for now
+# 
https://github.com/arvidn/libtorrent/commit/785969574cfe925098f50b7e5d9ae2a9f2a9d0cf
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit cmake python-single-r1
+
+DESCRIPTION="C++ BitTorrent implementation focusing on efficiency and 
scalability"
+HOMEPAGE="https://libtorrent.org/ https://github.com/arvidn/libtorrent";
+SRC_URI="https://github.com/arvidn/libtorrent/releases/download/v${PV}/${P}.tar.gz";
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="+dht debug examples gnutls python ssl test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+       dev-libs/boost:=
+       ssl? (
+               gnutls? ( net-libs/gnutls:= )
+               !gnutls? ( dev-libs/openssl:= )
+       )
+"
+RDEPEND="
+       ${DEPEND}
+       python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-libs/boost[python,${PYTHON_USEDEP}]
+               ')
+       )
+"
+BDEPEND="
+       dev-util/patchelf
+       python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/setuptools[${PYTHON_USEDEP}]
+               ')
+       )
+       test? (
+               ${PYTHON_DEPS}
+       )
+"
+
+pkg_setup() {
+       # python required for tests due to webserver.py
+       if use python || use test; then
+               python-single-r1_pkg_setup
+       fi
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DCMAKE_CXX_STANDARD=17
+               -DBUILD_SHARED_LIBS=ON
+               -Dbuild_examples=$(usex examples)
+               -Ddht=$(usex dht)
+               -Dencryption=$(usex ssl)
+               -Dgnutls=$(usex gnutls)
+               -Dlogging=$(usex debug)
+               -Dpython-bindings=$(usex python)
+               -Dbuild_tests=$(usex test)
+       )
+
+       # We need to drop the . from the Python version to satisfy Boost's
+       # FindBoost.cmake module, bug #793038.
+       use python && mycmakeargs+=( -Dboost-python-module-name="${EPYTHON/./}" 
)
+
+       cmake_src_configure
+}
+
+src_test() {
+       CMAKE_SKIP_TESTS=(
+               # Needs running UPnP server
+               "test_upnp"
+               # Missing files in 2.0.9 release archive
+               # https://github.com/arvidn/libtorrent/issues/7567
+               "test_create_torrent"
+               # Certificates outdated
+               # https://github.com/arvidn/libtorrent/issues/7565
+               "test_ssl"
+               # Fragile to parallelization
+               # https://bugs.gentoo.org/854603#c1
+               "test_utp"
+               # Fails in tmpfs
+               # https://github.com/arvidn/libtorrent/issues/7566
+               "test_copy_file"
+       )
+
+       LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" cmake_src_test
+}
+
+src_install() {
+       cmake_src_install
+       einstalldocs
+
+       if use examples; then
+               pushd "${BUILD_DIR}"/examples >/dev/null || die
+               for binary in 
{client_test,connection_tester,custom_storage,dump_bdecode,dump_torrent,make_torrent,simple_client,stats_counters,upnp_test};
 do
+                       patchelf --remove-rpath ${binary} || die
+                       dobin ${binary}
+               done
+               popd >/dev/null || die
+       fi
+}

Reply via email to