php-build
- Definition Format
# Passes `--with-pear=$PREFIX/pear` to `configure`.
with_pear
# Add/Delete flags passed to `configure`.
configure_option <FLAG> [<VALUE>]
configure_option -R <FLAG> [<VALUE>]
configure_option -D <FLAG>
# Download and compile a PHP package from <URL>
install_package <URL>
# Checkout branch from Git repository
install_package_from_github master
# Download and compile XDebug version tarball.
install_xdebug <VERSION>
# Use XDebug from <https://github.com/derickr/xdebug>. Development
# versions of PHP need the latest XDebug from master.
install_xdebug_master
install_pyrus [<URL>]
php-build definitions are Shell source files which get sourced by the php-build
command. Therefore you can put everything in a definition file that's valid
Shell source code.
php-build defines some custom commands, which aid in building, downloading and compiling PHP tarballs and often needed add-on features such as PEAR support and XDebug.
install_package
URL/var/tmp/php-build/source
and compiles it to the PREFIX
provided at the invocation of php-build(1).
.gz
and .bz2
tarballs are supported.install_package_from_github
BRANCH [REPO]php/php-src
.configure_option
[-R
] FLAG [VALUE]configure
.
When VALUE is present, then FLAG=VALUE is added to the list
of configure options.
Replaces the value of the existing FLAG with a new VALUE when
the -R
option is present.configure_option
-D
FLAGwith_pear
pear
command is disabled by default in the configure options in
favor of the new Pyrus Tool for PEAR. To enable pear
call this
command before install_package
.with_openssl
--with-openssl
to the list of configure options.
Legacy command, which is left in for backwards compatibility with definitions
written before --with-openssl
was moved to the default configure options.Definition commands can be added via plugins. Plugins are, like definitions, Shell
files which are automatically loaded from share/php-build/plugins.d
.
Plugin files must have the extension .sh
.
php-build(1) displays a list of loaded plugins at startup.
Due to how functions are handled in Shell, plugins can define new functions as well as override existing functions. Though it's not recommended for plugin authors to override builtin definition commands.
Plugins can use a set of environment variables to do actions on the built files, as well as all builtin commands.
DEFINITION
5.4.0
. When a
file path was passed as definition, then this contains the path's basename.DEFINITION_PATH
PREFIX
TMP
CONFIGURE_OPTIONS
configure
, separated by line feeds.PHP_BUILD_ROOT
/usr/local
.LOG_PATH
install_pyrus
[URL]pyrus
command for managing PEAR packages.
Each built PHP versions also gets its own Pyrus environment (not shared).install_xdebug
VERSIONinstall_xdebug_master
[SHA1]HEAD
.