git.iko.soy/typeable/nixpkgs
on master help sign in
pidgin: add wrapper (close #4577, fixes #992)
commit2feaa0278a7cb6168faf3774c7e38cb0dd4a1777 authorNikolay Amiantov <ab@fmap.me> dateSat 18 Oct 2014, 12:22 (12 years ago) parent3b133be
4 files changed+48−2
pkgs/applications/networking/instant-messengers/pidgin/add-search-path.patch+20 pkgs/applications/networking/instant-messengers/pidgin/default.nix+3−2 pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix+21 pkgs/top-level/all-packages.nix+4
pkgs/applications/networking/instant-messengers/pidgin/add-search-path.patchnew file+20
@@ -0,0 +1,20 @@
1+diff --git a/libpurple/plugin.c b/libpurple/plugin.c
2+index 4f2b402..fda9add 100644
3+--- a/libpurple/plugin.c
4++++ b/libpurple/plugin.c
5+@@ -1181,8 +1181,15 @@ purple_plugins_get_handle(void) {
6+ void
7+ purple_plugins_init(void) {
8+ void *handle = purple_plugins_get_handle();
9++ gchar **paths, **p;
10+
11+ purple_plugins_add_search_path(LIBDIR);
12++ paths = g_strsplit(g_getenv("PURPLE_PLUGIN_PATH"), ":", -1);
13++ if (paths) {
14++ for (p = paths; *p; ++p)
15++ if (**p) purple_plugins_add_search_path(*p);
16++ }
17++ g_strfreev(paths);
18+
19+ purple_signal_register(handle, "plugin-load",
20+ purple_marshal_VOID__POINTER,
pkgs/applications/networking/instant-messengers/pidgin/default.nix+3−2
@@ -21,7 +21,8 @@
2121} :
2222
2323stdenv.mkDerivation rec {
24− name = "pidgin-2.10.9";
24+ majorVersion = "2";
25+ name = "pidgin-${majorVersion}.10.9";
2526 src = fetchurl {
2627 url = "mirror://sourceforge/pidgin/${name}.tar.bz2";
2728 sha256 = "06gka47myl9f5x0flkq74ml75akkf28rx9sl8pm3wqkzazc2wdnw";
@@ -46,7 +47,7 @@ stdenv.mkDerivation rec {
4647 pkgconfig gtk perl perlXMLParser gettext
4748 ];
4849
49− patches = [./pidgin-makefile.patch ];
50+ patches = [./pidgin-makefile.patch ./add-search-path.patch ];
5051
5152 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"
5253 + (lib.optionalString (gnutls != null) " --enable-gnutls=yes --enable-nss=no")
pkgs/applications/networking/instant-messengers/pidgin/wrapper.nixnew file+21
@@ -0,0 +1,21 @@
1+{ stdenv, buildEnv, pidgin, makeWrapper, plugins }:
2+
3+let drv = buildEnv {
4+ name = "${pidgin.name}-with-plugins";
5+
6+ paths = [ pidgin ] ++ plugins;
7+
8+ postBuild = ''
9+ # TODO: This could be avoided if buildEnv could be forced to create all directories
10+ if [ -L $out/bin ]; then
11+ rm $out/bin
12+ mkdir $out/bin
13+ for i in ${pidgin}/bin/*; do
14+ ln -s $i $out/bin
15+ done
16+ fi
17+ wrapProgram $out/bin/pidgin \
18+ --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${pidgin.majorVersion} $out/lib/pidgin"
19+ '';
20+ };
21+in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; })
pkgs/top-level/all-packages.nix+4
@@ -10108,6 +10108,10 @@ let
1010810108 startupnotification = libstartup_notification;
1010910109 };
1011010110
10111+ pidginWrapper = callPackage ../applications/networking/instant-messengers/pidgin/wrapper.nix {
10112+ plugins = [];
10113+ };
10114+
1011110115 pidginlatex = callPackage ../applications/networking/instant-messengers/pidgin-plugins/pidgin-latex {
1011210116 imagemagick = imagemagickBig;
1011310117 };