From a2230e848bc85e484ef14163ac90fdb7045855f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 26 Apr 2019 02:35:33 +0200 Subject: Move more packages to separate files --- pkgs/muttprint/0.73-4.diff.gz | Bin 0 -> 16525 bytes pkgs/muttprint/default.nix | 44 ++++++++++++++++++++++++++++++++++++++++++ pkgs/muttprint/regex.patch | 11 +++++++++++ pkgs/muttprint/two_edge.patch | 19 ++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 pkgs/muttprint/0.73-4.diff.gz create mode 100644 pkgs/muttprint/default.nix create mode 100644 pkgs/muttprint/regex.patch create mode 100644 pkgs/muttprint/two_edge.patch (limited to 'pkgs/muttprint') 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 Binary files /dev/null and b/pkgs/muttprint/0.73-4.diff.gz 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 @@ +{ stdenv, fetchurl, lib, psutils, dialog, texlive, makeWrapper, automake, autoconf, imagemagick, ghostscript, perl, perlPackages }: +stdenv.mkDerivation rec { + name = "muttprint-${version}"; + version = "0.73"; + src = fetchurl { + url = "http://downloads.sf.net/muttprint/${name}.tar.gz"; + sha256 = "1dny4niyibfgazwlzfcnb37jy6k140rs6baaj629z12rmahfdavw"; + }; + patches = [ + ./0.73-4.diff.gz + ./regex.patch + ./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|" + sed -i "$out/bin/muttprint" -e "s|ENV{HOME}/.muttprintrc|ENV{XDG_CONFIG_HOME}/muttprint/muttprintrc|" + + 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 ]); +} 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 @@ +--- 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 () { +- ($numberOfPages) = /\\newlabel{LastPage}{{}{(\d+)}}/; ++ ($numberOfPages) = /\\newlabel\{LastPage}\{\{}\{(\d+)}}/; + } + + 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 @@ +--- 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"); + } -- cgit v1.2.3