Commit graph

402 commits

Author SHA1 Message Date
Maximilian Bosch af064a0e12
php7{2,3}: fix darwin build
* Backported patches from `php-7.4` which fixes the env for all
  `gettext` and `zlib` tests.
* Setting `--with-libxml-dir` is still needed for versions 7.2 and 7.3.
2020-06-25 22:29:23 +02:00
Christian Kauhaus 1d805c99bd php: 7.2.29 -> 7.2.31, 7.3.16 -> 7.3.19, 7.4.6 -> 7.4.7
Point releases contain several security updates and bugfixes.

Changelog: https://www.php.net/ChangeLog-7.php#7.4.7

Fixes #88381
2020-06-25 15:41:31 +02:00
John Ericson c1b9f86cdd php < 7.4: Fix validation of PKG_CONFIG var
They were assuming it is an absolute path, but it (conventionally) can
be something to look up on the PATH too.

Fixes #90202
2020-06-13 19:06:33 +00:00
talyz bfdc832aef
php.buildEnv: Let enabled extensions to pass through by default
If only extraConfig is specified in buildEnv, keep the currently
enabled extensions active. Brought up in #89011.
2020-05-29 00:32:12 +02:00
Elis Hirwing a779efcaa0
php74: 7.4.5 -> 7.4.6
Changelog: https://www.php.net/ChangeLog-7.php#7.4.6
2020-05-16 13:23:23 +02:00
Elis Hirwing 52d2e99182
php74: 7.4.4 -> 7.4.5
Changelog: https://www.php.net/ChangeLog-7.php#7.4.5
2020-05-15 22:10:03 +02:00
talyz 9f09253e52
php.buildPecl: Allow PECLs to depend on other PECLs
Some PECLs depend on other PECLs and, like internal PHP extension
dependencies, need to be loaded in the correct order. This makes this
possible by adding the argument "peclDeps" to buildPecl, which adds
the extension to buildInputs and is treated the same way as
internalDeps when the extension config is generated.
2020-05-09 23:38:21 +02:00
Luke Granger-Brown c13df548a3 php: override outputsToInstall when using withExtensions
At the moment, using .withExtensions on a PHP derivation will
produce something which can't be used inside an
environment.systemPackages array, because outputsToInstall refers
to an output which doesn't exist on the final derivation.

Instead, override it back to just containing the single output
"out".
2020-05-06 21:44:27 +01:00
Elis Hirwing 6d5b0b13f3
php: Set maintainer team as maintainers
Also passthrough the meta of the package to have description,
homepage, license, maintainers and other metadata passed through to
the commonly used attribute.
2020-04-29 20:11:40 +02:00
talyz 2535cdfe91
php: Unify the usage of the php package in php-packages.nix
Instead of using two different php packages in php-packages.nix, one
wrapper and one unwrapped, simply use the wrapper and use its
"unwrapped" attribute when necessary. Also, get rid of the packages
and extensions attributes from the base package, since they're no
longer needed.
2020-04-29 13:59:29 +02:00
talyz 5cad1b4aff
php: Get rid of the phpXXbase attributes, update docs
Since the introduction of php.unwrapped there's no real need for the
phpXXbase attributes, so let's remove them to lessen potential
confusion and clutter. Also update the docs to make it clear how to
get hold of an unwrapped PHP if needed.
2020-04-29 13:45:48 +02:00
talyz 3bfd4e864f
php: Add passthru.tests 2020-04-29 13:45:07 +02:00
talyz ef990961bc
php.buildEnv: Provide the unwrapped php package in php.unwrapped
This is useful if you need to access the dev output of the unwrapped
derivation.
2020-04-29 13:44:20 +02:00
talyz c3d5d92f4a
php.buildEnv: Add phpIni attribute for easy access to the php.ini 2020-04-29 12:12:59 +02:00
talyz d61040716e
php.buildEnv: Automatically include extension dependencies
Some extensions depend on other extensions. Previously, these had to
be added manually to the list of included extensions, or we got a
cryptic error message pointing to strings-with-deps.nix, which wasn't
very helpful. This makes sure all required extensions are included in
the set from which textClosureList chooses its snippets.
2020-04-26 16:43:29 +02:00
talyz 72636bc2f6
php: Get rid of all config.php parameters
Since all options controlled by the config.php parameters can now be
overridden directly, there's no reason to keep them around.
2020-04-26 16:43:23 +02:00
talyz 2ba7926959
php.buildEnv: Provide a list of currently enabled extensions
Rework withExtensions / buildEnv to handle currently enabled
extensions better and make them compatible with override. They now
accept a function with the named arguments enabled and all, where
enabled is a list of currently enabled extensions and all is the set
of all extensions. This gives us several nice properties:

 - You always get the right version of the list of currently enabled
   extensions

 - Invocations chain

 - It works well with overridden PHP packages - you always get the
   correct versions of extensions

As a contrived example of what's possible, you can add ImageMagick,
then override the version and disable fpm, then disable cgi, and
lastly remove the zip extension like this:

{ pkgs ? (import <nixpkgs>) {} }:
with pkgs;

let
  phpWithImagick = php74.withExtensions ({ all, enabled }: enabled ++ [ all.imagick ]);

  phpWithImagickWithoutFpm743 = phpWithImagick.override {
    version = "7.4.3";
    sha256 = "wVF7pJV4+y3MZMc6Ptx21PxQfEp6xjmYFYTMfTtMbRQ=";
    fpmSupport = false;
  };

  phpWithImagickWithoutFpmZip743 = phpWithImagickWithoutFpm743.withExtensions (
    { enabled, all }:
      lib.filter (e: e != all.zip) enabled);

  phpWithImagickWithoutFpmZipCgi743 = phpWithImagickWithoutFpmZip743.override {
    cgiSupport = false;
  };
in
  phpWithImagickWithoutFpmZipCgi743
2020-04-26 16:43:05 +02:00
talyz abedfadd73
php.buildEnv: Respect override
Make buildEnv take earlier overridden values into account by
forwarding all arguments (a merge of generic's arguments, all previous
arguments and the current arguments) to the next invocation of
buildEnv.
2020-04-24 18:48:29 +02:00
talyz dde5f5f899
php: Make all arguments to a PHP build overridable
Make all arguments to a PHP build overridable; i.e, both configuration
flags, such as valgrindSupport, and packages, such as valgrind:

php.override { valgrindSupport = false; valgrind = valgrind-light; }

This applies to packages built by generic and buildEnv/withExtensions;
i.e, it works with both phpXX and phpXXBase packages.

The following changes were also made to facilitate this:

 - generic and generic' are merged into one function

 - generic now takes all required arguments for a complete build and
   is meant to be called by callPackage

 - The main function called from all-packages.nix no longer takes all
   required arguments for a complete build - all arguments passed to it
   are however forwarded to the individual builds, thus default
   arguments can still be overridden from all-packages.nix
2020-04-24 18:41:53 +02:00
talyz a463261415
php.buildEnv: Make the exported php package overridable
This implements the override pattern for builds done with buildEnv, so
that we can, for example, write

php.override { fpmSupport = false; }

and get a PHP package with the default extensions enabled, but PHP
compiled without fpm support.
2020-04-24 13:05:37 +02:00
talyz 472d5c187b
php.buildEnv: Don't inherit dev from the original php
mkDerivation uses the dev output in buildInputs if it exits, hence the
php-with-extensions package was never built or put into the path of
packages dependent on it during build. With this fix, the php packages
built with buildEnv or withExtensions don't have any dev outputs;
packages which need the dev output can refer to the phpXXbase packages
instead.
2020-04-08 15:13:07 +02:00
Elis Hirwing 8272ebe961
php72: 7.2.28 -> 7.2.29
Changelog: https://www.php.net/ChangeLog-7.php#7.2.29
2020-04-05 22:22:40 +02:00
Elis Hirwing 1118080dc0
php73: 7.3.15 -> 7.3.16
Changelog: https://www.php.net/ChangeLog-7.php#7.3.16
2020-04-05 22:22:26 +02:00
Elis Hirwing faf79b6384
php74: 7.4.3 -> 7.4.4
Changelog: https://www.php.net/ChangeLog-7.php#7.4.4
2020-04-05 22:05:16 +02:00
talyz ca8b8a26e9
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 ])
2020-04-05 16:46:38 +02:00
talyz b4d289a7ae
php: Add missing hash extension to php < 7.4 2020-04-05 16:45:53 +02:00
talyz 1345e5b763
php: Add withExtensions as a simpler alternative to buildEnv 2020-04-05 16:45:47 +02:00
talyz 4ff523f691
php: Simplify php-packages import, rename exts -> extensions 2020-04-05 16:45:41 +02:00
Elis Hirwing 1b69056e46
php: passthru .dev output as well 2020-04-05 16:45:23 +02:00
Elis Hirwing a2099156ec
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.
2020-04-05 16:45:17 +02:00
Elis Hirwing 0dc95728ba
nixos/php: Move the pcre tests to the php test attribute 2020-04-05 16:44:59 +02:00
talyz 716fd0e2f5
php.buildEnv: Put the extraConfig snippet after extensions
Make sure all the extensions are loaded first, then read the custom
config where possible.
2020-04-05 16:44:31 +02:00
Elis Hirwing 82cd2fbbf4
php: Wrap the programs and provide an environment variable instead of a flag 2020-04-05 16:44:25 +02:00
talyz 90dcab948c
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.
2020-04-05 16:44:01 +02:00
talyz b1106a1851
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.
2020-04-05 16:43:50 +02:00
talyz 8924a7de3d
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.
2020-04-03 10:11:15 +02:00
talyz 282337799b
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.
2020-04-03 10:11:13 +02:00
Elis Hirwing 96a5e0c928
php: init phpXYbase packages and make the default php extended by default
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
2020-03-31 22:06:45 +02:00
Elis Hirwing 9404daf91c
php: Make a slimmer php as default 2020-03-29 11:06:58 +02:00
Elis Hirwing f1dfb6e0f5
php: get rid of with lib; used on entire file 2020-03-15 18:04:57 +01:00
Elis Hirwing 6100ac4ab2
php: remove unsupported options
- mcrypt was removed in 7.2
 - mhash was integrated into hash in 7.0
2020-03-15 18:04:25 +01:00
Elis Hirwing da3384a25d
php: Re-indent main derivation 2020-03-15 10:27:37 +01:00
Elis Hirwing 5bf47ab9bb
php72: 7.2.27 -> 7.2.28
Changelog: https://www.php.net/ChangeLog-7.php#7.2.28
2020-03-11 20:13:56 +01:00
Elis Hirwing 8f4cb37116
php73: 7.3.14 -> 7.3.15
Changelog: https://www.php.net/ChangeLog-7.php#7.3.15
2020-03-11 20:12:34 +01:00
Maximilian Bosch 0bf5619fe0
php: add buildEnv function for additional config on the CLI SAPI
Initially discussed in #55460.

This patch adds a `buildEnv` function to `php` that has the
following features:

* `php.buildEnv { extraConfig = /* ... */; }` to specify custom
  `php.ini` args for the CLI.

* `php.buildEnv { exts = phpPackages: [phpPackages.apcu] }` to
  create a PHP interpreter for the CLI with the `apcu` extension.
2020-03-09 20:41:28 +01:00
Jan Tojnar 88b22b6890
php74: 7.4.2 → 7.4.3
https://github.com/php/php-src/blob/php-7.4.3/NEWS#L3-L90
2020-03-04 20:22:15 +01:00
Izorkin ffe90532f7 php: update build configuration 2020-02-22 11:22:05 +03:00
Izorkin 0ee5d55d3b php: use external GD library 2020-02-22 11:22:05 +03:00
Izorkin ac3c11a980 php: add option pearSupport 2020-02-22 11:22:05 +03:00
Izorkin a74fb5a1af php: add option ipv6Support 2020-02-22 11:22:05 +03:00