# -*- 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               cmake   1.1
PortGroup               github  1.0
PortGroup               qt6     1.0

github.setup            flameshot-org flameshot 14.0.0 v
github.tarball_from     archive
revision                0

homepage                https://flameshot.org

description             Powerful yet simple to use screenshot software

long_description        \
    {*}${description} supporting in-app screenshot editing, Imgur upload, \
    customizable appearance and more.

categories              sysutils graphics
installs_libs           no
license                 GPL-3
maintainers             {gmail.com:herby.gillot @herbygillot} \
                        openmaintainer

master_sites            ${github.homepage}/archive/refs/tags/
distname                v${version}

checksums               rmd160  bece6def824a7b91390e015a68f235b1c50f582a \
                        sha256  31a9419089aee8570fa0a996515b97d165a23672b2da1e3a0b5ed2f7f68a3631 \
                        size    16393933

qt6.depends_lib         qtsvg \
                        qttools

cmake.build_dir         ${worksrcpath}/build

configure.args-append   -DENABLE_CACHE=OFF

compiler.cxx_standard   2017

destroot {
    set build_src_dir   ${cmake.build_dir}/src

    copy ${build_src_dir}/flameshot.app ${destroot}${applications_dir}/

    ln -s ${applications_dir}/flameshot.app/Contents/MacOS/${name} \
        ${destroot}${prefix}/bin/

    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    copy ${build_src_dir}/share/bash-completion/completions/flameshot \
        ${destroot}${prefix}/share/bash-completion/completions/

    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    copy ${build_src_dir}/share/zsh/site-functions/_flameshot \
        ${destroot}${prefix}/share/zsh/site-functions/

    xinstall -d ${destroot}${prefix}/share/man/man1
    copy ${worksrcpath}/data/man/man1/${name}.1 \
        ${destroot}${prefix}/share/man/man1/
}

github.livecheck.regex  {([0-9.-]+)}
