# -*- 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
# $Id: Portfile 111800 2013-10-02 14:17:01Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               php5extension 1.0

php5extension.setup     xhprof 0.9.4 pecl
categories-append       devel
platforms               darwin
maintainers             ryandesign openmaintainer
license                 Apache-2

description             A Hierarchical Profiler for PHP

long_description        XHProf is a function-level hierarchical profiler for \
                        PHP and has a simple HTML based navigational interface.

checksums               rmd160  e484c4902f287ef18d9f75dda75a28d73bb8272d \
                        sha256  002a2d4a825d16aeb3017c59f94d8c5e5d06611dd6197acd2f07fce197d3b8f8

patchfiles-append       patch-callgraph_utils.php.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/xhprof_lib/utils/callgraph_utils.php
}

php5extension.build_dirs    ${worksrcpath}/extension

use_parallel_build      yes

post-destroot {
    # Install php files not installed by the Makefile
    xinstall -d ${destroot}${prefix}/www/${name}
    copy ${worksrcpath}/examples ${destroot}${prefix}/www/${name}/examples
    copy ${worksrcpath}/xhprof_lib ${destroot}${prefix}/www/${name}/xhprof_lib
    copy ${worksrcpath}/xhprof_html ${destroot}${prefix}/www/${name}/xhprof_html
}

variant graphviz description {Build with graphviz, support for callgraphs} {
    depends_run-append      path:bin/dot:graphviz
}

livecheck.regex         {>(\d+(?:\.\d+)*(?:p\d+)?)</a></th>}
