# -*- 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 79426 2011-06-13 08:14:22Z ryandesign@macports.org $

PortSystem              1.0
PortGroup               php5extension 1.0

php5extension.setup     xhprof 0.9.2 pecl
revision                3
categories-append       devel
platforms               darwin
maintainers             nomaintainer

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               md5     ae40b153d157e6369a32e2c1a59a61ec \
                        sha1    cef6bfb3374e05c7b7445249a304e066d4fd8574 \
                        rmd160  93ba97e303c038d1be54c55ecd67c68367e0356a

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
    patchfiles-append       patch-callgraph_utils.php.diff
    post-patch {
        reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/xhprof_lib/utils/callgraph_utils.php
    }
}

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