# -*- 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               github 1.0
PortGroup               php 1.1

name                    php-phalcon3
maintainers             {ryandesign @ryandesign} openmaintainer
license                 BSD

php.branches            5.5 5.6 7.0 7.1 7.2 7.3

if {[vercmp ${php.branch} < 7.0]} {
    conflicts-append    ${php}-phalcon2
}
if {[vercmp ${php.branch} >= 7.2]} {
    conflicts-append    ${php}-phalcon4
}

if {[vercmp ${php.branch} >= 5.5]} {
    github.setup        phalcon cphalcon 3.4.5 v
    # Change github.tarball_from to 'releases' or 'archive' next update
    github.tarball_from tarball
    revision            0
    checksums           rmd160  77cc416d00dd02fbeb59705bd4d4d2ddfb9b4900 \
                        sha256  1e083a1d20ae6bf5059a7a775130ea373de589979ee51d763e4d6aa1d5501a06 \
                        size    6708019

}

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://phalconphp.com
dist_subdir             php-phalcon

if {${name} ne ${subport}} {
    # The build/install script makes all sorts of assumptions I don't like
    # so I'm ignoring it.

    set phpmajor        [lindex [split ${php.branch} .] 0]
    set build           build/php${phpmajor}
    if {[string match *64 ${build_arch}]} {
        set build       ${build}/64bits
    } else {
        set build       ${build}/32bits
    }

    worksrcdir          ${worksrcdir}/${build}

    # Separate dir for each arch means using the muniversal portgroup
    # but it doesn't get along with the php portgroup.
    universal_variant   no

    configure.args      --enable-phalcon
} else {
    github.livecheck.regex {(3\.[0-9.]+)}
}
