buildInputs = [ ruby ];
});
+ mypkgs.muttprint = stdenv.mkDerivation rec {
+ name = "muttprint-${version}";
+ version = "0.73";
+ src = fetchurl {
+ url = "http://downloads.sf.net/muttprint/${name}.tar.gz";
+ sha256 = "1dny4niyibfgazwlzfcnb37jy6k140rs6baaj629z12rmahfdavw";
+ };
+ patches = [
+ ./patches/muttprint_0.73-4.diff.gz
+ ./patches/muttprint_regex.patch
+ ./patches/muttprint_two_edge.patch
+ ];
+ preConfigure = ''
+ aclocal
+ automake --add-missing --copy
+ autoconf
+ '';
+ preBuild = ''
+ cd pics
+ convert -flop BabyTuX.eps BabyTuX.eps
+ for i in BabyTuX_color.eps BabyTuX.eps Debian_color.eps \
+ Debian.eps Gentoo.eps Gentoo_color.eps ; do
+ convert $i $(basename $i .eps).png
+ done
+ convert penguin.eps penguin.jpg
+ cd ..
+ '';
+ postInstall = ''
+ perlFlags=
+ for i in $(IFS=:; echo $PERL5LIB); do
+ perlFlags="$perlFlags -I$i"
+ done
+
+ sed -i "$out/bin/muttprint" -e "s|^#\!\(.*[ /]perl.*\)$|#\!\1$perlFlags|"
+
+ wrapProgram $out/bin/muttprint \
+ --prefix PATH : ${lib.makeBinPath [ psutils dialog
+ (texlive.combine { inherit (texlive) scheme-basic utopia fancyvrb lastpage marvosym ucs cm-super; }) ]}
+ '';
+ buildInputs = [ makeWrapper automake autoconf imagemagick ghostscript perl ] ++
+ (with perlPackages; [ TimeDate FileWhich TextIconv ]);
+ };
+
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
in
--- /dev/null
+--- a/muttprint 2015-07-21 11:18:04.219578426 +1200
++++ b/muttprint 2015-07-21 11:18:53.906243779 +1200
+@@ -1635,7 +1635,7 @@
+ open (AUX, "$auxfile") or fatalError "Could not open $auxfile:\n$!";
+
+ while (<AUX>) {
+- ($numberOfPages) = /\\newlabel{LastPage}{{}{(\d+)}}/;
++ ($numberOfPages) = /\\newlabel\{LastPage}\{\{}\{(\d+)}}/;
+ }
+
+ close AUX or fatalError "Could not close $auxfile:\n$!";
--- /dev/null
+--- a/muttprint 2016-05-05 13:48:50.515950744 +1200
++++ b/muttprint 2016-05-05 13:52:10.722623902 +1200
+@@ -643,14 +643,14 @@
+ if ($Config{PAPERSAVE} eq "on") {
+ if ($useCups) {
+ $Config{PRINT_COMMAND} =~
+- s/\$CUPS_OPTIONS/ -o sides=two-sided-long-edge \$CUPS_OPTIONS/;
++ s/\$CUPS_OPTIONS/ -o sides=two-sided-short-edge \$CUPS_OPTIONS/;
+ } else { # no cups
+ modifyPS("landscape");
+ }
+ } else { # no papersave
+ if ($useCups) {
+ $Config{PRINT_COMMAND} =~
+- s/\$CUPS_OPTIONS/ -o sides=two-sided-short-edge \$CUPS_OPTIONS/;
++ s/\$CUPS_OPTIONS/ -o sides=two-sided-long-edge \$CUPS_OPTIONS/;
+ } else { # no cups
+ modifyPS("portrait");
+ }