From b91721a119e8b5eb0831a02ff77c9ca580f56091 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sun, 2 Nov 2014 04:19:39 +0300 Subject: [PATCH] pidgin-latex: replace with SF one and fix --- .../pidgin-plugins/pidgin-latex/default.nix | 58 +++++++------------ .../pidgin-latex/pidgin-latex-sf.nix | 44 -------------- .../instant-messengers/pidgin/wrapper.nix | 7 ++- pkgs/top-level/all-packages.nix | 10 +--- 4 files changed, 29 insertions(+), 90 deletions(-) delete mode 100644 pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/default.nix index ba3f041738a6..c9b8a959bf97 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/default.nix @@ -1,46 +1,32 @@ -{ stdenv, fetchurl, pidgin, imagemagick, ghostscript -, pkgconfig, glib, gtk, texLive -}: - +{ stdenv, fetchurl, pkgconfig, pidgin, texLive, imagemagick, glib, gtk }: + +let version = "1.5.0"; +in stdenv.mkDerivation { - name = "pidgin-latex"; + name = "pidgin-latex-${version}"; src = fetchurl { - url = http://tapas.affenbande.org/pidgin-latex/pidgin-latex-0.9.tgz; - sha256 = "1yqd3qgxd3n8hm60qg7yv7j1crr6f3d4yrdpgwdpw2pyf92p8nxp"; + url = "mirror://sourceforge/pidgin-latex/pidgin-latex_${version}.tar.bz2"; + sha256 = "9c850aee90d7e59de834f83e09fa6e3e51b123f06e265ead70957608ada95441"; }; - preBuild = '' - sed -e '/^PREFIX/d' -i Makefile ; - sed -e 's@/usr/bin/latex@${texLive}/bin/pdflatex@g' -i pidgin-latex.h - sed -e 's@/usr/bin/convert@${imagemagick}/bin/convert@g' -i pidgin-latex.h - sed -e 's@.*convert_path.*@const gchar *convert = CONVERT_PATH;@' - sed -e 's@.*latex_path.*@const gchar *convert = LATEX_PATH;@' - sed -e 's/%s.dvi/%s.pdf/' -i pidgin-latex.c - sed -e 's/latex_system\(.*\)FALSE/latex_system\1TRUE/' -i pidgin-latex.c + nativeBuildInputs = [pkgconfig]; + buildInputs = [gtk glib pidgin]; + makeFlags = "PREFIX=$(out)"; + + postPatch = '' + sed -e 's/-Wl,-soname//' -i Makefile ''; - makeFlags = "PREFIX=\$(out)"; + passthru = { + wrapArgs = "--prefix PATH ':' ${texLive}/bin:${imagemagick}/bin"; + }; - preInstall = "mkdir -p $out/lib/pidgin $out/bin"; - - postInstall = '' - mkdir -p $out/share/pidgin-latex - ln -s $out/lib/pidgin/pidgin-latex.so $out/share/pidgin-latex/ - ''; - - buildInputs = [pidgin imagemagick ghostscript pkgconfig glib gtk texLive]; - - meta = { - longDescription = '' - Pidgin-LaTeX is a pidgin plugin that cuts everything inside \$\$ - .. \$\$ and feeds to LaTeX. A bit of conversion (automated, of - course) - and you see every formula that occurs in conversation - in pretty graphical form. There are some glitches - when a - formula fails to compile, you can see just previous formula.. - Enable it for user by linking to ~/.purple/plugins - from - sw/share/pidgin-latex , not from store of course. - ''; - homepage = http://tapas.affenbande.org/wordpress/?page_id=70; + meta = with stdenv.lib; { + homepage = http://sourceforge.net/projects/pidgin-latex/; + description = "LaTeX rendering plugin for Pidgin IM"; + licenses = licenses.gpl2; + platforms = platforms.linux; + maintainers = maintainers.abbradar; }; } diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix deleted file mode 100644 index 840416b7d175..000000000000 --- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix +++ /dev/null @@ -1,44 +0,0 @@ -args : with args; -let version = "1.5.0"; -in -rec { - src = fetchurl { - url = "mirror://sourceforge/pidgin-latex/pidgin-latex_${version}.tar.bz2"; - sha256 = "9c850aee90d7e59de834f83e09fa6e3e51b123f06e265ead70957608ada95441"; - }; - - buildInputs = [texLive pkgconfig gtk imagemagick glib pidgin which]; - configureFlags = []; - installFlags = [ - "PREFIX=$out" - ]; - - preBuild = fullDepEntry ('' - mkdir -p $out/bin - ln -s $(which convert) $out/bin - ln -s $(which xelatex) $out/bin - ln -s $(which dvips) $out/bin - - sed -e 's/-Wl,-soname//' -i Makefile - sed -e 's/\(PATH("\)latex/\1xelatex/' -i LaTeX.c - sed -e 's/|| execute(cmddvips, dvipsopts, 10) //' -i LaTeX.c - sed -e 's/ strcat([*]file_ps, "[.]ps");/ strcat(*file_ps, ".pdf");/' -i LaTeX.c - sed -e 's/\([*]convertopts\[5\]=[{]"\)\(\\"",\)/\1 -trim \2/' -i LaTeX.c - sed -e 's/\(#define HEADER ".*\)12pt\(.*\)"/\116pt\2\\\\usepackage{fontspec}\\\\usepackage{xunicode}"/' -i LaTeX.h - '') ["minInit" "addInputs" "defEnsureDir" "doUnpack"]; - - postInstall = fullDepEntry ('' - mkdir -p $out/lib - mkdir -p $out/share/pidgin-latex - ln -s ../../lib/pidgin/LaTeX.so $out/share/pidgin-latex - '') ["minInit" "defEnsureDir" "doMakeInstall"]; - - /* doConfigure should be specified separately */ - phaseNames = [ "preBuild" "doMakeInstall" "postInstall"]; - - name = "pidgin-latex-${version}"; - meta = { - description = "LaTeX rendering plugin for Pidgin IM"; - priority = "10"; - }; -} diff --git a/pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix b/pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix index 46477e8dcd0d..0c498dd612e1 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/wrapper.nix @@ -1,6 +1,8 @@ { stdenv, buildEnv, pidgin, makeWrapper, plugins }: -let drv = buildEnv { +let +extraArgs = map (x: x.wrapArgs or "") plugins; +drv = buildEnv { name = "pidgin-with-plugins-" + (builtins.parseDrvName pidgin.name).version; paths = [ pidgin ] ++ plugins; @@ -15,7 +17,8 @@ let drv = buildEnv { done fi wrapProgram $out/bin/pidgin \ - --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${pidgin.version} $out/lib/pidgin" + --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${pidgin.version} $out/lib/pidgin" \ + ${toString extraArgs} ''; }; in stdenv.lib.overrideDerivation drv (x : { buildInputs = x.buildInputs ++ [ makeWrapper ]; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7c62680f6204..2d3ae69e72b8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10222,15 +10222,9 @@ let plugins = []; }; - pidginlatex = callPackage ../applications/networking/instant-messengers/pidgin-plugins/pidgin-latex { - imagemagick = imagemagickBig; - }; + pidginlatex = callPackage ../applications/networking/instant-messengers/pidgin-plugins/pidgin-latex { }; - pidginlatexSF = builderDefsPackage - (import ../applications/networking/instant-messengers/pidgin-plugins/pidgin-latex/pidgin-latex-sf.nix) - { - inherit pkgconfig pidgin texLive imagemagick which glib gtk; - }; + pidginlatexSF = pidginlatex; pidginmsnpecan = callPackage ../applications/networking/instant-messengers/pidgin-plugins/msn-pecan { };