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

PortSystem          1.0
PortGroup           gitlab 1.0
PortGroup           meson 1.0

gitlab.instance     https://gitlab.gnome.org
gitlab.setup        GNOME libhandy 1.8.3
revision            0

categories          gnome
license             LGPL-2.1+
maintainers         {devans @dbevans} {mascguy @mascguy} openmaintainer
description         A library full of GTK+ widgets for mobile phones
long_description    The aim of the Handy library is to help with developing UI \
                    for mobile devices using GTK/GNOME.

checksums           rmd160  f0f4f8a65d9e81654585248d3d78b0e1b38575fd \
                    sha256  1c8403a467bdd16b84bb423573fc0da4b7bc2ba74dc1729ac5e385de35b662b7 \
                    size    575746

# Disable unexpected download of subprojects
meson.wrap_mode     nodownload

depends_build-append \
                    port:gettext \
                    port:libxml2 \
                    path:bin/pkg-config:pkgconfig

depends_lib-append \
                    path:lib/pkgconfig/atk.pc:atk \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    port:fribidi \
                    path:lib/pkgconfig/gdk-pixbuf-2.0.pc:gdk-pixbuf2 \
                    port:gettext-runtime \
                    port:glade \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    path:lib/pkgconfig/pango.pc:pango \
                    path:bin/vala:vala

compiler.c_standard 2011

configure.args-append \
                    -Dbuildtype=plain \
                    -Dexamples=false \
                    -Dglade_catalog=enabled \
                    -Dgtk_doc=false \
                    -Dintrospection=enabled \
                    -Dtests=false \
                    -Dvapi=true

# gobject-introspection 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}"
}

platform darwin 8 {
    # meson on Tiger cannot use rpaths, so we workaround with this to find dylib
    destroot.env-append \
                    "DYLD_LIBRARY_PATH=${build_dir}/src"
}
