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

name                upower
version             0.99.11
revision            1
license             GPL-2+
description         UPower is an abstraction for enumerating power devices, \
                    listening to device events and querying history and statistics.

long_description    {*}${description} \
                    Any application or service on the system can access the \
                    org.freedesktop.UPower service via the system message bus.

maintainers         {devans @dbevans} openmaintainer
categories          devel
platforms           darwin
homepage            https://upower.freedesktop.org/
master_sites        https://upower.freedesktop.org/releases/

use_xz              yes

checksums           rmd160  cb4620efd91cd8d1ac770ca014fa91939f39ed00 \
                    sha256  64b5ffbfccd5bdb15d925777979a4dbee1a957f9eaeb158dc76175267eddbdef \
                    size    430128

depends_build       port:gettext \
                    port:gtk-doc \
                    port:pkgconfig

# upower uses xsltproc; using /usr/bin/xsltproc will fail without
# XML_CATALOG_FILES set because it'll attempt to download the DTDs.
depends_build-append \
                    port:libxslt

depends_lib         port:dbus-glib

patchfiles          patch-configure.ac.diff

if {[string match *gcc-4.* ${configure.compiler}]} {
    patchfiles-append \
                    pragma.patch
}

use_autoreconf      yes
autoreconf.args     -fvi

gobject_introspection yes

configure.args      --with-backend=dummy \
                    --without-idevice \
                    --disable-maintainer-mode \
                    --disable-man-pages \
                    --disable-silent-rules \
                    --disable-tests

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
