php: add embedded package

This commit is contained in:
schneefux 2016-10-01 21:16:55 +02:00 committed by Robin Gloster
parent 10cfe945fe
commit a7f25fe167
2 changed files with 16 additions and 1 deletions

@ -38,6 +38,10 @@ let
buildInputs = [apacheHttpd];
};
embed = {
configureFlags = ["--enable-embed"];
};
# Extensions
imap = {
configureFlags = [
@ -230,6 +234,7 @@ let
pdo_mysqlSupport = config.php.pdo_mysql or true;
libxml2Support = config.php.libxml2 or true;
apxs2Support = config.php.apxs2 or (!stdenv.isDarwin);
embedSupport = config.php.embed or false;
bcmathSupport = config.php.bcmath or true;
socketsSupport = config.php.sockets or true;
curlSupport = config.php.curl or true;
@ -263,13 +268,15 @@ let
configurePhase = ''
# Don't record the configure flags since this causes unnecessary
# runtime dependencies.
# runtime dependencies - except for php-embed, as uwsgi needs them.
${lib.optionalString (!(config.php.embed or false)) ''
for i in main/build-defs.h.in scripts/php-config.in; do
substituteInPlace $i \
--replace '@CONFIGURE_COMMAND@' '(omitted)' \
--replace '@CONFIGURE_OPTIONS@' "" \
--replace '@PHP_LDFLAGS@' ""
done
''}
[[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
./configure --with-config-file-scan-dir=/etc/php.d --with-config-file-path=$out/etc --prefix=$out $configureFlags

@ -5756,6 +5756,14 @@ in
php70
php71;
php-embed = php71-embed;
php71-embed = php71.override {
config.php.embed = true;
config.php.apxs2 = false;
};
picoc = callPackage ../development/interpreters/picoc {};
picolisp = callPackage ../development/interpreters/picolisp {};