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

name                py-pyqt5-scintilla
python.rootname     QScintilla
version             2.14.1
revision            0

categories-append   devel
license             {GPL-3 OpenSSLException}
maintainers         {reneeotten @reneeotten} openmaintainer

description         PyQt5 bindings for the QScintilla programmers editor widget
long_description    QScintilla is a port to Qt of the Scintilla programmers editor widget. It supports \
                    the traditional low-level Scintilla API and implements a high-level API covering \
                    such things as auto-completion, code folding and lexer configuration.

homepage            https://www.riverbankcomputing.com/software/qscintilla

checksums           rmd160  4ca3029ab9123c75125efa982249af7934e61899 \
                    sha256  2c120a56d60363ff4bc73b8a763dc69fae5f84681c24efcb03064c7df103052b \
                    size    1775505

python.versions     310 311 312 313 314
python.pep517       no

# these Python versions require an older qscintilla-qt5 version
conflicts           py27-qscintilla-qt5 py35-qscintilla-qt5

compiler.cxx_standard 2011

if {${name} ne ${subport}} {
    PortGroup       qmake5 1.0
    use_xcode       yes

    depends_build-append \
                    port:py${python.version}-pyqt-builder \
                    port:py${python.version}-sip

    depends_lib-append \
                    port:qscintilla-qt5 \
                    port:py${python.version}-pyqt5

    build.args-append \
                    --qmake ${qt_qmake_cmd} \
                    --verbose

    build.cmd       sip-build-${python.branch}
    build.target

    pre-destroot {
        reinplace "s|sip-distinfo|sip-distinfo-${python.branch}|g" \
            ${build.dir}/build/Makefile
    }

    destroot.cmd    make
    destroot.dir    ${build.dir}/build

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} NEWS LICENSE \
            ChangeLog README ${destroot}${docdir}
    }
}
