weechat: add PHP support

Add PHP support, but do not include it in the wrapper by default, because
- it doesn't build on Darwin,
- it doubles the closure size,
- there are no official scripts written in PHP,
- it's probably broken: the [example PHP
script](https://weechat.org/files/doc/stable/weechat_scripting.en.html#register_function)
from the manual fails to load.

Enable build-time tests (except on Darwin as they don't build).

Remove `-DENABLE_JAVASCRIPT=OFF`, which was made the default upstream [a long time
ago](https://github.com/weechat/weechat/commit/340d6646a6371e2f224d392c9b1b44c8a20b5074).

Add myself as a maintainer.

+21 -8
+14 -7
pkgs/applications/networking/irc/weechat/default.nix
··· 1 1 { stdenv, fetchurl, lib 2 2 , ncurses, openssl, aspell, gnutls, gettext 3 3 , zlib, curl, pkg-config, libgcrypt 4 - , cmake, makeWrapper, libobjc, libresolv, libiconv 4 + , cmake, libobjc, libresolv, libiconv 5 5 , asciidoctor # manpages 6 + , enableTests ? !stdenv.isDarwin, cpputest 6 7 , guileSupport ? true, guile 7 8 , luaSupport ? true, lua5 8 9 , perlSupport ? true, perl 9 10 , pythonSupport ? true, python3Packages 10 11 , rubySupport ? true, ruby 11 12 , tclSupport ? true, tcl 13 + , phpSupport ? !stdenv.isDarwin, php, systemd, libxml2, pcre2, libargon2 12 14 , extraBuildInputs ? [] 13 - , fetchpatch 14 15 }: 15 16 16 17 let 17 18 inherit (python3Packages) python; 19 + php-embed = php.override { 20 + embedSupport = true; 21 + apxs2Support = false; 22 + }; 18 23 plugins = [ 19 24 { name = "perl"; enabled = perlSupport; cmakeFlag = "ENABLE_PERL"; buildInputs = [ perl ]; } 20 25 { name = "tcl"; enabled = tclSupport; cmakeFlag = "ENABLE_TCL"; buildInputs = [ tcl ]; } ··· 22 27 { name = "guile"; enabled = guileSupport; cmakeFlag = "ENABLE_GUILE"; buildInputs = [ guile ]; } 23 28 { name = "lua"; enabled = luaSupport; cmakeFlag = "ENABLE_LUA"; buildInputs = [ lua5 ]; } 24 29 { name = "python"; enabled = pythonSupport; cmakeFlag = "ENABLE_PYTHON3"; buildInputs = [ python ]; } 30 + { name = "php"; enabled = phpSupport; cmakeFlag = "ENABLE_PHP"; buildInputs = [ 31 + php-embed.unwrapped.dev libxml2 pcre2 libargon2 32 + ] ++ lib.optional stdenv.isLinux systemd; } 25 33 ]; 26 34 enabledPlugins = builtins.filter (p: p.enabled) plugins; 27 35 ··· 42 50 43 51 cmakeFlags = with lib; [ 44 52 "-DENABLE_MAN=ON" 45 - "-DENABLE_DOC=OFF" # TODO: Documentation fails to build, was deactivated to push through security update 46 - "-DENABLE_JAVASCRIPT=OFF" # Requires v8 <= 3.24.3, https://github.com/weechat/weechat/issues/360 47 - "-DENABLE_PHP=OFF" 53 + "-DENABLE_DOC=OFF" # TODO(@ncfavier): Documentation fails to build, was deactivated to push through security update 54 + "-DENABLE_TESTS=${if enableTests then "ON" else "OFF"}" 48 55 ] 49 56 ++ optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"] 50 57 ++ map (p: "-D${p.cmakeFlag}=" + (if p.enabled then "ON" else "OFF")) plugins 51 58 ; 52 59 53 - nativeBuildInputs = [ cmake pkg-config makeWrapper asciidoctor ]; 60 + nativeBuildInputs = [ cmake pkg-config asciidoctor ] ++ lib.optional enableTests cpputest; 54 61 buildInputs = with lib; [ 55 62 ncurses openssl aspell gnutls gettext zlib curl 56 63 libgcrypt ] ··· 85 92 on https://nixos.org/nixpkgs/manual/#sec-weechat . 86 93 ''; 87 94 license = lib.licenses.gpl3; 88 - maintainers = with lib.maintainers; [ lovek323 ]; 95 + maintainers = with lib.maintainers; [ ncfavier ]; 89 96 platforms = lib.platforms.unix; 90 97 }; 91 98 }
+7 -1
pkgs/applications/networking/irc/weechat/wrapper.nix
··· 7 7 let 8 8 wrapper = { 9 9 installManPages ? true 10 - , configure ? { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; } 10 + , configure ? { availablePlugins, ... }: { 11 + # Do not include PHP by default, because it bloats the closure, doesn't 12 + # build on Darwin, and there are no official PHP scripts. 13 + plugins = builtins.attrValues (builtins.removeAttrs availablePlugins [ "php" ]); 14 + } 11 15 }: 12 16 13 17 let ··· 21 25 ''; 22 26 withPackages = pkgsFun: (python // { 23 27 extraEnv = '' 28 + ${python.extraEnv} 24 29 export PYTHONHOME="${python3Packages.python.withPackages pkgsFun}" 25 30 ''; 26 31 }); ··· 40 45 ruby = simplePlugin "ruby"; 41 46 guile = simplePlugin "guile"; 42 47 lua = simplePlugin "lua"; 48 + php = simplePlugin "php"; 43 49 }; 44 50 45 51 config = configure { inherit availablePlugins; };