<commit_before>{ stdenv, fetchurl, pkgconfig, glib, openssl, expat, libmesode
, ncurses, libotr, curl, readline, libuuid

, autoAwaySupport ? false,       libXScrnSaver ? null, libX11 ? null
, notifySupport ? false,         libnotify ? null, gdk_pixbuf ? null
, traySupport ? false,           gnome2 ? null
, pgpSupport ? true,            gpgme ? null
, pythonPluginSupport ? true,   python ? null
}:

assert autoAwaySupport     -> libXScrnSaver != null && libX11 != null;
assert notifySupport       -> libnotify != null && gdk_pixbuf != null;
assert traySupport         -> gnome2 != null;
assert pgpSupport          -> gpgme != null;
assert pythonPluginSupport -> python != null;

with stdenv.lib;

stdenv.mkDerivation rec {
  name = "profanity-${version}";
  version = "0.5.1";

  src = fetchurl {
    url = "http://www.profanity.im/profanity-${version}.tar.gz";
    sha256 = "1f7ylw3mhhnii52mmk40hyc4kqhpvjdr3hmsplzkdhsfww9kflg3";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ pkgconfig ];

  buildInputs = [
    readline libuuid libmesode
    glib openssl expat ncurses libotr curl
  ] ++ optionals autoAwaySupport     [ libXScrnSaver libX11 ]
    ++ optionals notifySupport       [ libnotify gdk_pixbuf ]
    ++ optionals traySupport         [ gnome2.gtk ]
    ++ optionals pgpSupport          [ gpgme ]
    ++ optionals pythonPluginSupport [ python ];

  meta = {
    description = "A console based XMPP client";
    longDescription = ''
      Profanity is a console based XMPP client written in C using ncurses and
      libstrophe, inspired by Irssi.
    '';
    homepage = http://profanity.im/;
    license = licenses.gpl3Plus;
    platforms = platforms.unix;
    maintainers = [ maintainers.devhell ];
    updateWalker = true;
  };
}<commit_msg>profanity: explicit feature flags so build fails when libs are missing<commit_after>{ stdenv, fetchurl, pkgconfig, glib, openssl, expat, libmesode
, ncurses, libotr, curl, readline, libuuid

, autoAwaySupport ? false,       libXScrnSaver ? null, libX11 ? null
, notifySupport ? false,         libnotify ? null, gdk_pixbuf ? null
, traySupport ? false,           gnome2 ? null
, pgpSupport ? true,            gpgme ? null
, pythonPluginSupport ? true,   python ? null
}:

assert autoAwaySupport     -> libXScrnSaver != null && libX11 != null;
assert notifySupport       -> libnotify != null && gdk_pixbuf != null;
assert traySupport         -> gnome2 != null;
assert pgpSupport          -> gpgme != null;
assert pythonPluginSupport -> python != null;

with stdenv.lib;

stdenv.mkDerivation rec {
  name = "profanity-${version}";
  version = "0.5.1";

  src = fetchurl {
    url = "http://www.profanity.im/profanity-${version}.tar.gz";
    sha256 = "1f7ylw3mhhnii52mmk40hyc4kqhpvjdr3hmsplzkdhsfww9kflg3";
  };

  enableParallelBuilding = true;

  nativeBuildInputs = [ pkgconfig ];

  buildInputs = [
    readline libuuid libmesode
    glib openssl expat ncurses libotr curl
  ] ++ optionals autoAwaySupport     [ libXScrnSaver libX11 ]
    ++ optionals notifySupport       [ libnotify gdk_pixbuf ]
    ++ optionals traySupport         [ gnome2.gtk ]
    ++ optionals pgpSupport          [ gpgme ]
    ++ optionals pythonPluginSupport [ python ];

  # Enable feature flags, so that build fail if libs are missing
  configureFlags = [ "--enable-c-plugins" "--enable-otr" ]
    ++ optionals notifySupport       [ "--enable-notifications" ]
    ++ optionals traySupport         [ "--enable-icons" ]
    ++ optionals pgpSupport          [ "--enable-pgp" ]
    ++ optionals pythonPluginSupport [ "--enable-python-plugins" ];

  meta = {
    description = "A console based XMPP client";
    longDescription = ''
      Profanity is a console based XMPP client written in C using ncurses and
      libstrophe, inspired by Irssi.
    '';
    homepage = http://profanity.im/;
    license = licenses.gpl3Plus;
    platforms = platforms.unix;
    maintainers = [ maintainers.devhell ];
    updateWalker = true;
  };
}
{'fraction_non_alphanumeric': 0.10638832997987928, 'fraction_numerical': 0.01358148893360161, 'mean_word_length': 2.980980980980981, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5629765', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1276, 'n_words': 318}