# -*- 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           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1
PortGroup           openssl 1.0
PortGroup           qt4 1.0

openssl.branch      1.1

# If someone decides to add support for Qt5 or Qt6: please add subports, do not just replace Qt4 with a later version.
# As on now, GTK GUI is broken on PowerPC: https://trac.macports.org/ticket/67654
# Support for Qt4 has been removed in v. 3.0. It might be possible to restore it though. Until then, 2.94 builds and works.
name                transmission-qt
github.setup        transmission transmission 2.94
revision            1
conflicts           transmission-x11
categories          net p2p
license             {GPL-2 OpenSSLException}
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer

description         Lightweight BitTorrent client
long_description    Transmission is a free, lightweight BitTorrent client. \
                    It features a simple, intuitive interface on top \
                    of an efficient, cross-platform back-end. \
                    This is the Qt4 version for legacy systems.
homepage            https://transmissionbt.com

checksums           rmd160  22193236cba951729a52b7241fb7ba6f650a20df \
                    sha256  440c2fd0f89b1ab59d8a4b79ecd7bffd61bc000e36fb5b6c8e88142a4fadbb1f \
                    size    6342775
github.tarball_from archive

depends_build-append \
                    port:gettext

depends_lib-append  port:curl \
                    port:gettext-runtime \
                    port:libb64 \
                    port:libevent \
                    port:libiconv \
                    port:miniupnpc \
                    port:zlib

# Backport of https://github.com/transmission/transmission/commit/febfe49ca3ecab1a7142ecb34012c1f0b2bcdee8
patchfiles-append   patch-miniupnpc-18.diff

configure.args-append \
                    -DENABLE_CLI=ON \
                    -DENABLE_DAEMON=ON \
                    -DENABLE_GTK=OFF \
                    -DENABLE_MAC=OFF \
                    -DENABLE_NLS=OFF \
                    -DENABLE_QT=ON \
                    -DENABLE_TESTS=OFF \
                    -DENABLE_UTILS=ON \
                    -DENABLE_UTP=ON \
                    -DINSTALL_DOC=OFF \
                    -DUSE_QT5=OFF \
                    -DUSE_SYSTEM_B64=ON \
                    -DUSE_SYSTEM_MINIUPNPC=ON

compiler.cxx_standard 2011

configure.cxxflags-append \
                    -fno-exceptions
