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

github.setup        lxqt qterminal 1.4.0
revision            1
categories          sysutils
maintainers         nomaintainer
license             {GPL-2 GPL-3}
# openssl is linked by QtNetwork only, and qterminal does not use QtNetwork
license_noconflict  openssl
description         A lightweight Qt terminal emulator based on QTermWidget
long_description    {*}${description}

checksums           rmd160  0ab4a9e3d2a83fd0f1e5b6561d64e19a8d27c54d \
                    sha256  8313326ac3ef728924271cd60a8f79e17e5e755a6bfa4e4419a4b7a53528659f \
                    size    219500
github.tarball_from releases
use_xz              yes

patch.pre_args-replace  -p0 -p1

depends_build-append \
                    port:lxqt-build-tools

depends_lib-append  port:qtermwidget

if {${os.platform} ne "darwin"} {
    depends_lib-append \
                    port:xorg-libX11
}

patchfiles          0001-Fix-for-Qt4.patch

# clang errors out here:
patchfiles-append   0002-errno.patch

configure.args-append \
                    -DBUILD_TESTS=OFF

compiler.cxx_standard   2017

post-destroot {
    move ${destroot}${prefix}/qterminal.app \
         ${destroot}${applications_dir}/qterminal.app
}
