@@ -1,46 +1,32 @@
1−{ stdenv, fetchurl, pidgin, imagemagick, ghostscript
2−, pkgconfig, glib, gtk, texLive
3−}:
4−
1+{ stdenv, fetchurl, pkgconfig, pidgin, texLive, imagemagick, glib, gtk }:
2+
3+let version = "1.5.0";
4+in
55stdenv.mkDerivation {
6− name = "pidgin-latex";
6+ name = "pidgin-latex-${version}";
77
88 src = fetchurl {
9− url = http://tapas.affenbande.org/pidgin-latex/pidgin-latex-0.9.tgz;
10− sha256 = "1yqd3qgxd3n8hm60qg7yv7j1crr6f3d4yrdpgwdpw2pyf92p8nxp";
9+ url = "mirror://sourceforge/pidgin-latex/pidgin-latex_${version}.tar.bz2";
10+ sha256 = "9c850aee90d7e59de834f83e09fa6e3e51b123f06e265ead70957608ada95441";
1111 };
1212
13− preBuild = ''
14− sed -e '/^PREFIX/d' -i Makefile ;
15− sed -e 's@/usr/bin/latex@${texLive}/bin/pdflatex@g' -i pidgin-latex.h
16− sed -e 's@/usr/bin/convert@${imagemagick}/bin/convert@g' -i pidgin-latex.h
17− sed -e 's@.*convert_path.*@const gchar *convert = CONVERT_PATH;@'
18− sed -e 's@.*latex_path.*@const gchar *convert = LATEX_PATH;@'
19− sed -e 's/%s.dvi/%s.pdf/' -i pidgin-latex.c
20− sed -e 's/latex_system\(.*\)FALSE/latex_system\1TRUE/' -i pidgin-latex.c
21− '';
22−
23− makeFlags = "PREFIX=\$(out)";
13+ nativeBuildInputs = [pkgconfig];
14+ buildInputs = [gtk glib pidgin];
15+ makeFlags = "PREFIX=$(out)";
2416
25− preInstall = "mkdir -p $out/lib/pidgin $out/bin";
26−
27− postInstall = ''
28− mkdir -p $out/share/pidgin-latex
29− ln -s $out/lib/pidgin/pidgin-latex.so $out/share/pidgin-latex/
17+ postPatch = ''
18+ sed -e 's/-Wl,-soname//' -i Makefile
3019 '';
3120
32− buildInputs = [pidgin imagemagick ghostscript pkgconfig glib gtk texLive];
21+ passthru = {
22+ wrapArgs = "--prefix PATH ':' ${texLive}/bin:${imagemagick}/bin";
23+ };
3324
34− meta = {
35− longDescription = ''
36− Pidgin-LaTeX is a pidgin plugin that cuts everything inside \$\$
37− .. \$\$ and feeds to LaTeX. A bit of conversion (automated, of
38− course) - and you see every formula that occurs in conversation
39− in pretty graphical form. There are some glitches - when a
40− formula fails to compile, you can see just previous formula..
41− Enable it for user by linking to ~/.purple/plugins - from
42− sw/share/pidgin-latex , not from store of course.
43− '';
44− homepage = http://tapas.affenbande.org/wordpress/?page_id=70;
25+ meta = with stdenv.lib; {
26+ homepage = http://sourceforge.net/projects/pidgin-latex/;
27+ description = "LaTeX rendering plugin for Pidgin IM";
28+ licenses = licenses.gpl2;
29+ platforms = platforms.linux;
30+ maintainers = maintainers.abbradar;
4531 };
4632}