# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           active_variants 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1
PortGroup           openssl 1.0

github.setup        rakshasa rtorrent 713067ba946bf335d0083d3db92afee0c9618f87
version             20241205
revision            0

name                rtorrent-devel
conflicts           rtorrent
set real_name       rtorrent

categories          net
maintainers         nomaintainer
license             {GPL-2+ OpenSSLException}

description         console-based BitTorrent client (unstable release)

long_description    rTorrent is a console-based BitTorrent client. It aims to \
                    be a fully-featured and efficient client with the ability to \
                    run in the background using screen. It supports fast-resume \
                    and session management. \
                    This is the "unstable" release of rTorrent.

checksums           rmd160  fd59ec4a39a03b0c8d24743910eff16d7f0ff827 \
                    sha256  1dfa162aab0645c654480f5158d41fc1c18cdd8957bfa8692fdca11d88f9752a \
                    size    306788
github.tarball_from archive

use_autoreconf      yes

depends_build-append \
                    port:autoconf-archive

# malformed object (unknown load command 2)
if {${os.platform} eq "darwin" && ${os.major} <= 10} {
    depends_build-append port:cctools
}

depends_lib-append  port:curl \
                    port:libsigcxx2 \
                    port:libtorrent-devel \
                    port:ncurses \
                    port:zlib

# https://github.com/rakshasa/rtorrent/pull/1328
patchfiles-append   0001-scgi_task-allow-compiling-when-MSG_NOSIGNAL-undefine.patch

# https://github.com/rakshasa/rtorrent/wiki/Installing#non-blocking-hostname-lookup-in-curl
require_active_variants curl ares

compiler.cxx_standard   2011

configure.args      --mandir=${prefix}/share/man \
                    --disable-debug \
                    --enable-ipv6

legacysupport.redirect_bins rtorrent

variant xmlrpc description {Enable XMLRPC interface} {
    configure.args-append   --with-xmlrpc-c
    depends_lib-append      port:xmlrpc-c
}