Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.4 kB · 72 lines
Nix
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273{ stdenv, lib, php, autoreconfHook, fetchurl, re2c, nix-update-script,}:
{ pname, version, internalDeps ? [ ], peclDeps ? [ ], buildInputs ? [ ], nativeBuildInputs ? [ ], postPhpize ? "", makeFlags ? [ ], src ? fetchurl ( { url = "https://pecl.php.net/get/${pname}-${version}.tgz"; } // lib.filterAttrs ( attrName: _: lib.elem attrName [ "sha256" "hash" ] ) args ), passthru ? { }, ...}@args:
stdenv.mkDerivation ( args // { name = "php-${pname}-${version}"; extensionName = pname;
inherit src;
strictDeps = true; nativeBuildInputs = [ php autoreconfHook re2c ] ++ nativeBuildInputs; buildInputs = [ php ] ++ peclDeps ++ 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} ''; checkPhase = "NO_INTERACTON=yes make test";
passthru = passthru // { # Thes flags were introduced for `nix-update` so that it can update # PHP extensions correctly. # See the corresponding PR: https://github.com/Mic92/nix-update/pull/123 isPhpExtension = true; updateScript = passthru.updateScript or (nix-update-script { }); }; })