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

name                JuffEd
github.setup        Mezomish juffed 04728a59e0a66b4359155e6d8132eafd048cf16d
version             20240816
revision            0
categories          editors
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             GPL-2

description         ${name} is a Qt-based text editor
long_description    {*}${description}.

checksums           rmd160  a9e7b48e157a6aa82902fa2cdcd5e437da2b5715 \
                    sha256  e74a4b541c95a6fc8e902d065bcaccba250d20c3166765f29c07b4b9ed5ff0a8 \
                    size    1629973
github.tarball_from archive

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:qtermwidget

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

    depends_lib-append \
                    port:qscintilla-qt4

    configure.args-append \
                    -DUSE_QT5=OFF
} else {
    PortGroup       qt5 1.0

    qt5.depends_component qttools

    depends_lib-append \
                    port:qscintilla-qt5

    configure.args-append \
                    -DUSE_QT5=ON \
                    -DQSCINTILLA_INCLUDE_DIR=${qt_includes_dir} \
                    -DQSCINTILLA_LIBRARY=${qt_libs_dir}/libqscintilla2_qt5.dylib
}

configure.args-append \
                    -DCMAKE_INSTALL_PREFIX=${applications_dir}
