pidgin: add wrapper (close #4577, fixes #992)

This commit is contained in:
Nikolay Amiantov 2014-10-18 12:22:37 +04:00 committed by Vladimír Čunát
parent 3b133beb7a
commit 2feaa0278a
4 changed files with 48 additions and 2 deletions

View File

@ -0,0 +1,20 @@
diff --git a/libpurple/plugin.c b/libpurple/plugin.c
index 4f2b402..fda9add 100644
--- a/libpurple/plugin.c
+++ b/libpurple/plugin.c
@@ -1181,8 +1181,15 @@ purple_plugins_get_handle(void) {
void
purple_plugins_init(void) {
void *handle = purple_plugins_get_handle();
+ gchar **paths, **p;
purple_plugins_add_search_path(LIBDIR);
+ paths = g_strsplit(g_getenv("PURPLE_PLUGIN_PATH"), ":", -1);
+ if (paths) {
+ for (p = paths; *p; ++p)
+ if (**p) purple_plugins_add_search_path(*p);
+ }
+ g_strfreev(paths);
purple_signal_register(handle, "plugin-load",
purple_marshal_VOID__POINTER,

View File

@ -21,7 +21,8 @@
} :
stdenv.mkDerivation rec {
name = "pidgin-2.10.9";
majorVersion = "2";
name = "pidgin-${majorVersion}.10.9";
src = fetchurl {
url = "mirror://sourceforge/pidgin/${name}.tar.bz2";
sha256 = "06gka47myl9f5x0flkq74ml75akkf28rx9sl8pm3wqkzazc2wdnw";
@ -46,7 +47,7 @@ stdenv.mkDerivation rec {
pkgconfig gtk perl perlXMLParser gettext
];
patches = [./pidgin-makefile.patch ];
patches = [./pidgin-makefile.patch ./add-search-path.patch ];
configureFlags="--with-nspr-includes=${nspr}/include/nspr --with-nspr-libs=${nspr}/lib --with-nss-includes=${nss}/include/nss --with-nss-libs=${nss}/lib --with-ncurses-headers=${ncurses}/include --disable-meanwhile --disable-nm --disable-tcl"
+ (lib.optionalString (gnutls != null) " --enable-gnutls=yes --enable-nss=no")

View File

@ -0,0 +1,21 @@
{ stdenv, buildEnv, pidgin, makeWrapper, plugins }:
let drv = buildEnv {
name = "${pidgin.name}-with-plugins";
paths = [ pidgin ] ++ plugins;
postBuild = ''
# TODO: This could be avoided if buildEnv could be forced to create all directories
if [ -L $out/bin ]; then
rm $out/bin
mkdir $out/bin
for i in ${pidgin}/bin/*; do
ln -s $i $out/bin
done
fi
wrapProgram $out/bin/pidgin \
--suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${pidgin.majorVersion} $out/lib/pidgin"
'';
};
in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })

View File

@ -10108,6 +10108,10 @@ let
startupnotification = libstartup_notification;
};
pidginWrapper = callPackage ../applications/networking/instant-messengers/pidgin/wrapper.nix {
plugins = [];
};
pidginlatex = callPackage ../applications/networking/instant-messengers/pidgin-plugins/pidgin-latex {
imagemagick = imagemagickBig;
};