# -*- 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.49
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 310 311 312 313 314

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  16a2112b9467a28e5d177a5dfb609197507a8e75 \
                    sha256  d15950a57a210e36dd4cec1aac22787e2a4d57ba9318233e2ef8b2daf9ff2d5f \
                    size    9898221

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
}
