25 , libstartup_notification
35 , withOpenssl ? false, openssl
36 , withGnutls ? false , gnutls
37 , withCyrus_sasl ? true, cyrus_sasl
41 # FIXME: clean the mess around choosing the SSL library (nss by default)
44 unwrapped = stdenv.mkDerivation rec {
49 url = "mirror://sourceforge/pidgin/pidgin-${version}.tar.bz2";
50 sha256 = "sha256-EgBJ3I4X4JoqfSVq/yGR/4SRq7hAyMfrMZoWHi3xa6g=";
53 nativeBuildInputs = [ makeWrapper intltool ];
55 env.NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0";
58 python-with-dbus = python3.withPackages (pp: with pp; [ dbus-python ]);
65 gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
73 libstartup_notification
75 ncurses # optional: build finch - the console UI
80 ++ lib.optional withOpenssl openssl
81 ++ lib.optionals withGnutls [ gnutls libgcrypt ]
82 ++ lib.optionals stdenv.hostPlatform.isLinux [ gtk2 gtkspell2 farstream ]
83 ++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11;
86 propagatedBuildInputs = [ pkg-config gettext ]
87 ++ (with perlPackages; [ perl XMLParser ])
88 ++ lib.optional stdenv.hostPlatform.isLinux gtk2
89 ++ lib.optional stdenv.hostPlatform.isDarwin gtk2-x11;
92 ./add-search-path.patch
93 ./pidgin-makefile.patch
97 "--with-nspr-includes=${nspr.dev}/include/nspr"
98 "--with-nspr-libs=${nspr.out}/lib"
99 "--with-nss-includes=${nss.dev}/include/nss"
100 "--with-nss-libs=${nss.out}/lib"
101 "--with-ncurses-headers=${ncurses.dev}/include"
102 "--with-system-ssl-certs=${cacert}/etc/ssl/certs"
103 "--disable-meanwhile"
106 "--disable-gevolution"
108 ++ lib.optionals withCyrus_sasl [ "--enable-cyrus-sasl=yes" ]
109 ++ lib.optionals withGnutls [ "--enable-gnutls=yes" "--enable-nss=no" ]
110 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "--disable-gtkspell" "--disable-vv" ]
111 ++ lib.optionals stdenv.cc.isClang [ "CFLAGS=-Wno-error=int-conversion" ];
113 enableParallelBuilding = true;
116 wrapProgram $out/bin/pidgin \
117 --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
120 doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
121 # In particular, this detects missing python imports in some of the tools.
123 # TODO: python is a script, so it doesn't work as interpreter on darwin
124 binsToTest = lib.optionalString stdenv.hostPlatform.isLinux "purple-remote," + "pidgin,finch";
125 in lib.optionalString doInstallCheck ''
126 for f in "''${!outputBin}"/bin/{${binsToTest}}; do
127 echo "Testing: $f --help"
133 makePluginPath = lib.makeSearchPathOutput "lib" "lib/purple-${lib.versions.major version}";
134 withPlugins = pluginfn: callPackage ./wrapper.nix {
135 plugins = pluginfn pidginPackages;
141 description = "Multi-protocol instant messaging client";
142 mainProgram = "pidgin";
143 homepage = "https://pidgin.im/";
144 license = lib.licenses.gpl2Plus;
145 platforms = lib.platforms.unix;
146 maintainers = [ lib.maintainers.lucasew ];
150 in if plugins == [] then unwrapped
151 else unwrapped.withPlugins (_: plugins)