# -*- 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                tepl
version             6.4.0
revision            2
license             LGPL-3+
set branch          [join [lrange [split ${version} .] 0 1] .]
description         GNOME text editor support
long_description    ${description}
maintainers         nomaintainer
categories          gnome
homepage            https://gitlab.gnome.org/World/gedit/libgedit-tepl
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  2aa8e5937e0b186dfe46a575d5c022e5e978ffa1 \
                    sha256  5e56b20669d0cf05fa1d64b58c8c342c59158122dc518100d093d59df9b87321 \
                    size    164004

# Disable unexpected download of subprojects
meson.wrap_mode     nodownload

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

depends_lib         port:amtk \
                    port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:gtksourceview4 \
                    port:gsettings-desktop-schemas \
                    path:lib/pkgconfig/icu-uc.pc:icu

platform darwin {
    # build requires a newer version of ar/ranlib than available on 10.6 and earlier
    if {${os.major} < 11} {
        depends_build-append port:cctools
    }
}

# ld: unknown option: -export-symbols
compiler.blacklist-append \
                    *gcc-4.0 *gcc-4.2

configure.args      -Dgtk_doc=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}"
}

livecheck.type      gnome
