diff --git a/config/pkg/ext/ext-xhprof.yml b/config/pkg/ext/ext-xhprof.yml new file mode 100644 index 00000000..b075f65b --- /dev/null +++ b/config/pkg/ext/ext-xhprof.yml @@ -0,0 +1,18 @@ +ext-xhprof: + type: php-extension + artifact: + source: + type: pecl + name: xhprof + extract: php-src/ext/xhprof-src + metadata: + license-files: [LICENSE] + license: Apache-2.0 + depends: + - ext-ctype + php-extension: + support: + Windows: wip + BSD: wip + arg-type: enable + build-with-php: true diff --git a/src/Package/Extension/xhprof.php b/src/Package/Extension/xhprof.php new file mode 100644 index 00000000..91c23fac --- /dev/null +++ b/src/Package/Extension/xhprof.php @@ -0,0 +1,35 @@ +getTargetPackage('php')->getSourceDir(); + $link = "{$php_src}/ext/xhprof"; + if (!is_link($link)) { + shell()->cd("{$php_src}/ext")->exec('ln -s xhprof-src/extension xhprof'); + + // patch config.m4 + FileSystem::replaceFileStr( + "{$this->getSourceDir()}/extension/config.m4", + 'if test -f $phpincludedir/ext/pcre/php_pcre.h; then', + 'if test -f $abs_srcdir/ext/pcre/php_pcre.h; then' + ); + return true; + } + return false; + } +}