lol

weechat: make language plugins optional, fixes #13092

They're still enabled by default, but now can be disabled.

Python has not been made optional due to the additional complexity of:
- python2 vs python3
- pync support on Darwin
Making Python support optional should be revisited at another time.

authored by

Aneesh Agrawal and committed by
Rok Garbas
17aefb14 8b06e2fa

+38 -10
+38 -10
pkgs/applications/networking/irc/weechat/default.nix
··· 1 - { stdenv, fetchurl, ncurses, openssl, perl, python, aspell, gnutls 2 - , zlib, curl , pkgconfig, libgcrypt, ruby, lua5, tcl, guile 3 - , pythonPackages, cmake, makeWrapper, libobjc, libiconv 1 + { stdenv, fetchurl, ncurses, openssl, aspell, gnutls 2 + , zlib, curl , pkgconfig, libgcrypt 3 + , cmake, makeWrapper, libobjc, libiconv 4 + , guileSupport ? true, guile 5 + , luaSupport ? true, lua5 6 + , perlSupport ? true, perl 7 + , pythonPackages 8 + , rubySupport ? true, ruby 9 + , tclSupport ? true, tcl 4 10 , extraBuildInputs ? [] }: 5 11 12 + assert guileSupport -> guile != null; 13 + assert luaSupport -> lua5 != null; 14 + assert perlSupport -> perl != null; 15 + assert rubySupport -> ruby != null; 16 + assert tclSupport -> tcl != null; 17 + 18 + let 19 + inherit (pythonPackages) python pycrypto pync; 20 + in 21 + 6 22 stdenv.mkDerivation rec { 7 23 version = "1.4"; 8 24 name = "weechat-${version}"; ··· 12 28 sha256 = "1m6xq6izcac5186xvvmm8znfjzrg9hq42p69jabdvv7cri4rjvg0"; 13 29 }; 14 30 15 - cmakeFlags = stdenv.lib.optional stdenv.isDarwin 16 - "-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"; 31 + cmakeFlags = with stdenv.lib; [] 32 + ++ optional stdenv.isDarwin "-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib" 33 + ++ optional (!guileSupport) "-DENABLE_GUILE=OFF" 34 + ++ optional (!luaSupport) "-DENABLE_LUA=OFF" 35 + ++ optional (!perlSupport) "-DENABLE_PERL=OFF" 36 + ++ optional (!rubySupport) "-DENABLE_RUBY=OFF" 37 + ++ optional (!tclSupport) "-DENABLE_TCL=OFF" 38 + ; 17 39 18 - buildInputs = 19 - [ ncurses perl python openssl aspell gnutls zlib curl pkgconfig 20 - libgcrypt ruby lua5 tcl guile pythonPackages.pycrypto makeWrapper 21 - cmake ] 22 - ++ stdenv.lib.optionals stdenv.isDarwin [ pythonPackages.pync libobjc ] 40 + buildInputs = with stdenv.lib; [ 41 + ncurses python openssl aspell gnutls zlib curl pkgconfig 42 + libgcrypt pycrypto makeWrapper 43 + cmake 44 + ] 45 + ++ optionals stdenv.isDarwin [ pync libobjc ] 46 + ++ optional guileSupport guile 47 + ++ optional luaSupport lua5 48 + ++ optional perlSupport perl 49 + ++ optional rubySupport ruby 50 + ++ optional tclSupport tcl 23 51 ++ extraBuildInputs; 24 52 25 53 NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix} -DCA_FILE=/etc/ssl/certs/ca-certificates.crt";