# -*- 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
}

patch.pre_args-replace  -p0 -p1
patchfiles              patch_phalcon.zep.c.diff

if {[vercmp ${php.branch} >= 8.1]} {
    version             5.10.0
    distname            ${php.pecl.name}-${version}
    revision            0
    checksums           rmd160  50135439af97ad94cf17334a1cec9396bdf94eb1 \
                        sha256  3b552ac17fae44512298f43ec47cd055679d40e8c74b782743021dce77859eb1 \
                        size    981133
} 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
}

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
}
