From 9ac0d9ad61a2e5cce6fc8ae6c282df3ec9e77f98 Mon Sep 17 00:00:00 2001 From: talyz Date: Sat, 28 Mar 2020 23:20:38 +0100 Subject: [PATCH] php.packages.buildPecl: Introduce built-in extension dependencies Introduce the internalDeps attribute used by mkExtension, to refer to internal php extensions built by mkExtension. --- pkgs/build-support/build-pecl.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/build-pecl.nix b/pkgs/build-support/build-pecl.nix index a1030e3b34f..f43205f24c5 100644 --- a/pkgs/build-support/build-pecl.nix +++ b/pkgs/build-support/build-pecl.nix @@ -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} + ''; })