# -*- 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
# $Id$

PortSystem          1.0
PortGroup           gobject_introspection 1.0

name                libgweather
version             3.20.3
set branch          [join [lrange [split ${version} .] 0 1] .]
maintainers         devans openmaintainer
categories          net gnome
license             GPL-2+ LGPL-2.1+
platforms           darwin
description         Library to accessing online weather informations.

long_description    libgweather is a library to access weather \
                    information from online services for numerous \
                    locations.

homepage            https://wiki.gnome.org/Projects/LibGWeather
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  52891cf06d7fb816048bd0968c97514130615c5e \
                    sha256  fb6bc5b64ef5db3dc40a9798f072b83ebcafe7ff5af472aaee70600619b56c0b

depends_build       port:pkgconfig \
                    port:intltool \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:gnome-common \
                    port:gtk-doc

depends_lib         port:gtk3 \
                    port:libxml2 \
                    port:libsoup \
                    port:geocode-glib \
                    port:vala

gobject_introspection yes

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
    file delete -force ${worksrcpath}/m4
}

configure.cmd       ./autogen.sh

configure.args      --enable-compile-warnings=no \
                    --enable-vala=yes \
                    --enable-glade-catalog=no \
                    --disable-schemas-compile \
                    --disable-silent-rules \
                    --disable-glibtest

variant glade description {Enable building of glade catalog items} {
    depends_lib-append  port:glade
    configure.args-replace --enable-glade-catalog=no --enable-glade-catalog=yes
}

# glade expects catalog modules and libraries to have a .so suffix

post-destroot {
    if {[variant_isset glade]} {
        set libdir ${prefix}/lib
        ln -s ${libdir}/libgweather-3.dylib ${destroot}${libdir}/libgweather-3.so
    }
}

post-activate {
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type      gnome