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

name                gupnp-igd
version             0.2.4
revision            1
license             LGPL
set branch          [join [lrange [split ${version} .] 0 1] .]
description         GUPnP-IGD is a library to handle UPnP IGD port mapping.

long_description    ${description}

maintainers         devans openmaintainer
categories          net gnome
platforms           darwin
homepage            https://wiki.gnome.org/Projects/GUPnP
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  5ad9970458dab6695006854677256e3c0a5e5794 \
                    sha256  38c4a6d7718d17eac17df95a3a8c337677eda77e58978129ad3182d769c38e44

depends_build       port:pkgconfig

depends_lib         port:gupnp

patchfiles          patch-configure.diff \
                    patch-python-pygupnp-igd-module.c.diff

gobject_introspection yes

# blacklist compilers that do not support C11
# due to error: redefinition of typedef 'GUPnPService'
# build fix for SL and earlier

compiler.blacklist  *gcc* {clang < 300}

configure.args      --disable-silent-rules \
                    --disable-python

variant python27 description {Enable Python 2.7 bindings} {
                configure.args-replace      --disable-python --enable-python
                depends_lib-append          port:py27-gobject
                configure.python            ${prefix}/bin/python2.7
                set python_prefix           ${frameworks_dir}/Python.framework/Versions/2.7
                set python_pkg_config_path  ${python_prefix}/lib/pkgconfig
                configure.pkg_config_path   ${python_pkg_config_path}
                build.env-append            PATH=${python_prefix}/bin:$env(PATH)
}

default_variants    +python27

livecheck.type      gnome