# -*- 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           github 1.0

github.setup        irssi irssi 1.4.5
categories          irc
platforms           darwin
license             {GPL-2+ OpenSSLException}
maintainers         {l2dy @l2dy} openmaintainer
description         modular IRC client
long_description \
    Irssi is a modular chat client that is most commonly known for its text \
    mode user interface, but 80% of the code isn't text mode specific.      \
    Irssi comes with IRC support built in, and there are third party ICB,   \
    SILC, XMPP (Jabber), PSYC and Quassel protocol modules available.

homepage            https://irssi.org/
github.tarball_from releases

use_xz              yes

checksums           rmd160  d214c6df7dad00a321964eec6344570bda6de30d \
                    sha256  72a951cb0ad622785a8962801f005a3a412736c7e7e3ce152f176287c52fe062 \
                    size    1215688

depends_build       port:pkgconfig
depends_lib         port:gettext path:lib/pkgconfig/glib-2.0.pc:glib2 port:libiconv port:ncurses \
                    path:lib/libssl.dylib:openssl port:zlib

configure.args      --disable-silent-rules \
                    --without-socks \
                    --without-bot \
                    --with-proxy \
                    --with-modules \
                    --with-perl=no

variant perl description {Add Perl support} {
    global perl5.major
    set perl5.major 5.34
    depends_lib-append port:perl${perl5.major}
    configure.args-replace  --with-perl=no --with-perl=yes
    configure.args-append   --with-perl-lib=vendor
    configure.env-append    perlpath=${prefix}/bin/perl${perl5.major}

    post-destroot {
        delete ${destroot}${prefix}/lib/perl5/${perl5.major}/darwin-thread-multi-2level/perllocal.pod
    }
}

default_variants    +perl

github.livecheck.regex  {([^"-]+)}
