# -*- 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-sqlalchemy
version             2.0.38
revision            0
categories-append   databases
license             MIT

# do NOT remove the 27 subport as this is a depdendency of buildbot-0.8, which
# is required for the MacPorts infractructure
python.versions     27 39 310 311 312 313

maintainers         {stromnov @stromnov} openmaintainer

description         Python SQL ORM

long_description    SQLAlchemy is the Python SQL toolkit and Object \
                    Relational Mapper that gives application developers \
                    the full power and flexibility of SQL.

homepage            https://www.sqlalchemy.org/

checksums           rmd160  c25b97d014982aaf17291e7654b9951b19ce0a18 \
                    sha256  e5a4d82bdb4bf1ac1285a68eab02d253ab73355d9f0fe725a97e1e0fa689decb \
                    size    9634782

if {${name} ne ${subport}} {
    if {${python.version} == 27} {
        python.rootname     SQLAlchemy
        version             1.4.46
        revision            0
        distname            ${python.rootname}-${version}
        checksums           rmd160  7582cdd7d9142e1b1d969712111a18b19e2710d5 \
                            sha256  6913b8247d8a292ef8315162a51931e2b40ce91681f1b6f18f697045200c4a30 \
                            size    8544238
        depends_build-append \
                            port:py${python.version}-setuptools
        depends_lib-append  port:py${python.version}-importlib-metadata
    } else {
        depends_build-append \
                            path:bin/cython-${python.branch}:py${python.version}-cython

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

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

    post-destroot {
        # Install example files not installed by the Makefile
        xinstall -m 755 -d ${destroot}${python.prefix}/share/doc/sqlalchemy/examples
        foreach f [glob -directory ${worksrcpath}/doc *] {
            copy $f ${destroot}${python.prefix}/share/doc/sqlalchemy/[file tail $f]
        }
        foreach f [glob -directory ${worksrcpath}/examples *] {
            copy $f ${destroot}${python.prefix}/share/doc/sqlalchemy/examples/[file tail $f]
        }
    }

    livecheck.type      none
}