# -*- 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 13.2.0 v
# github.tarball_from: Change back to archive on next update
github.tarball_from     tarball
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

checksums               rmd160  45099130024c2864b84d3e2a562382cd1993aceb \
                        sha256  b6394f7f9978e584fc8e2d54837f0d000e16cf8586e9a9652da9ba174cd25f8a \
                        size    16080718

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.-]+)}
