diff options
-rw-r--r-- | default.nix | 43 | ||||
-rw-r--r-- | patches/muttprint_0.73-4.diff.gz | bin | 0 -> 16525 bytes | |||
-rw-r--r-- | patches/muttprint_regex.patch | 11 | ||||
-rw-r--r-- | patches/muttprint_two_edge.patch | 19 |
4 files changed, 73 insertions, 0 deletions
diff --git a/default.nix b/default.nix index 40cac81..b36cfc8 100644 --- a/default.nix +++ b/default.nix | |||
@@ -281,6 +281,49 @@ let | |||
281 | buildInputs = [ ruby ]; | 281 | buildInputs = [ ruby ]; |
282 | }); | 282 | }); |
283 | 283 | ||
284 | mypkgs.muttprint = stdenv.mkDerivation rec { | ||
285 | name = "muttprint-${version}"; | ||
286 | version = "0.73"; | ||
287 | src = fetchurl { | ||
288 | url = "http://downloads.sf.net/muttprint/${name}.tar.gz"; | ||
289 | sha256 = "1dny4niyibfgazwlzfcnb37jy6k140rs6baaj629z12rmahfdavw"; | ||
290 | }; | ||
291 | patches = [ | ||
292 | ./patches/muttprint_0.73-4.diff.gz | ||
293 | ./patches/muttprint_regex.patch | ||
294 | ./patches/muttprint_two_edge.patch | ||
295 | ]; | ||
296 | preConfigure = '' | ||
297 | aclocal | ||
298 | automake --add-missing --copy | ||
299 | autoconf | ||
300 | ''; | ||
301 | preBuild = '' | ||
302 | cd pics | ||
303 | convert -flop BabyTuX.eps BabyTuX.eps | ||
304 | for i in BabyTuX_color.eps BabyTuX.eps Debian_color.eps \ | ||
305 | Debian.eps Gentoo.eps Gentoo_color.eps ; do | ||
306 | convert $i $(basename $i .eps).png | ||
307 | done | ||
308 | convert penguin.eps penguin.jpg | ||
309 | cd .. | ||
310 | ''; | ||
311 | postInstall = '' | ||
312 | perlFlags= | ||
313 | for i in $(IFS=:; echo $PERL5LIB); do | ||
314 | perlFlags="$perlFlags -I$i" | ||
315 | done | ||
316 | |||
317 | sed -i "$out/bin/muttprint" -e "s|^#\!\(.*[ /]perl.*\)$|#\!\1$perlFlags|" | ||
318 | |||
319 | wrapProgram $out/bin/muttprint \ | ||
320 | --prefix PATH : ${lib.makeBinPath [ psutils dialog | ||
321 | (texlive.combine { inherit (texlive) scheme-basic utopia fancyvrb lastpage marvosym ucs cm-super; }) ]} | ||
322 | ''; | ||
323 | buildInputs = [ makeWrapper automake autoconf imagemagick ghostscript perl ] ++ | ||
324 | (with perlPackages; [ TimeDate FileWhich TextIconv ]); | ||
325 | }; | ||
326 | |||
284 | # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh | 327 | # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh |
285 | # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks | 328 | # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks |
286 | in | 329 | in |
diff --git a/patches/muttprint_0.73-4.diff.gz b/patches/muttprint_0.73-4.diff.gz new file mode 100644 index 0000000..c4f3cef --- /dev/null +++ b/patches/muttprint_0.73-4.diff.gz | |||
Binary files differ | |||
diff --git a/patches/muttprint_regex.patch b/patches/muttprint_regex.patch new file mode 100644 index 0000000..e99c4a2 --- /dev/null +++ b/patches/muttprint_regex.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- a/muttprint 2015-07-21 11:18:04.219578426 +1200 | ||
2 | +++ b/muttprint 2015-07-21 11:18:53.906243779 +1200 | ||
3 | @@ -1635,7 +1635,7 @@ | ||
4 | open (AUX, "$auxfile") or fatalError "Could not open $auxfile:\n$!"; | ||
5 | |||
6 | while (<AUX>) { | ||
7 | - ($numberOfPages) = /\\newlabel{LastPage}{{}{(\d+)}}/; | ||
8 | + ($numberOfPages) = /\\newlabel\{LastPage}\{\{}\{(\d+)}}/; | ||
9 | } | ||
10 | |||
11 | close AUX or fatalError "Could not close $auxfile:\n$!"; | ||
diff --git a/patches/muttprint_two_edge.patch b/patches/muttprint_two_edge.patch new file mode 100644 index 0000000..4a7290d --- /dev/null +++ b/patches/muttprint_two_edge.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | --- a/muttprint 2016-05-05 13:48:50.515950744 +1200 | ||
2 | +++ b/muttprint 2016-05-05 13:52:10.722623902 +1200 | ||
3 | @@ -643,14 +643,14 @@ | ||
4 | if ($Config{PAPERSAVE} eq "on") { | ||
5 | if ($useCups) { | ||
6 | $Config{PRINT_COMMAND} =~ | ||
7 | - s/\$CUPS_OPTIONS/ -o sides=two-sided-long-edge \$CUPS_OPTIONS/; | ||
8 | + s/\$CUPS_OPTIONS/ -o sides=two-sided-short-edge \$CUPS_OPTIONS/; | ||
9 | } else { # no cups | ||
10 | modifyPS("landscape"); | ||
11 | } | ||
12 | } else { # no papersave | ||
13 | if ($useCups) { | ||
14 | $Config{PRINT_COMMAND} =~ | ||
15 | - s/\$CUPS_OPTIONS/ -o sides=two-sided-short-edge \$CUPS_OPTIONS/; | ||
16 | + s/\$CUPS_OPTIONS/ -o sides=two-sided-long-edge \$CUPS_OPTIONS/; | ||
17 | } else { # no cups | ||
18 | modifyPS("portrait"); | ||
19 | } | ||