diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2016-02-18 01:07:23 -0500 |
---|---|---|
committer | Rok Garbas <rok@garbas.si> | 2016-02-19 22:56:29 +0100 |
commit | 17aefb1460f9ac0b9647eae3bf0c5d06a2ed0276 (patch) | |
tree | db46b49e5086df98851c2b32732e1cd1e08b003d /pkgs/applications/networking/irc | |
parent | 8b06e2fab152e5dee87693341d5938b161f959b5 (diff) |
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.
Diffstat (limited to 'pkgs/applications/networking/irc')
-rw-r--r-- | pkgs/applications/networking/irc/weechat/default.nix | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix index a781a8ceb353e..54bba77b182b1 100644 --- a/pkgs/applications/networking/irc/weechat/default.nix +++ b/pkgs/applications/networking/irc/weechat/default.nix @@ -1,8 +1,24 @@ -{ stdenv, fetchurl, ncurses, openssl, perl, python, aspell, gnutls -, zlib, curl , pkgconfig, libgcrypt, ruby, lua5, tcl, guile -, pythonPackages, cmake, makeWrapper, libobjc, libiconv +{ stdenv, fetchurl, ncurses, openssl, aspell, gnutls +, zlib, curl , pkgconfig, libgcrypt +, cmake, makeWrapper, libobjc, libiconv +, guileSupport ? true, guile +, luaSupport ? true, lua5 +, perlSupport ? true, perl +, pythonPackages +, rubySupport ? true, ruby +, tclSupport ? true, tcl , extraBuildInputs ? [] }: +assert guileSupport -> guile != null; +assert luaSupport -> lua5 != null; +assert perlSupport -> perl != null; +assert rubySupport -> ruby != null; +assert tclSupport -> tcl != null; + +let + inherit (pythonPackages) python pycrypto pync; +in + stdenv.mkDerivation rec { version = "1.4"; name = "weechat-${version}"; @@ -12,14 +28,26 @@ stdenv.mkDerivation rec { sha256 = "1m6xq6izcac5186xvvmm8znfjzrg9hq42p69jabdvv7cri4rjvg0"; }; - cmakeFlags = stdenv.lib.optional stdenv.isDarwin - "-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"; + cmakeFlags = with stdenv.lib; [] + ++ optional stdenv.isDarwin "-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib" + ++ optional (!guileSupport) "-DENABLE_GUILE=OFF" + ++ optional (!luaSupport) "-DENABLE_LUA=OFF" + ++ optional (!perlSupport) "-DENABLE_PERL=OFF" + ++ optional (!rubySupport) "-DENABLE_RUBY=OFF" + ++ optional (!tclSupport) "-DENABLE_TCL=OFF" + ; - buildInputs = - [ ncurses perl python openssl aspell gnutls zlib curl pkgconfig - libgcrypt ruby lua5 tcl guile pythonPackages.pycrypto makeWrapper - cmake ] - ++ stdenv.lib.optionals stdenv.isDarwin [ pythonPackages.pync libobjc ] + buildInputs = with stdenv.lib; [ + ncurses python openssl aspell gnutls zlib curl pkgconfig + libgcrypt pycrypto makeWrapper + cmake + ] + ++ optionals stdenv.isDarwin [ pync libobjc ] + ++ optional guileSupport guile + ++ optional luaSupport lua5 + ++ optional perlSupport perl + ++ optional rubySupport ruby + ++ optional tclSupport tcl ++ extraBuildInputs; NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix} -DCA_FILE=/etc/ssl/certs/ca-certificates.crt"; |