fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 stdenv,
3 lib,
4 php,
5 autoreconfHook,
6 fetchurl,
7 re2c,
8 nix-update-script,
9}:
10
11{
12 pname,
13 version,
14 internalDeps ? [ ],
15 peclDeps ? [ ],
16 buildInputs ? [ ],
17 nativeBuildInputs ? [ ],
18 postPhpize ? "",
19 makeFlags ? [ ],
20 src ? fetchurl (
21 {
22 url = "https://pecl.php.net/get/${pname}-${version}.tgz";
23 }
24 // lib.filterAttrs (
25 attrName: _:
26 lib.elem attrName [
27 "sha256"
28 "hash"
29 ]
30 ) args
31 ),
32 passthru ? { },
33 ...
34}@args:
35
36stdenv.mkDerivation (
37 args
38 // {
39 name = "php-${pname}-${version}";
40 extensionName = pname;
41
42 inherit src;
43
44 nativeBuildInputs = [
45 autoreconfHook
46 re2c
47 ] ++ nativeBuildInputs;
48 buildInputs = [ php ] ++ peclDeps ++ buildInputs;
49
50 makeFlags = [ "EXTENSION_DIR=$(out)/lib/php/extensions" ] ++ makeFlags;
51
52 autoreconfPhase = ''
53 phpize
54 ${postPhpize}
55 ${lib.concatMapStringsSep "\n" (
56 dep: "mkdir -p ext; ln -s ${dep.dev}/include ext/${dep.extensionName}"
57 ) internalDeps}
58 '';
59 checkPhase = "NO_INTERACTON=yes make test";
60
61 passthru = passthru // {
62 # Thes flags were introduced for `nix-update` so that it can update
63 # PHP extensions correctly.
64 # See the corresponding PR: https://github.com/Mic92/nix-update/pull/123
65 isPhpExtension = true;
66 updateScript = nix-update-script { };
67 };
68 }
69)