summary refs log blame commit diff
path: root/pkgs/build-support/build-pecl.nix
blob: f43205f24c5c68bf0b812a73c36a65434f0dc985 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                     
 

         
                   
                  
                        
                 

                  
                                                            





                              
                                   
 

              
                                                                   
                                       
 
                                                                         
 






                                                                              
  
{ stdenv, lib, php, autoreconfHook, fetchurl, re2c }:

{ pname
, version
, internalDeps ? []
, buildInputs ? []
, nativeBuildInputs ? []
, postPhpize ? ""
, makeFlags ? []
, src ? fetchurl {
    url = "http://pecl.php.net/get/${pname}-${version}.tgz";
    inherit (args) sha256;
  }
, ...
}@args:

stdenv.mkDerivation (args // {
  name = "php-${pname}-${version}";

  inherit src;

  nativeBuildInputs = [ autoreconfHook re2c ] ++ nativeBuildInputs;
  buildInputs = [ php ] ++ buildInputs;

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

  autoreconfPhase = ''
    phpize
    ${postPhpize}
    ${lib.concatMapStringsSep "\n"
      (dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}")
      internalDeps}
  '';
})