# -*- 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-solr
categories-append       devel
license                 PHP-3.01
maintainers             {ryandesign @ryandesign} openmaintainer

# Compatible with PHP 8.4 as of 2.8.0
php.branches            5.3 5.4 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
php.pecl                yes

if {[vercmp ${php.branch} >= 7.4]} {
    version             2.8.0
    revision            0
    checksums           rmd160  b44e9c4da116812e4ee54e87c9a568597641bc09 \
                        sha256  092b52a7b94a807e40f8d85032c85dd0c052fab31d4f518e1d756b9f2d42d4b8 \
                        size    627604
} elseif {[vercmp ${php.branch} >= 7.0]} {
    version             2.6.0
    revision            1
    checksums           rmd160  741556911dc4667f2a9ec08042239cccd20bded5 \
                        sha256  7cbee19bd62d3fc89aea266cbf51c0e1d9d4127098f46848910419e8733a4dc7 \
                        size    621852
} elseif {[vercmp ${php.branch} >= 5.3]} {
    version             2.4.0
    revision            2
    checksums           rmd160  e4f025a3833b53dae8e066c4604c37026310d6c1 \
                        sha256  22865dafb76fc5839e84a5bd423bb37d5062883e5dfc4d064b43129ac9f2752c \
                        size    256316

    patchfiles-append   php72.patch
}

description             a PHP interface to Apache Solr

long_description        ${name} is an extremely fast, light-weight, feature-rich \
                        library that allows PHP developers to communicate easily \
                        and efficiently with Apache Solr server instances.

if {${name} ne ${subport}} {
    depends_lib-append      port:curl \
                            port:libxml2 \
                            port:${php}-curl

    if {[vercmp ${php.branch} >= 7.4]} {
        depends_build-append \
                            path:bin/pkg-config:pkgconfig
    }

    configure.args-append   --with-curl=${prefix} \
                            --with-libxml-dir=${prefix}

    use_parallel_build      yes
}
