Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 35c0d9da9bff
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3b6539896b07
Choose a head ref

Commits on Mar 29, 2020

  1. Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    dtzWill Will Dietz
    Copy the full SHA
    9404daf View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    cb1dd64 View commit details
  3. Copy the full SHA
    cdad5f9 View commit details

Commits on Mar 31, 2020

  1. php: init phpXYbase packages and make the default php extended by def…

    …ault
    
    Also, add opcache to default extensions since it significantly
    increases PHP's performance and is by default enabled on Debian based
    distributions. Not having it enabled by default results in a puzzling
    performance loss for anyone attempting to migrate from Debian/Ubuntu
    to NixOS who is unaware of this. Therefore, enable it by default. /talyz
    etu authored and talyz committed Mar 31, 2020
    Copy the full SHA
    96a5e0c View commit details
  2. unit: Make unit use phpbase packages

    etu authored and talyz committed Mar 31, 2020
    Copy the full SHA
    1983417 View commit details

Commits on Apr 3, 2020

  1. Copy the full SHA
    be7bf5a View commit details
  2. Copy the full SHA
    a5f77d6 View commit details
  3. Copy the full SHA
    da8ca2b View commit details
  4. php: Build an even slimmer base

    This moves yet more extensions from the base build to
    phpPackages.ext. Some of the extensions are a bit quirky and need
    patching for this to work, most notably mysqlnd and opcache.
    
    Two new parameters are introduced for mkExtension - internalDeps and
    postPhpize. internalDeps is used to specify which other internal
    extensions the current extension depends on, in order to provide them
    at build time. postPhpize is for when patches and quirks need to be
    applied after running phpize.
    
    Patch notes:
    
    - For opcache, older versions of PHP have a bug where header files are
      included in the wrong order.
    
    - For mysqlnd, the config.h is never included, so we include it in the
      main header file, mysqlnd.h. Also, the configure script doesn't add
      the necessary library link flags, so we add them to the variable
      configure should have added them to.
    talyz authored and etu committed Apr 3, 2020
    Copy the full SHA
    2823377 View commit details
  5. phpPackages.exts: Run tests by default

    The tests for many of the extensions run just fine, for some a small
    portion fail. This runs the tests by default and disables the tests
    extensions with any failing tests.
    talyz authored and etu committed Apr 3, 2020
    Copy the full SHA
    6c810c2 View commit details
  6. php: Make buildEnv recursive + take extension deps into account

    A slight rewrite of buildEnv which:
    
    1. Makes buildEnv recursively add itself to its output, so that it can
       be accessed from any php derivation.
    
    2. Orders the extension text strings according to their internalDeps
       attribute - dependencies have to be put before dependants in the
       php.ini or they will fail to load due to missing symbols.
    talyz authored and etu committed Apr 3, 2020
    Copy the full SHA
    8924a7d View commit details

Commits on Apr 5, 2020

  1. Copy the full SHA
    14bfb84 View commit details
  2. phpPackages: Move phpPackages to php.packages

    This means php packages can now refer to other php packages by looking
    them up in the php.packages attribute and gets rid of the internal
    recursive set previously defined in php-packages.nix. This also means
    that in applications where previously both the php package and the
    corresponding version of the phpPackages package set had to be
    specified, the php package will now suffice.
    
    This also adds the phpWithExtensions parameter to the
    php-packages.nix, which can be used by extensions that need a fully
    featured PHP executable.
    talyz committed Apr 5, 2020
    Copy the full SHA
    b1106a1 View commit details
  3. php.packages: Use derivations for internalDeps in mkExtension

    Make mkExtension put headers in the dev output and use them, instead of
    a different part of the current source tree, when referring to another
    extension by using internalDeps.
    
    This means external extensions can be built against the internal ones.
    talyz committed Apr 5, 2020
    Copy the full SHA
    90dcab9 View commit details
  4. php.packages.buildPecl: Introduce built-in extension dependencies

    Introduce the internalDeps attribute used by mkExtension, to refer to
    internal php extensions built by mkExtension.
    talyz committed Apr 5, 2020
    Copy the full SHA
    9ac0d9a View commit details
  5. Copy the full SHA
    82cd2fb View commit details
  6. php.buildEnv: Put the extraConfig snippet after extensions

    Make sure all the extensions are loaded first, then read the custom
    config where possible.
    talyz committed Apr 5, 2020
    Copy the full SHA
    716fd0e View commit details
  7. php.packages: Fix and clean up external extensions

    Fix extensions that were broken by the extension refactoring and
    remove pthreads and pinba, which had asserts which broke evaluation,
    were in need of refactoring and of dubious value.
    talyz committed Apr 5, 2020
    Copy the full SHA
    fe4d173 View commit details
  8. Copy the full SHA
    ed20aae View commit details
  9. nixos/nextcloud: upgrade to php74

    etu authored and talyz committed Apr 5, 2020
    Copy the full SHA
    fc1034a View commit details
  10. nixos/php: Add tests for phpfpm

    This test checks that we evaluate PHP properly and that certain
    extensions are actually loaded.
    etu authored and talyz committed Apr 5, 2020
    Copy the full SHA
    29e1f0d View commit details
  11. Copy the full SHA
    0dc9572 View commit details
  12. doc/php: Add initial documentation for PHP

    etu authored and talyz committed Apr 5, 2020
    Copy the full SHA
    e4cee80 View commit details
  13. Copy the full SHA
    a4bc30c View commit details
  14. php: split php.packages to php.packages and php.extensions

    So now we have only packages for human interaction in php.packages and
    only extensions in php.extensions. With this php.packages.exts have
    been merged into the same attribute set as all the other extensions to
    make it flat and nice.
    
    The nextcloud module have been updated to reflect this change as well
    as the documentation.
    etu authored and talyz committed Apr 5, 2020
    Copy the full SHA
    a209915 View commit details
  15. php: passthru .dev output as well

    etu authored and talyz committed Apr 5, 2020
    Copy the full SHA
    1b69056 View commit details
  16. Copy the full SHA
    4ff523f View commit details
  17. Copy the full SHA
    1345e5b View commit details
  18. Copy the full SHA
    b4d289a View commit details
  19. Copy the full SHA
    b5c59ce View commit details
  20. Copy the full SHA
    102aac6 View commit details
  21. Copy the full SHA
    8d2e5d5 View commit details
  22. php: Add enabledExtensions attribute to PHP derivations

    This provides a means to build a PHP package based on a list of
    extensions from another.
    
    For example, to generate a package with all default extensions
    enabled, except opcache, but with ImageMagick:
    
    php.withExtensions (e:
      (lib.filter (e: e != php.extensions.opcache) php.enabledExtensions)
      ++ [ e.imagick ])
    talyz committed Apr 5, 2020
    Copy the full SHA
    ca8b8a2 View commit details
  23. Copy the full SHA
    5ace72c View commit details
  24. Merge pull request #83896 from etu/slim-down-default-php-v3

    PHP: Make the default package more sane [v3]
    etu authored Apr 5, 2020
    Copy the full SHA
    3b65398 View commit details
7 changes: 4 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -178,6 +178,7 @@
/nixos/tests/prometheus-exporters.nix @WilliButz

# PHP
/pkgs/development/interpreters/php @etu
/pkgs/top-level/php-packages.nix @etu
/pkgs/build-support/build-pecl.nix @etu
/doc/languages-frameworks/php.section.md @etu
/pkgs/development/interpreters/php @etu
/pkgs/top-level/php-packages.nix @etu
/pkgs/build-support/build-pecl.nix @etu
112 changes: 112 additions & 0 deletions doc/languages-frameworks/php.section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# PHP

## User Guide

### Using PHP

#### Overview

Several versions of PHP are available on Nix, each of which having a
wide variety of extensions and libraries available.

The attribute `php` refers to the version of PHP considered most
stable and thoroughly tested in nixpkgs for any given release of
NixOS. Note that while this version of PHP may not be the latest major
release from upstream, any version of PHP supported in nixpkgs may be
utilized by specifying the desired attribute by version, such as
`php74`.

Only versions of PHP that are supported by upstream for the entirety
of a given NixOS release will be included in that release of
NixOS. See [PHP Supported
Versions](https://www.php.net/supported-versions.php).

Interactive tools built on PHP are put in `php.packages`; composer is
for example available at `php.packages.composer`.

Most extensions that come with PHP, as well as some popular
third-party ones, are available in `php.extensions`; for example, the
opcache extension shipped with PHP is available at
`php.extensions.opcache` and the third-party ImageMagick extension at
`php.extensions.imagick`.

The different versions of PHP that nixpkgs provides is located under
attributes named based on major and minor version number; e.g.,
`php74` is PHP 7.4 with commonly used extensions installed,
`php74base` is the same PHP runtime without extensions.

#### Installing PHP with packages

A PHP package with specific extensions enabled can be built using
`php.withExtensions`. This is a function which accepts an anonymous
function as its only argument; the function should take one argument,
the set of all extensions, and return a list of wanted extensions. For
example, a PHP package with the opcache and ImageMagick extensions
enabled:

```nix
php.withExtensions (e: with e; [ imagick opcache ])
```

Note that this will give you a package with _only_ opcache and
ImageMagick, none of the other extensions which are enabled by default
in the `php` package will be available.

To enable building on a previous PHP package, the currently enabled
extensions are made available in its `enabledExtensions`
attribute. For example, to generate a package with all default
extensions enabled, except opcache, but with ImageMagick:

```nix
php.withExtensions (e:
(lib.filter (e: e != php.extensions.opcache) php.enabledExtensions)
++ [ e.imagick ])
```

If you want a PHP build with extra configuration in the `php.ini`
file, you can use `php.buildEnv`. This function takes two named and
optional parameters: `extensions` and `extraConfig`. `extensions`
takes an extension specification equivalent to that of
`php.withExtensions`, `extraConfig` a string of additional `php.ini`
configuration parameters. For example, a PHP package with the opcache
and ImageMagick extensions enabled, and `memory_limit` set to `256M`:

```nix
php.buildEnv {
extensions = e: with e; [ imagick opcache ];
extraConfig = "memory_limit=256M";
}
```

##### Example setup for `phpfpm`

You can use the previous examples in a `phpfpm` pool called `foo` as
follows:

```nix
let
myPhp = php.withExtensions (e: with e; [ imagick opcache ]);
in {
services.phpfpm.pools."foo".phpPackage = myPhp;
};
```

```nix
let
myPhp = php.buildEnv {
extensions = e: with e; [ imagick opcache ];
extraConfig = "memory_limit=256M";
};
in {
services.phpfpm.pools."foo".phpPackage = myPhp;
};
```

##### Example usage with `nix-shell`

This brings up a temporary environment that contains a PHP interpreter
with the extensions `imagick` and `opcache` enabled.

```sh
nix-shell -p 'php.buildEnv { extensions = e: with e; [ imagick opcache ]; }'
```
67 changes: 67 additions & 0 deletions nixos/doc/manual/release-notes/rl-2009.xml
Original file line number Diff line number Diff line change
@@ -128,6 +128,73 @@
documentation for instructions.
</para>
</listitem>
<listitem>
<para>
Since this release there's an easy way to customize your PHP install to get a much smaller
base PHP with only wanted extensions enabled. See the following snippet installing a smaller PHP
with the extensions <literal>imagick</literal>, <literal>opcache</literal> and
<literal>pdo_mysql</literal> loaded:

<programlisting>
environment.systemPackages = [
(pkgs.php.buildEnv { extensions = pp: with pp; [
imagick
opcache
pdo_mysql
]; })
];</programlisting>

The default <literal>php</literal> attribute hasn't lost any extensions -
the <literal>opcache</literal> extension was added there.

All upstream PHP extensions are available under <package><![CDATA[php.extensions.<name?>]]></package>.
</para>
<para>
The updated <literal>php</literal> attribute is now easily customizable to your liking
by using extensions instead of writing config files or changing configure flags.

Therefore we have removed the following configure flags:

<itemizedlist>
<title>PHP <literal>config</literal> flags that we don't read anymore:</title>
<listitem><para><literal>config.php.argon2</literal></para></listitem>
<listitem><para><literal>config.php.bcmath</literal></para></listitem>
<listitem><para><literal>config.php.bz2</literal></para></listitem>
<listitem><para><literal>config.php.calendar</literal></para></listitem>
<listitem><para><literal>config.php.curl</literal></para></listitem>
<listitem><para><literal>config.php.exif</literal></para></listitem>
<listitem><para><literal>config.php.ftp</literal></para></listitem>
<listitem><para><literal>config.php.gd</literal></para></listitem>
<listitem><para><literal>config.php.gettext</literal></para></listitem>
<listitem><para><literal>config.php.gmp</literal></para></listitem>
<listitem><para><literal>config.php.imap</literal></para></listitem>
<listitem><para><literal>config.php.intl</literal></para></listitem>
<listitem><para><literal>config.php.ldap</literal></para></listitem>
<listitem><para><literal>config.php.libxml2</literal></para></listitem>
<listitem><para><literal>config.php.libzip</literal></para></listitem>
<listitem><para><literal>config.php.mbstring</literal></para></listitem>
<listitem><para><literal>config.php.mysqli</literal></para></listitem>
<listitem><para><literal>config.php.mysqlnd</literal></para></listitem>
<listitem><para><literal>config.php.openssl</literal></para></listitem>
<listitem><para><literal>config.php.pcntl</literal></para></listitem>
<listitem><para><literal>config.php.pdo_mysql</literal></para></listitem>
<listitem><para><literal>config.php.pdo_odbc</literal></para></listitem>
<listitem><para><literal>config.php.pdo_pgsql</literal></para></listitem>
<listitem><para><literal>config.php.phpdbg</literal></para></listitem>
<listitem><para><literal>config.php.postgresql</literal></para></listitem>
<listitem><para><literal>config.php.readline</literal></para></listitem>
<listitem><para><literal>config.php.soap</literal></para></listitem>
<listitem><para><literal>config.php.sockets</literal></para></listitem>
<listitem><para><literal>config.php.sodium</literal></para></listitem>
<listitem><para><literal>config.php.sqlite</literal></para></listitem>
<listitem><para><literal>config.php.tidy</literal></para></listitem>
<listitem><para><literal>config.php.xmlrpc</literal></para></listitem>
<listitem><para><literal>config.php.xsl</literal></para></listitem>
<listitem><para><literal>config.php.zip</literal></para></listitem>
<listitem><para><literal>config.php.zlib</literal></para></listitem>
</itemizedlist>
</para>
</listitem>
</itemizedlist>
</section>

24 changes: 12 additions & 12 deletions nixos/modules/services/web-apps/nextcloud.nix
Original file line number Diff line number Diff line change
@@ -6,27 +6,28 @@ let
cfg = config.services.nextcloud;
fpm = config.services.phpfpm.pools.nextcloud;

phpPackage = pkgs.php73;
phpPackages = pkgs.php73Packages;
phpPackage =
let
base = pkgs.php74;
in
base.buildEnv {
extensions = e: with e;
base.enabledExtensions ++ [
apcu redis memcached imagick
];
extraConfig = phpOptionsStr;
};

toKeyValue = generators.toKeyValue {
mkKeyValue = generators.mkKeyValueDefault {} " = ";
};

phpOptionsExtensions = ''
${optionalString cfg.caching.apcu "extension=${phpPackages.apcu}/lib/php/extensions/apcu.so"}
${optionalString cfg.caching.redis "extension=${phpPackages.redis}/lib/php/extensions/redis.so"}
${optionalString cfg.caching.memcached "extension=${phpPackages.memcached}/lib/php/extensions/memcached.so"}
extension=${phpPackages.imagick}/lib/php/extensions/imagick.so
zend_extension = opcache.so
opcache.enable = 1
'';
phpOptions = {
upload_max_filesize = cfg.maxUploadSize;
post_max_size = cfg.maxUploadSize;
memory_limit = cfg.maxUploadSize;
} // cfg.phpOptions;
phpOptionsStr = phpOptionsExtensions + (toKeyValue phpOptions);
phpOptionsStr = toKeyValue phpOptions;

occ = pkgs.writeScriptBin "nextcloud-occ" ''
#! ${pkgs.stdenv.shell}
@@ -38,7 +39,6 @@ let
export NEXTCLOUD_CONFIG_DIR="${cfg.home}/config"
$sudo \
${phpPackage}/bin/php \
-c ${pkgs.writeText "php.ini" phpOptionsStr}\
occ $*
'';

2 changes: 1 addition & 1 deletion nixos/release-combined.nix
Original file line number Diff line number Diff line change
@@ -112,7 +112,7 @@ in rec {
"nixos.tests.nfs4.simple.x86_64-linux"
"nixos.tests.openssh.x86_64-linux"
"nixos.tests.pantheon.x86_64-linux"
"nixos.tests.php-pcre.x86_64-linux"
"nixos.tests.php.x86_64-linux"
"nixos.tests.plasma5.x86_64-linux"
"nixos.tests.predictable-interface-names.predictableNetworkd.x86_64-linux"
"nixos.tests.predictable-interface-names.predictable.x86_64-linux"
4 changes: 2 additions & 2 deletions nixos/release-small.nix
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ in rec {
nat
nfs3
openssh
php-pcre
php
predictable-interface-names
proxy
simple;
@@ -108,7 +108,7 @@ in rec {
"nixos.tests.nat.standalone.x86_64-linux"
"nixos.tests.nfs3.simple.x86_64-linux"
"nixos.tests.openssh.x86_64-linux"
"nixos.tests.php-pcre.x86_64-linux"
"nixos.tests.php.x86_64-linux"
"nixos.tests.predictable-interface-names.predictable.x86_64-linux"
"nixos.tests.predictable-interface-names.predictableNetworkd.x86_64-linux"
"nixos.tests.predictable-interface-names.unpredictable.x86_64-linux"
2 changes: 1 addition & 1 deletion nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
@@ -241,7 +241,7 @@ in
peerflix = handleTest ./peerflix.nix {};
pgjwt = handleTest ./pgjwt.nix {};
pgmanage = handleTest ./pgmanage.nix {};
php-pcre = handleTest ./php-pcre.nix {};
php = handleTest ./php {};
plasma5 = handleTest ./plasma5.nix {};
plotinus = handleTest ./plotinus.nix {};
postgis = handleTest ./postgis.nix {};
7 changes: 7 additions & 0 deletions nixos/tests/php/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../../.. { inherit system config; }
}: {
fpm = import ./fpm.nix { inherit system pkgs; };
pcre = import ./pcre.nix { inherit system pkgs; };
}
55 changes: 55 additions & 0 deletions nixos/tests/php/fpm.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import ../make-test-python.nix ({pkgs, ...}: {
name = "php-fpm-nginx-test";
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ etu ];

machine = { config, lib, pkgs, ... }: {
services.nginx = {
enable = true;

virtualHosts."phpfpm" = let
testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();";
in {
root = "${testdir}/web";
locations."~ \.php$".extraConfig = ''
fastcgi_pass unix:${config.services.phpfpm.pools.foobar.socket};
fastcgi_index index.php;
include ${pkgs.nginx}/conf/fastcgi_params;
include ${pkgs.nginx}/conf/fastcgi.conf;
'';
locations."/" = {
tryFiles = "$uri $uri/ index.php";
index = "index.php index.html index.htm";
};
};
};

services.phpfpm.pools."foobar" = {
user = "nginx";
settings = {
"listen.group" = "nginx";
"listen.mode" = "0600";
"listen.owner" = "nginx";
"pm" = "dynamic";
"pm.max_children" = 5;
"pm.max_requests" = 500;
"pm.max_spare_servers" = 3;
"pm.min_spare_servers" = 1;
"pm.start_servers" = 2;
};
};
};
testScript = { ... }: ''
machine.wait_for_unit("nginx.service")
machine.wait_for_unit("phpfpm-foobar.service")
# Check so we get an evaluated PHP back
assert "PHP Version ${pkgs.php.version}" in machine.succeed("curl -vvv -s http://127.0.0.1:80/")
# Check so we have database and some other extensions loaded
assert "json" in machine.succeed("curl -vvv -s http://127.0.0.1:80/")
assert "opcache" in machine.succeed("curl -vvv -s http://127.0.0.1:80/")
assert "pdo_mysql" in machine.succeed("curl -vvv -s http://127.0.0.1:80/")
assert "pdo_pgsql" in machine.succeed("curl -vvv -s http://127.0.0.1:80/")
assert "pdo_sqlite" in machine.succeed("curl -vvv -s http://127.0.0.1:80/")
'';
})
31 changes: 14 additions & 17 deletions nixos/tests/php-pcre.nix → nixos/tests/php/pcre.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

let testString = "can-use-subgroups"; in

import ./make-test-python.nix ({ ...}: {
let
testString = "can-use-subgroups";
in import ../make-test-python.nix ({ ...}: {
name = "php-httpd-pcre-jit-test";
machine = { lib, pkgs, ... }: {
time.timeZone = "UTC";
@@ -10,15 +9,13 @@ import ./make-test-python.nix ({ ...}: {
adminAddr = "please@dont.contact";
enablePHP = true;
phpOptions = "pcre.jit = true";
extraConfig =
let
extraConfig = let
testRoot = pkgs.writeText "index.php"
''
<?php
''
<?php
preg_match('/(${testString})/', '${testString}', $result);
var_dump($result);
?>
'';
'';
in
''
Alias / ${testRoot}/
@@ -30,11 +27,11 @@ import ./make-test-python.nix ({ ...}: {
};
};
testScript = { ... }:
''
machine.wait_for_unit("httpd.service")
# Ensure php evaluation by matching on the var_dump syntax
assert 'string(${toString (builtins.stringLength testString)}) "${testString}"' in machine.succeed(
"curl -vvv -s http://127.0.0.1:80/index.php"
)
'';
''
machine.wait_for_unit("httpd.service")
# Ensure php evaluation by matching on the var_dump syntax
assert 'string(${toString (builtins.stringLength testString)}) "${testString}"' in machine.succeed(
"curl -vvv -s http://127.0.0.1:80/index.php"
)
'';
})
12 changes: 10 additions & 2 deletions pkgs/build-support/build-pecl.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{ stdenv, php, autoreconfHook, fetchurl, re2c }:
{ stdenv, lib, php, autoreconfHook, fetchurl, re2c }:

{ pname
, version
, internalDeps ? []
, buildInputs ? []
, nativeBuildInputs ? []
, postPhpize ? ""
, makeFlags ? []
, src ? fetchurl {
url = "http://pecl.php.net/get/${pname}-${version}.tgz";
@@ -22,5 +24,11 @@ stdenv.mkDerivation (args // {

makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags;

autoreconfPhase = "phpize";
autoreconfPhase = ''
phpize
${postPhpize}
${lib.concatMapStringsSep "\n"
(dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
internalDeps}
'';
})
363 changes: 164 additions & 199 deletions pkgs/development/interpreters/php/default.nix

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions pkgs/servers/http/unit/default.nix
Original file line number Diff line number Diff line change
@@ -16,7 +16,19 @@

with stdenv.lib;

stdenv.mkDerivation rec {
let
phpConfig = {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};

php72-unit = php72.override phpConfig;
php73-unit = php73.override phpConfig;
in stdenv.mkDerivation rec {
version = "1.16.0";
pname = "unit";

@@ -37,8 +49,8 @@ stdenv.mkDerivation rec {
buildInputs = [ ]
++ optional withPython2 python2
++ optionals withPython3 [ python3 ncurses ]
++ optional withPHP72 php72
++ optional withPHP73 php73
++ optional withPHP72 php72-unit
++ optional withPHP73 php73-unit
++ optional withPerl528 perl528
++ optional withPerl530 perl530
++ optional withPerldevel perldevel
@@ -59,8 +71,8 @@ stdenv.mkDerivation rec {
postConfigure = ''
${optionalString withPython2 "./configure python --module=python2 --config=${python2}/bin/python2-config --lib-path=${python2}/lib"}
${optionalString withPython3 "./configure python --module=python3 --config=${python3}/bin/python3-config --lib-path=${python3}/lib"}
${optionalString withPHP72 "./configure php --module=php72 --config=${php72.dev}/bin/php-config --lib-path=${php72}/lib"}
${optionalString withPHP73 "./configure php --module=php73 --config=${php73.dev}/bin/php-config --lib-path=${php73}/lib"}
${optionalString withPHP72 "./configure php --module=php72 --config=${php72-unit.dev}/bin/php-config --lib-path=${php72-unit}/lib"}
${optionalString withPHP73 "./configure php --module=php73 --config=${php73-unit.dev}/bin/php-config --lib-path=${php73-unit}/lib"}
${optionalString withPerl528 "./configure perl --module=perl528 --perl=${perl528}/bin/perl"}
${optionalString withPerl530 "./configure perl --module=perl530 --perl=${perl530}/bin/perl"}
${optionalString withPerldevel "./configure perl --module=perldev --perl=${perldevel}/bin/perl"}
9 changes: 7 additions & 2 deletions pkgs/servers/uwsgi/default.nix
Original file line number Diff line number Diff line change
@@ -4,10 +4,15 @@
, pam, withPAM ? stdenv.isLinux
, systemd, withSystemd ? stdenv.isLinux
, python2, python3, ncurses
, ruby, php-embed, libmysqlclient
, ruby, php, libmysqlclient
}:

let pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" {
let php-embed = php.override {
config.php.embed = true;
config.php.apxs2 = false;
};

pythonPlugin = pkg : lib.nameValuePair "python${if pkg.isPy2 then "2" else "3"}" {
interpreter = pkg.interpreter;
path = "plugins/python";
inputs = [ pkg ncurses ];
49 changes: 49 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
@@ -322,6 +322,55 @@ mapAliases ({
perlArchiveCpio = perlPackages.ArchiveCpio; # added 2018-10-12
pgp-tools = signing-party; # added 2017-03-26
pg_tmp = ephemeralpg; # added 2018-01-16

php-embed = throw ''
php*-embed has been dropped, you can build the same package by using
something similar with this following snippet:
(php74.override { config.php.embed = true; config.php.apxs2 = false; })
''; # added 2020-04-01
php72-embed = php-embed; # added 2020-04-01
php73-embed = php-embed; # added 2020-04-01
php74-embed = php-embed; # added 2020-04-01

phpPackages-embed = throw ''
php*Packages-embed has been dropped, you can build the same package by using
something similar with this following snippet:
(php74.override { config.php.embed = true; config.php.apxs2 = false; }).packages
''; # added 2020-04-01
php74Packages-embed = phpPackages-embed;
php73Packages-embed = phpPackages-embed;
php72Packages-embed = phpPackages-embed;

php-unit = throw ''
php*-unit has been dropped, you can build the same package by using
something similar with this following snippet:
(php74.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false; })
''; # added 2020-04-01
php72-unit = php-unit; # added 2020-04-01
php73-unit = php-unit; # added 2020-04-01
php74-unit = php-unit; # added 2020-04-01

phpPackages-unit = throw ''
php*Packages-unit has been dropped, you can build the same package by using
something similar with this following snippet:
(php74.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false; }).packages
''; # added 2020-04-01
php74Packages-unit = phpPackages-unit;
php73Packages-unit = phpPackages-unit;
php72Packages-unit = phpPackages-unit;

pidgin-with-plugins = pidgin; # added 2016-06
pidginlatex = pidgin-latex; # added 2018-01-08
pidginlatexSF = pidgin-latex; # added 2014-11-02
89 changes: 10 additions & 79 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -9391,86 +9391,20 @@ in
pachyderm = callPackage ../applications/networking/cluster/pachyderm { };

php = php74;
phpPackages = php74Packages;

php72Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php72;
});

php73Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php73;
});

php74Packages = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php74;
});

phpPackages-unit = php74Packages-unit;

php72Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php72-unit;
});
phpPackages = php74Packages;
php72Packages = recurseIntoAttrs php72.packages;
php73Packages = recurseIntoAttrs php73.packages;
php74Packages = recurseIntoAttrs php74.packages;

php73Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php73-unit;
});

php74Packages-unit = recurseIntoAttrs (callPackage ./php-packages.nix {
php = php74-unit;
});
phpExtensions = php74Extensions;
php72Extensions = recurseIntoAttrs php72.extensions;
php73Extensions = recurseIntoAttrs php73.extensions;
php74Extensions = recurseIntoAttrs php74.extensions;

inherit (callPackages ../development/interpreters/php {
stdenv = if stdenv.cc.isClang then llvmPackages_6.stdenv else stdenv;
})
php74
php73
php72;

php-embed = php74-embed;

php72-embed = php72.override {
config.php.embed = true;
config.php.apxs2 = false;
};

php73-embed = php73.override {
config.php.embed = true;
config.php.apxs2 = false;
};

php74-embed = php74.override {
config.php.embed = true;
config.php.apxs2 = false;
};

php-unit = php74-unit;

php72-unit = php72.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};

php73-unit = php73.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};

php74-unit = php74.override {
config.php.embed = true;
config.php.apxs2 = false;
config.php.systemd = false;
config.php.phpdbg = false;
config.php.cgi = false;
config.php.fpm = false;
};
}) php74 php73 php72 php74base php73base php72base;

picoc = callPackage ../development/interpreters/picoc {};

@@ -15641,10 +15575,7 @@ in

neard = callPackage ../servers/neard { };

unit = callPackage ../servers/http/unit {
php72 = php72-unit;
php73 = php73-unit;
};
unit = callPackage ../servers/http/unit { };

nginx = nginxStable;

1,352 changes: 749 additions & 603 deletions pkgs/top-level/php-packages.nix

Large diffs are not rendered by default.