# -*- 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.1.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

checksums               rmd160  9de9a35121324c5f4bc66792c8edd6d1a924f94e \
                        sha256  1d755a618bdcb3e739f691cea55ed2d432f93e521a504f95b74abed0c595f6f7 \
                        size    16028319

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