# -*- 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                yelp-tools
version             40.0
revision            1
license             GPL-2+
set branch          [lindex [split ${version} .] 0]
description         Tools to help create Yelp documentation.
long_description    yelp-tools is a collection of scripts and build utilities to help create, \
                    manage, and publish documentation for Yelp and the web.
maintainers         {devans @dbevans} openmaintainer
categories          gnome
platforms           any
homepage            https://wiki.gnome.org/Apps/Yelp/Tools
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  7a8f1fa5043bdafcfaa33360c9b57432e28c2933 \
                    sha256  664bacf2f3dd65ef00a43f79487351ab64a6c4c629c56ac0ceb1723c2eb66aae \
                    size    38708

supported_archs     noarch

set py_ver          3.12
set py_ver_nodot    [string map {. {}} ${py_ver}]

depends_build       path:bin/pkg-config:pkgconfig

depends_lib         port:py${py_ver_nodot}-lxml \
                    port:python${py_ver_nodot} \
                    port:yelp-xsl

depends_run         port:itstool \
                    port:libxml2 \
                    port:libxslt

installs_libs       no

post-patch {
    reinplace "s|'python3'|'${prefix}/bin/python${py_ver}'|g" \
        ${worksrcpath}/meson.build
    reinplace "s|/usr/bin/python3|${prefix}/bin/python${py_ver}|g" \
        ${worksrcpath}/tools/yelp-build.in \
        ${worksrcpath}/tools/yelp-check.in \
        ${worksrcpath}/tools/yelp-new.in
}

livecheck.type      gnome
