# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup               php 1.1

name                    php-phalcon5
maintainers             {ryandesign @ryandesign} {mathiesen.info:macintosh @BjarneDMat} openmaintainer
license                 BSD

php.branches            7.4 8.0 8.1 8.2 8.3 8.4 8.5
php.pecl                yes
php.pecl.name           phalcon
set pecl_homepage       https://pecl.php.net/package/${php.pecl.name}

if {[vercmp ${php.branch} <= 7.4]} {
    conflicts-append    ${php}-phalcon4
}

if {[vercmp ${php.branch} >= 8.1]} {
    version             5.16.0
    distname            ${php.pecl.name}-${version}
    revision            0
    checksums           rmd160  678932f2517050c54329a5c56d5416f5e8f5b1c6 \
                        sha256  33db2df75a81224f710a2435f7f81c5fe1486ea1fb11579f66c4875a28b4d607 \
                        size    1364235
} elseif {[vercmp ${php.branch} >= 8.0]} {
    version             5.8.0
    distname            ${php.pecl.name}-${version}
    revision            0
    checksums           rmd160  7431f619589c60426892ba9deff7eb7d1c78018b \
                        sha256  d80b137763b790854c36555600a23b1aa054747efd0f29d8e1a0f0c5fa77f476 \
                        size    967103
} elseif {[vercmp ${php.branch} >= 7.4]} {
    version             5.4.0
    distname            ${php.pecl.name}-${version}
    revision            0
    checksums           rmd160  17e92cc6a21138081a6bdc84a8e2ab53756be7af \
                        sha256  47810a0aaa20c1a3cf0a2d7babccfa1870fa0fc78d30cefd45ed808f89d47619 \
                        size    966058
}

if {[vercmp ${php.branch} <= 8.0]} {
    patch.pre_args-replace  -p0 -p1
    patchfiles          patch_phalcon.zep.c.diff
}

description             full stack PHP framework written as an extension

long_description        Phalcon is an open source full stack framework for \
                        PHP, written as a C-extension. Phalcon is optimized \
                        for high performance. Its unique architecture allows \
                        the framework to always be memory resident, offering \
                        its functionality whenever it's needed, without \
                        expensive file stats and file reads that traditional \
                        PHP frameworks employ.

homepage                https://phalcon.io
dist_subdir             php-phalcon

if {${name} ne ${subport}} {
    depends_lib-append  port:${php}-psr \
                        port:pcre

    configure.args      --enable-phalcon
}
