# -*- 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
python.rootname     SQLAlchemy
version             2.0.30
revision            0
categories-append   databases
license             MIT

python.versions     38 39 310 311 312

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            http://www.sqlalchemy.org/

checksums           rmd160  5c3812b02ac97a964cda1a9cb2b6a478d201d59f \
                    sha256  2b1708916730f4830bc69d6f49d37f7698b5bd7530aca7f04f785f8849e95255 \
                    size    9579500

if {${name} ne ${subport}} {
    depends_build-append \
                        path:bin/cython-${python.branch}:py${python.version}-cython

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

    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]
        }
    }
}
