]> git.immae.eu Git - perso/Immae/Config/Nix/NUR.git/blame - pkgs/muttprint/default.nix
Initial commit published for NUR
[perso/Immae/Config/Nix/NUR.git] / pkgs / muttprint / default.nix
CommitLineData
24fd1fe6
IB
1{ stdenv, fetchurl, lib, psutils, dialog, texlive, makeWrapper, automake, autoconf, imagemagick, ghostscript, perl, perlPackages }:
2stdenv.mkDerivation rec {
3 name = "muttprint-${version}";
4 version = "0.73";
5 src = fetchurl {
6 url = "http://downloads.sf.net/muttprint/${name}.tar.gz";
7 sha256 = "1dny4niyibfgazwlzfcnb37jy6k140rs6baaj629z12rmahfdavw";
8 };
9 patches = [
10 ./0.73-4.diff.gz
11 ./regex.patch
12 ./two_edge.patch
13 ];
14 preConfigure = ''
15 aclocal
16 automake --add-missing --copy
17 autoconf
18 '';
19 preBuild = ''
20 cd pics
21 convert -flop BabyTuX.eps BabyTuX.eps
22 for i in BabyTuX_color.eps BabyTuX.eps Debian_color.eps \
23 Debian.eps Gentoo.eps Gentoo_color.eps ; do
24 convert $i $(basename $i .eps).png
25 done
26 convert penguin.eps penguin.jpg
27 cd ..
28 '';
29 postInstall = ''
30 perlFlags=
31 for i in $(IFS=:; echo $PERL5LIB); do
32 perlFlags="$perlFlags -I$i"
33 done
34
35 sed -i "$out/bin/muttprint" -e "s|^#\!\(.*[ /]perl.*\)$|#\!\1$perlFlags|"
36 sed -i "$out/bin/muttprint" -e "s|ENV{HOME}/.muttprintrc|ENV{XDG_CONFIG_HOME}/muttprint/muttprintrc|"
37
38 wrapProgram $out/bin/muttprint \
39 --prefix PATH : ${lib.makeBinPath [ psutils dialog
40 (texlive.combine { inherit (texlive) scheme-basic utopia fancyvrb lastpage marvosym ucs cm-super; }) ]}
41 '';
42 buildInputs = [ makeWrapper automake autoconf imagemagick ghostscript perl ] ++
43 (with perlPackages; [ TimeDate FileWhich TextIconv ]);
44}