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

name                libhandy-0.0
version             0.0.13
revision            1
categories          gnome
license             LGPL-2.1+
maintainers         {devans @dbevans} 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.

platforms           darwin

# https://gitlab.gnome.org/GNOME/libhandy/-/archive/7a193d7692c9c76a1a94f17c4d30b585f77d177c/libhandy-7a193d7692c9c76a1a94f17c4d30b585f77d177c.tar.bz2
# https://gitlab.gnome.org/GNOME/libhandy/-/archive//v0.0.13/libhandy-v0.0.13.tar.bz2
homepage            https://gitlab.gnome.org/GNOME/libhandy/-/tags/v${version}
master_sites        https://gitlab.gnome.org/GNOME/libhandy/-/archive/v${version}

use_bzip2           yes

distname            libhandy-${version}

checksums           rmd160  4c7454aafc684e31910d78af50443394d40d3d89 \
                    sha256  e19f3d72c2043f247d38a6949683fe23ffa34477935d332b02bf503bb13a1e18 \
                    size    377247

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

depends_lib         path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:gobject-introspection \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    path:bin/vala:vala

patchfiles          glade-3.36-api.patch

compiler.c_standard 2011

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

if {![info exists universal_possible]} {
    set universal_possible [expr {${os.universal_supported} && [llength ${configure.universal_archs}] >= 2}]
}

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

# last release of the 0.0 API
livecheck.type      none
