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

PortSystem          1.0
PortGroup           meson 1.0

name                libsigcxx2
set gname           libsigc++
version             2.12.1
revision            1

categories          devel
license             LGPL-2.1
maintainers         {devans @dbevans} {mascguy @mascguy} openmaintainer

description         C++ signal callback system
long_description    libsigc++ implements a typesafe callback system for standard C++. It allows you to define signals and to \
                    connect those signals to any callback function, either global or a member function, regardless of whether \
                    it is static or virtual.
homepage            https://libsigcplusplus.github.io/libsigcplusplus/

set branch          [join [lrange [split ${version} .] 0 1] .]
master_sites        gnome:sources/${gname}/${branch}/
distname            ${gname}-${version}
use_xz              yes

checksums           rmd160  56e4808384b4dd1eeb8371f30e885966e1f13b03 \
                    sha256  a9dbee323351d109b7aee074a9cb89ca3e7bcf8ad8edef1851f4cf359bd50843 \
                    size    5041732

# Disable unexpected download of subprojects
meson.wrap_mode     nodownload

set port_ver_major  [lindex [split ${version} .] 0]

depends_build-append \
                    port:pkgconfig \
                    port:mm-common \
                    port:m4 \
                    port:libxslt

# libsigc++ > 2.4.1 requires C++11 or better
compiler.cxx_standard 2011

configure.perl      /usr/bin/perl
configure.env-append \
                    M4=${prefix}/bin/gm4

configure.args-append \
                    -Dbuild-deprecated-api=true \
                    -Dbuild-documentation=false

post-destroot {
    set docdir ${prefix}/share/doc/${gname}-2.0
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        COPYING ChangeLog NEWS README.md \
        ${destroot}${docdir}
}

livecheck.type      gnome
livecheck.name      ${gname}
livecheck.regex     "LATEST-IS-(${port_ver_major}\\.\\d*\[02468\](?:\\.\\d+)*)"
