# -*- 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-pyopencl
version             2023.1.4
categories-append   science parallel
license             MIT

maintainers         {petr @petrrr} openmaintainer

description         Python wrapper for OpenCL.
long_description    PyOpenCL lets you access GPUs and other massively \
                    parallel compute devices from Python.

homepage            https://mathema.tician.de/software/pyopencl

python.versions     27 38 39 310 311

patch.pre_args      -p1

if {${name} ne ${subport}} {
    if {${python.version} < 38} {
        version     2019.1.2
        revision    0
        checksums   rmd160  e848810e5f8911bd3a3b4620ea7c3330cf5d872a \
                    sha256  7803f3128dbd28ae6f5b851a80ef586a35b9575406ea7bb068b8e1516f8043f0 \
                    size    343805

        patchfiles  patch-setup.py-2019.diff

        compiler.cxx_standard 2011

    } else {
        checksums   rmd160  d06a4f94eb2a85e9abe5e6b8eb1e72da96766bca \
                    sha256  220174efca900e9d5de5aef2aa1b77a6f2550501de92b035a91013aeae4d4c5e \
                    size    473899

        patchfiles  patch-setup.py.diff

        compiler.cxx_standard 2014

        python.pep517   no

        depends_lib-append \
                        port:py${python.version}-platformdirs
    }

    depends_build-append \
                        port:py${python.version}-mako \
                        port:py${python.version}-numpy \
                        port:py${python.version}-pybind11 \
                        port:py${python.version}-setuptools

    depends_lib-append  port:py${python.version}-cffi

    depends_run-append  port:py${python.version}-decorator \
                        port:py${python.version}-pytools \
                        port:py${python.version}-pytest \
                        port:py${python.version}-appdirs \
                        port:py${python.version}-six

    use_configure       yes

    configure.cmd       ${python.bin} configure.py
    configure.args      --cl-enable-gl
    configure.universal_args-delete --disable-dependency-tracking
}
