# -*- 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-webengine
python.rootname     PyQt6-WebEngine
version             6.7.9
revision            0

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

description         Python bindings for the Qt WebEngine framework
long_description    {*}${description}

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

# take the snapshot from Riverbank until released on PyPI which might take a while
# call it version 6.7.9
# see: https://www.riverbankcomputing.com/pipermail/pyqt/2024-October/046044.html
master_sites        https://www.riverbankcomputing.com/pypi/packages/PyQt6-WebEngine
distname            PyQt6_WebEngine-6.8.0.dev2411020930

#distname            PyQt6_WebEngine-${version}

checksums           rmd160  e712ba4f3e62a114177e0ea1e0dbe4714fa0799e \
                    sha256  d24de80fd267aa07aba769a170e011a8e744fe1c282451e38335912c60c97554 \
                    size    34309

python.versions     39 310 311 312
python.pep517       no

compiler.cxx_standard 2011

if {${name} ne ${subport}} {
    qt6.depends_lib qtwebengine

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

    depends_lib-append \
                    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

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

    destroot.cmd    make
    destroot.dir    ${build.dir}/build
    destroot.destdir "INSTALL_ROOT=${destroot}"

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