aboutsummaryrefslogtreecommitdiff
path: root/pkgs/muttprint
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-26 02:35:33 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-26 02:35:33 +0200
commita2230e848bc85e484ef14163ac90fdb7045855f7 (patch)
tree2a1cc4158e5aeca3b6022efec7cc11ee405b7757 /pkgs/muttprint
parent1618010c141571c4d9a3fa9d340d009620c4520f (diff)
downloadNix-a2230e848bc85e484ef14163ac90fdb7045855f7.tar.gz
Nix-a2230e848bc85e484ef14163ac90fdb7045855f7.tar.zst
Nix-a2230e848bc85e484ef14163ac90fdb7045855f7.zip
Move more packages to separate files
Diffstat (limited to 'pkgs/muttprint')
-rw-r--r--pkgs/muttprint/0.73-4.diff.gzbin0 -> 16525 bytes
-rw-r--r--pkgs/muttprint/default.nix44
-rw-r--r--pkgs/muttprint/regex.patch11
-rw-r--r--pkgs/muttprint/two_edge.patch19
4 files changed, 74 insertions, 0 deletions
diff --git a/pkgs/muttprint/0.73-4.diff.gz b/pkgs/muttprint/0.73-4.diff.gz
new file mode 100644
index 0000000..c4f3cef
--- /dev/null
+++ b/pkgs/muttprint/0.73-4.diff.gz
Binary files differ
diff --git a/pkgs/muttprint/default.nix b/pkgs/muttprint/default.nix
new file mode 100644
index 0000000..0863a7b
--- /dev/null
+++ b/pkgs/muttprint/default.nix
@@ -0,0 +1,44 @@
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}
diff --git a/pkgs/muttprint/regex.patch b/pkgs/muttprint/regex.patch
new file mode 100644
index 0000000..e99c4a2
--- /dev/null
+++ b/pkgs/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/pkgs/muttprint/two_edge.patch b/pkgs/muttprint/two_edge.patch
new file mode 100644
index 0000000..4a7290d
--- /dev/null
+++ b/pkgs/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 }