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 { stdenv, fetchurl, lib 2 , ncurses, openssl, aspell, gnutls, gettext 3 , zlib, curl, pkg-config, libgcrypt 4 - , cmake, makeWrapper, libobjc, libresolv, libiconv 5 , asciidoctor # manpages 6 , guileSupport ? true, guile 7 , luaSupport ? true, lua5 8 , perlSupport ? true, perl 9 , pythonSupport ? true, python3Packages 10 , rubySupport ? true, ruby 11 , tclSupport ? true, tcl 12 , extraBuildInputs ? [] 13 - , fetchpatch 14 }: 15 16 let 17 inherit (python3Packages) python; 18 plugins = [ 19 { name = "perl"; enabled = perlSupport; cmakeFlag = "ENABLE_PERL"; buildInputs = [ perl ]; } 20 { name = "tcl"; enabled = tclSupport; cmakeFlag = "ENABLE_TCL"; buildInputs = [ tcl ]; } ··· 22 { name = "guile"; enabled = guileSupport; cmakeFlag = "ENABLE_GUILE"; buildInputs = [ guile ]; } 23 { name = "lua"; enabled = luaSupport; cmakeFlag = "ENABLE_LUA"; buildInputs = [ lua5 ]; } 24 { name = "python"; enabled = pythonSupport; cmakeFlag = "ENABLE_PYTHON3"; buildInputs = [ python ]; } 25 ]; 26 enabledPlugins = builtins.filter (p: p.enabled) plugins; 27 ··· 42 43 cmakeFlags = with lib; [ 44 "-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" 48 ] 49 ++ optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"] 50 ++ map (p: "-D${p.cmakeFlag}=" + (if p.enabled then "ON" else "OFF")) plugins 51 ; 52 53 - nativeBuildInputs = [ cmake pkg-config makeWrapper asciidoctor ]; 54 buildInputs = with lib; [ 55 ncurses openssl aspell gnutls gettext zlib curl 56 libgcrypt ] ··· 85 on https://nixos.org/nixpkgs/manual/#sec-weechat . 86 ''; 87 license = lib.licenses.gpl3; 88 - maintainers = with lib.maintainers; [ lovek323 ]; 89 platforms = lib.platforms.unix; 90 }; 91 }
··· 1 { stdenv, fetchurl, lib 2 , ncurses, openssl, aspell, gnutls, gettext 3 , zlib, curl, pkg-config, libgcrypt 4 + , cmake, libobjc, libresolv, libiconv 5 , asciidoctor # manpages 6 + , enableTests ? !stdenv.isDarwin, cpputest 7 , guileSupport ? true, guile 8 , luaSupport ? true, lua5 9 , perlSupport ? true, perl 10 , pythonSupport ? true, python3Packages 11 , rubySupport ? true, ruby 12 , tclSupport ? true, tcl 13 + , phpSupport ? !stdenv.isDarwin, php, systemd, libxml2, pcre2, libargon2 14 , extraBuildInputs ? [] 15 }: 16 17 let 18 inherit (python3Packages) python; 19 + php-embed = php.override { 20 + embedSupport = true; 21 + apxs2Support = false; 22 + }; 23 plugins = [ 24 { name = "perl"; enabled = perlSupport; cmakeFlag = "ENABLE_PERL"; buildInputs = [ perl ]; } 25 { name = "tcl"; enabled = tclSupport; cmakeFlag = "ENABLE_TCL"; buildInputs = [ tcl ]; } ··· 27 { name = "guile"; enabled = guileSupport; cmakeFlag = "ENABLE_GUILE"; buildInputs = [ guile ]; } 28 { name = "lua"; enabled = luaSupport; cmakeFlag = "ENABLE_LUA"; buildInputs = [ lua5 ]; } 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; } 33 ]; 34 enabledPlugins = builtins.filter (p: p.enabled) plugins; 35 ··· 50 51 cmakeFlags = with lib; [ 52 "-DENABLE_MAN=ON" 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"}" 55 ] 56 ++ optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"] 57 ++ map (p: "-D${p.cmakeFlag}=" + (if p.enabled then "ON" else "OFF")) plugins 58 ; 59 60 + nativeBuildInputs = [ cmake pkg-config asciidoctor ] ++ lib.optional enableTests cpputest; 61 buildInputs = with lib; [ 62 ncurses openssl aspell gnutls gettext zlib curl 63 libgcrypt ] ··· 92 on https://nixos.org/nixpkgs/manual/#sec-weechat . 93 ''; 94 license = lib.licenses.gpl3; 95 + maintainers = with lib.maintainers; [ ncfavier ]; 96 platforms = lib.platforms.unix; 97 }; 98 }
+7 -1
pkgs/applications/networking/irc/weechat/wrapper.nix
··· 7 let 8 wrapper = { 9 installManPages ? true 10 - , configure ? { availablePlugins, ... }: { plugins = builtins.attrValues availablePlugins; } 11 }: 12 13 let ··· 21 ''; 22 withPackages = pkgsFun: (python // { 23 extraEnv = '' 24 export PYTHONHOME="${python3Packages.python.withPackages pkgsFun}" 25 ''; 26 }); ··· 40 ruby = simplePlugin "ruby"; 41 guile = simplePlugin "guile"; 42 lua = simplePlugin "lua"; 43 }; 44 45 config = configure { inherit availablePlugins; };
··· 7 let 8 wrapper = { 9 installManPages ? true 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 + } 15 }: 16 17 let ··· 25 ''; 26 withPackages = pkgsFun: (python // { 27 extraEnv = '' 28 + ${python.extraEnv} 29 export PYTHONHOME="${python3Packages.python.withPackages pkgsFun}" 30 ''; 31 }); ··· 45 ruby = simplePlugin "ruby"; 46 guile = simplePlugin "guile"; 47 lua = simplePlugin "lua"; 48 + php = simplePlugin "php"; 49 }; 50 51 config = configure { inherit availablePlugins; };