1{
2 stdenv,
3 buildPecl,
4 lib,
5 libiconv,
6 php,
7 fetchFromGitHub,
8 pcre2,
9}:
10
11buildPecl rec {
12 pname = "snuffleupagus";
13 version = "0.12.0";
14
15 src = fetchFromGitHub {
16 owner = "jvoisin";
17 repo = "snuffleupagus";
18 rev = "v${version}";
19 hash = "sha256-xTLdP71x3NevkjKff8hb0JE4TGfuYB0jGjDQJfFPC9Y=";
20 };
21
22 buildInputs = [
23 pcre2
24 ]
25 ++ lib.optionals stdenv.hostPlatform.isDarwin [
26 libiconv
27 ];
28
29 internalDeps = with php.extensions; [ session ];
30
31 sourceRoot = "${src.name}/src";
32
33 configureFlags = [ "--enable-snuffleupagus" ];
34
35 postPhpize = ''
36 ./configure --enable-snuffleupagus
37 '';
38
39 meta = {
40 description = "Security module for php7 and php8 - Killing bugclasses and virtual-patching the rest";
41 homepage = "https://github.com/jvoisin/snuffleupagus";
42 license = lib.licenses.lgpl3Only;
43 maintainers = [ lib.maintainers.zupo ];
44 teams = [ lib.teams.php ];
45 };
46}