# -*- 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               github 1.0

if {${os.platform} eq "darwin" && ${os.major} < 11} {
    PortGroup               qmake 1.0

    # From 1.2.0 it is broken, see: https://github.com/IJHack/QtPass/issues/665
    github.setup            IJHack QtPass 1.1.6 v
    revision                0

    github.tarball_from     archive
    checksums               rmd160  8d709714afbd413eb47df3df4d27e2f2ec4c0c0f \
                            sha256  d24d95de129ce716b9b0fde6114407f860ce8c77106bd0ee6a12e8e4e0deb42b \
                            size    325329

    patchfiles-append       0001-qtpass.pro-remove-a-breaking-setting.patch

    destroot {
        copy ${worksrcpath}/${name}.app ${destroot}${applications_dir}
    }
} else {
    PortGroup               qt5 1.0
    PortGroup               qmake5 1.0

    github.setup            IJHack QtPass 1.4.0 v
    revision                0

    github.tarball_from     releases
    checksums               rmd160  136092a5e9b14445524bc30ca82826233807da6e \
                            sha256  9abe9cde35a412b26b6376a5e8996dfeeeb5910fe6a723b78bcf954656fca0e6 \
                            size    581368

    qt5.min_version         5.10
    qt5.depends_component   qtsvg qttools qttranslations
    qt5.mac_sdk             macosx

    compiler.cxx_standard   2011

    destroot {
        copy ${worksrcpath}/main/${name}.app ${destroot}${applications_dir}
    }
}

categories              aqua security
license                 GPL-3+
maintainers             nomaintainer

description \
    QtPass is a multi-platform GUI for pass, the standard unix password manager.
long_description \
    QtPass is part of the pass ecosystem. This means you are not stuck with \
    QtPass, you can use the same password store with many clients. \
    \
    Contrary to many Free, Libre and OpenSource password managers, pass and by \
    extension QtPass are not bound to one user or device. Since we are based on \
    GnuPG we have multi-key, multi recipient encryption out of the box. The use \
    of external encryption devices like OpenPGP or x509/CMS based smartcards or \
    USB tokens and per-folder ACL makes it easy to grant or take away privileges \
    from users.

homepage                https://qtpass.org

configure.args-append   CONFIG+=release

test.run                yes
test.target             check

github.livecheck.regex  {^v?[0-9.]+)}
