biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / networking / instant-messengers / pidgin / default.nix
blob211c5b49bf9aec14f0fb4ad3ec7086c624b1dcf0
1 { stdenv
2 , callPackage
3 , fetchurl
4 , makeWrapper
5 , aspell
6 , avahi
7 , cacert
8 , dbus
9 , dbus-glib
10 , farstream
11 , gettext
12 , gst_all_1
13 , gtk2
14 , gtk2-x11
15 , gtkspell2
16 , intltool
17 , lib
18 , libICE
19 , libSM
20 , libXScrnSaver
21 , libXext
22 , libgcrypt
23 , libgnt
24 , libidn
25 , libstartup_notification
26 , libxml2
27 , ncurses
28 , nspr
29 , nss
30 , perlPackages
31 , pkg-config
32 , python3
33 , pidgin
34 , plugins        ? []
35 , withOpenssl    ? false, openssl
36 , withGnutls     ? false , gnutls
37 , withCyrus_sasl ? true, cyrus_sasl
38 , pidginPackages
41 # FIXME: clean the mess around choosing the SSL library (nss by default)
43 let
44   unwrapped = stdenv.mkDerivation rec {
45     pname = "pidgin";
46     version = "2.14.13";
48     src = fetchurl {
49       url = "mirror://sourceforge/pidgin/pidgin-${version}.tar.bz2";
50       sha256 = "sha256-EgBJ3I4X4JoqfSVq/yGR/4SRq7hAyMfrMZoWHi3xa6g=";
51     };
53     nativeBuildInputs = [ makeWrapper intltool ];
55     env.NIX_CFLAGS_COMPILE = "-I${gst_all_1.gst-plugins-base.dev}/include/gstreamer-1.0";
57     buildInputs = let
58       python-with-dbus = python3.withPackages (pp: with pp; [ dbus-python ]);
59     in [
60       aspell
61       avahi
62       cyrus_sasl
63       dbus
64       dbus-glib
65       gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
66       gst_all_1.gstreamer
67       libICE
68       libSM
69       libXScrnSaver
70       libXext
71       libgnt
72       libidn
73       libstartup_notification
74       libxml2
75       ncurses # optional: build finch - the console UI
76       nspr
77       nss
78       python-with-dbus
79     ]
80     ++ lib.optional withOpenssl openssl
81     ++ lib.optionals withGnutls [ gnutls libgcrypt ]
82     ++ lib.optionals stdenv.isLinux [ gtk2 gtkspell2 farstream ]
83     ++ lib.optional stdenv.isDarwin gtk2-x11;
86     propagatedBuildInputs = [ pkg-config gettext ]
87       ++ (with perlPackages; [ perl XMLParser ])
88       ++ lib.optional stdenv.isLinux gtk2
89       ++ lib.optional stdenv.isDarwin gtk2-x11;
91     patches = [
92       ./add-search-path.patch
93       ./pidgin-makefile.patch
94     ];
96     configureFlags = [
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"
104       "--disable-nm"
105       "--disable-tcl"
106       "--disable-gevolution"
107     ]
108     ++ lib.optionals withCyrus_sasl [ "--enable-cyrus-sasl=yes" ]
109     ++ lib.optionals withGnutls [ "--enable-gnutls=yes" "--enable-nss=no" ]
110     ++ lib.optionals stdenv.isDarwin [ "--disable-gtkspell" "--disable-vv" ];
112     enableParallelBuilding = true;
114     postInstall = ''
115       wrapProgram $out/bin/pidgin \
116         --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
117     '';
119     doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform;
120     # In particular, this detects missing python imports in some of the tools.
121     postFixup = let
122       # TODO: python is a script, so it doesn't work as interpreter on darwin
123       binsToTest = lib.optionalString stdenv.isLinux "purple-remote," + "pidgin,finch";
124     in lib.optionalString doInstallCheck ''
125       for f in "''${!outputBin}"/bin/{${binsToTest}}; do
126         echo "Testing: $f --help"
127         "$f" --help
128       done
129     '';
131     passthru = {
132       makePluginPath = lib.makeSearchPathOutput "lib" "lib/purple-${lib.versions.major version}";
133       withPlugins = pluginfn: callPackage ./wrapper.nix {
134         plugins = pluginfn pidginPackages;
135         pidgin = unwrapped;
136       };
137     };
139     meta = {
140       description = "Multi-protocol instant messaging client";
141       homepage = "https://pidgin.im/";
142       license = lib.licenses.gpl2Plus;
143       platforms = lib.platforms.unix;
144       maintainers = [ lib.maintainers.lucasew ];
145     };
146   };
148 in if plugins == [] then unwrapped
149   else unwrapped.withPlugins (_: plugins)