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

name                php-mcrypt
categories-append   security
maintainers         {ryandesign @ryandesign} {mathiesen.info:macintosh BjarneDMat}
license             PHP-3.01

# php71-mcrypt and earlier subports are in the php Portfile.
php.branches        7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5
php.pecl            yes

description         a PHP interface to the mcrypt library, which offers \
                    a wide variety of algorithms

long_description    ${description}

if {[vercmp ${php.branch} >= 7.2]} {
    version         1.0.9
    revision        0
    checksums       rmd160  3545e9c5f08983aea6900258746bf61861efdbe7 \
                    sha256  2a9ef0817d3bf677f6d7baf8e325629a2758974735d8abad6566384788d424a5 \
                    size    27142
}

if {${name} ne ${subport}} {
    depends_lib-append      port:libmcrypt

    # The mcrypt extension may be using libtool unnecessarily; monitor
    # https://bugs.php.net/bug.php?id=54500
    depends_lib-append      port:libtool

    configure.args-append   --with-mcrypt=${prefix}
}
