# -*- 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-mssql
python.rootname     pymssql
version             2.3.8
revision            0

categories-append   databases
license             LGPL-2.1+
maintainers         nomaintainer

description         A simple database interface to MS-SQL for Python.
long_description    {*}${description}

homepage            https://pymssql.org

checksums           rmd160  bdf68b659cb97370dc3f51c11711a2ebaee34a2e \
                    sha256  dafa4887d697503ac890db316470be22d9b4023487e6425ba67aa0a6681babf5 \
                    size    185176

python.versions     310 311 312 313 314

if {${name} ne ${subport}} {
    build.env-append \
                    PYMSSQL_FREETDS_INCLUDEDIR=${prefix}/include/freetds \
                    PYMSSQL_FREETDS_LIBDIR=${prefix}/lib

    depends_build-append \
                    port:py${python.version}-cython \
                    port:py${python.version}-packaging \
                    port:py${python.version}-setuptools_scm

    if {${python.version} > 311} {
        depends_build-append \
                    port:py${python.version}-standard-distutils
    }

    depends_lib-append \
                    port:freetds

    depends_test-append \
                    port:py${python.version}-gevent \
                    port:py${python.version}-psutil \
                    port:py${python.version}-sqlalchemy

    test.run        yes
}
