# -*- 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
PortGroup           qt6 1.0

name                py-pyqt6-scintilla
python.rootname     PyQt6_QScintilla
version             2.14.1
revision            0

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

description         PyQt6 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  e0d60c85828f36572479174f1ca11cfb3f87e946 \
                    sha256  8849a4a9847bbf3698d0c1cf47e6d08552a49a66928543a73f10d6dcba617d10 \
                    size    1775955

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

compiler.cxx_standard 2011

if {${name} ne ${subport}} {
    use_xcode       yes

    depends_build-append \
                    port:py${python.version}-pyqt-builder \
                    path:${python.prefix}/bin/sip-build:py${python.version}-sip

    depends_lib-append \
                    port:qscintilla-qt6 \
                    port:py${python.version}-pyqt6 \
                    port:py${python.version}-pyqt6-sip

    build.args-append \
                    --qmake ${prefix}/libexec/qt6/bin/qmake \
                    --verbose

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

    destroot.destdir    "INSTALL_ROOT=${destroot}"

    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}
    }
}
