# -*- 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                amtk
version             5.6.1
revision            0
license             LGPL-2.1+
set branch          [join [lrange [split ${version} .] 0 1] .]
description         ${name} is a companion library to GLib and Gtk+.
long_description    ${description} Amtk is an acronym for Actions, Menus \
                    and Toolbars Kit. It is a basic GtkUIManager replacement \
                    based on GAction. It is suitable for both a traditional UI \
                    or a modern UI with a GtkHeaderBar.

maintainers         {devans @dbevans} openmaintainer
categories          gnome
homepage            https://gitlab.gnome.org/World/${name}
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

# Disable unexpected download of subprojects
meson.wrap_mode     nodownload

checksums           rmd160  4bf57b52a84c1bf8dff8a99a94d0c5e5e8359bd4 \
                    sha256  d50115b85c872aac296934b5ee726a3fa156c6f5ad96d27e0edd0aa5ad173228 \
                    size    58472

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

depends_lib         port:gettext-runtime \
                    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

# 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 {
    # Tiger lacks @rpath, apply the usual gtk-doc workaround
    destroot.env-append    "DYLD_LIBRARY_PATH=${build_dir}/${name}"
}

livecheck.type      gnome
