# -*- 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                libgdata
version             0.18.1
revision            1
set branch          [join [lrange [split ${version} .] 0 1] .]
description         libgdata is a GLib-based library for accessing online service APIs using the \
                    GData protocol --- most notably, Google's services.

long_description    ${description} \
                    It provides APIs to access the common Google services, and has full asynchronous support.

maintainers         {devans @dbevans} openmaintainer
categories          gnome net
license             LGPL-2.1+
homepage            https://wiki.gnome.org/Projects/${name}
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  f2cddcc8a70ea4bc463241145d13cfe877f9f566 \
                    sha256  dd8592eeb6512ad0a8cf5c8be8c72e76f74bfe6b23e4dd93f0756ee0716804c7 \
                    size    851584

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

depends_lib         path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:gcr \
                    path:lib/pkgconfig/gdk-pixbuf-2.0.pc:gdk-pixbuf2 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:json-glib \
                    port:libsoup-2.4 \
                    port:libxml2 \
                    port:uhttpmock

configure.args      -Dgoa=disabled \
                    -Dgtk_doc=true

platform darwin {
    if {${os.major} > 10 || (${os.major} == 10 && ${configure.build_arch} eq "x86_64")} {
        # This depends on webkit2-gtk, which is broken presently on < 10.6 and 32-bit 10.6:
        depends_lib-append \
                    port:gnome-online-accounts
        configure.args-replace \
                    -Dgoa=disabled -Dgoa=enabled
    }
}

test.run            yes

# uses g-ir-scanner, which uses $CC from env
if {${universal_possible} && [variant_isset universal]} {
    foreach arch ${configure.universal_archs} {
        lappend merger_build_env(${arch})  "CC=${configure.cc} -arch ${arch}"
        lappend merger_destroot_env(${arch})  "CC=${configure.cc} -arch ${arch}"
    }
} else {
    build.env-append       "CC=${configure.cc} ${configure.cc_archflags}"
    destroot.env-append    "CC=${configure.cc} ${configure.cc_archflags}"
}

livecheck.type      gnome-with-unstable
