net-print/poster: Add patch for bug 471238
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Sun, 19 Feb 2017 22:03:59 +0000 (23:03 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Sun, 19 Feb 2017 22:04:44 +0000 (23:04 +0100)
Package-Manager: Portage-2.3.3, Repoman-2.3.1

net-print/poster/files/poster-20060221-fix_gs_crash.patch [new file with mode: 0644]
net-print/poster/poster-20060221-r2.ebuild [new file with mode: 0644]

diff --git a/net-print/poster/files/poster-20060221-fix_gs_crash.patch b/net-print/poster/files/poster-20060221-fix_gs_crash.patch
new file mode 100644 (file)
index 0000000..d2f3afd
--- /dev/null
@@ -0,0 +1,47 @@
+Source: http://pkgs.fedoraproject.org/cgit/rpms/poster.git/plain/poster.fixes_gs_crash.patch
+See also https://bugs.gentoo.org/show_bug.cgi?id=471238
+
+--- a/poster.c 2006-02-22 13:27:39.000000000 +0100
++++ b/poster.c 2012-11-17 01:30:45.303051611 +0100
+@@ -856,21 +856,13 @@
+       int row, col, page;
+       printprolog();
+-      for ( page = 0; page < number_pages; page++ )
+-      {
+-              printf( "/print_content_of_complete_page_%d\n", page);
+-              printf( "{\n");
+-              printfile (page);
+-              printf( "} bind def\n\n");
+-      
+               if ( pages == NULL )
+-              {
++              for ( page = 0; page < number_pages; page++ )
+                       for (row = 1; row <= nrows; row++)
+                               for (col = 1; col <= ncols; col++)
+                                       tile( row, col, page);
+-              }
+               else
+-              {
++              for ( page = 0; page < number_pages; page++ )
+                       for ( row = 0; row < pages_length; row++ )
+                       {
+                               int p = pages[ row ]-1;
+@@ -878,8 +870,6 @@
+                                       fprintf( stderr, "Warning: page index out of range: %d\n", p+1 );
+                               tile( p/ncols+1, p%ncols+1, page );
+                       }
+-              }
+-      }
+       printf ("%%%%EOF\n");
+       if (tail_cntl_D)
+@@ -1027,7 +1017,7 @@
+       printf ("\n%%%%Page: (%d,%d) %d\n", pagetoprint+1, ((row-1)*ncols+col), page);
+       printf ("%d %d tileprolog\n", row, col);
+       printf ("%%%%BeginDocument: %s\n", infile);
+-      printf( "print_content_of_complete_page_%d\n", pagetoprint);
++      printfile (pagetoprint);        
+       printf ("%%%%EndDocument\n");
+       printf ("tileepilog\n");
diff --git a/net-print/poster/poster-20060221-r2.ebuild b/net-print/poster/poster-20060221-r2.ebuild
new file mode 100644 (file)
index 0000000..8d50760
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="Small utility for making a poster from an EPS file or a one-page PS document"
+SRC_URI="mirror://kde/printing/${P}.tar.bz2"
+HOMEPAGE="https://printing.kde.org/downloads"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+PATCHES=(
+       "${FILESDIR}/${P}-fix_gs_crash.patch"
+       "${FILESDIR}/${P}-fix_duplicate_DocumentMedia.patch"
+)
+
+src_compile(){
+       $(tc-getCC) ${CFLAGS} ${LDFLAGS} ${PN}.c -lm -o ${PN} || die
+}
+
+src_install() {
+       dobin ${PN}
+       doman ${PN}.1
+       dodoc README ChangeLog
+}