diff options
author | talyz <kim.lindberger@gmail.com> | 2020-03-24 19:30:18 +0100 |
---|---|---|
committer | Elis Hirwing <elis@hirwing.se> | 2020-04-03 10:11:13 +0200 |
commit | 282337799b08844c145c295110f20025541f829a (patch) | |
tree | 5ef0cedc3b2d1d767fddbf5c99478003e3789eff /pkgs/development/interpreters/php | |
parent | da8ca2be2ffd5964684fa81b953f933c9beaa7ed (diff) | |
download | nixlib-282337799b08844c145c295110f20025541f829a.tar nixlib-282337799b08844c145c295110f20025541f829a.tar.gz nixlib-282337799b08844c145c295110f20025541f829a.tar.bz2 nixlib-282337799b08844c145c295110f20025541f829a.tar.lz nixlib-282337799b08844c145c295110f20025541f829a.tar.xz nixlib-282337799b08844c145c295110f20025541f829a.tar.zst nixlib-282337799b08844c145c295110f20025541f829a.zip |
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.
Diffstat (limited to 'pkgs/development/interpreters/php')
-rw-r--r-- | pkgs/development/interpreters/php/default.nix | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 1e5c2cd8f270..f23ebd67eaad 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -1,8 +1,8 @@ # pcre functionality is tested in nixos/tests/php-pcre.nix -{ callPackage, config, fetchurl, lib, makeWrapper, stdenv, symlinkJoin, writeText -, autoconf, automake, bison, flex, libtool, pkgconfig, re2c -, apacheHttpd, gettext, libargon2, libxml2, openssl, pcre, pcre2, readline -, sqlite, systemd, valgrind, zlib, oniguruma }: +{ callPackage, config, fetchurl, lib, makeWrapper, stdenv, symlinkJoin +, writeText , autoconf, automake, bison, flex, libtool, pkgconfig, re2c +, apacheHttpd, libargon2, libxml2, pcre, pcre2 , systemd, valgrind +}: let generic = @@ -10,9 +10,6 @@ let , sha256 , extraPatches ? [] - # Build a minimal php - , minimalBuild ? config.php.minimal or false - # Sapi flags , cgiSupport ? config.php.cgi or true , cliSupport ? config.php.cli or true @@ -42,17 +39,9 @@ let nativeBuildInputs = [ autoconf automake bison flex libtool pkgconfig re2c ]; - buildInputs = [ ] - # Deps for some base extensions - ++ [ gettext ] # Gettext extension - ++ [ openssl openssl.dev ] # Openssl extension - ++ [ pcre' ] # PCRE extension - ++ [ readline ] # Readline extension - ++ [ zlib ] # Zlib extension - ++ [ oniguruma ] # mbstring extension - - # Deps needed when building all default extensions - ++ lib.optionals (!minimalBuild) [ sqlite ] + buildInputs = + # PCRE extension + [ pcre' ] # Enable sapis ++ lib.optional pearSupport [ libxml2.dev ] @@ -66,18 +55,9 @@ let CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; - configureFlags = [] + configureFlags = # Disable all extensions - ++ lib.optional minimalBuild [ "--disable-all" ] - - # A bunch of base extensions - ++ [ "--with-gettext=${gettext}" ] - ++ [ "--with-openssl" ] - ++ [ "--with-readline=${readline.dev}" ] - ++ [ "--with-zlib=${zlib.dev}" ] - ++ [ "--enable-mysqlnd" ] # Required to be able to build mysqli and pdo_mysql - ++ [ "--enable-sockets" ] - ++ [ "--enable-mbstring" ] + [ "--disable-all" ] # PCRE ++ lib.optionals (lib.versionAtLeast version "7.4") [ "--with-external-pcre=${pcre'.dev}" ] |