summaryrefslogtreecommitdiff
path: root/media-libs/netpbm
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-31 20:59:14 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-31 20:59:14 +0100
commite748ba9741f6540f4675c23e3e37b73e822c13a4 (patch)
tree23dece8beabb3a3d7c6c0273b0eb40b21c62a889 /media-libs/netpbm
parent908778078736bd36f7a60a2d576d415cb8e000fa (diff)
gentoo resync : 31.05.2021
Diffstat (limited to 'media-libs/netpbm')
-rw-r--r--media-libs/netpbm/Manifest5
-rw-r--r--media-libs/netpbm/files/netpbm-10.86.22-fix-ps-test.patch506
-rw-r--r--media-libs/netpbm/netpbm-10.86.22.ebuild (renamed from media-libs/netpbm/netpbm-10.86.21.ebuild)9
3 files changed, 516 insertions, 4 deletions
diff --git a/media-libs/netpbm/Manifest b/media-libs/netpbm/Manifest
index ba5a1e7db82c..1729c24ba1d2 100644
--- a/media-libs/netpbm/Manifest
+++ b/media-libs/netpbm/Manifest
@@ -10,10 +10,11 @@ AUX netpbm-10.86.21-build.patch 2319 BLAKE2B b22150c8683790c9ac31abc00b8f3f5b55c
AUX netpbm-10.86.21-format-security.patch 730 BLAKE2B 2957d10c75264688a47a6b42a43915c4a29e97c8c097008d30adcb9783a90575bc7526121dea02d9016eb456dfbd08bd06cb2a76d22eef36620223be266dcb06 SHA512 e7b90662d8f2bb786bc0473151c949c6cb1d467e122114b5d4c8018e4b8cf3b6b2dc49a1a8b1deae95706b81d8d61bee38506b6deb82eb30d40762d4d8e6d934
AUX netpbm-10.86.21-misc-deps.patch 1565 BLAKE2B a4d629ea9fe01efc45c799dac4bd3764368be33f264929bdc338bb724ace03471949467e5c84144636a9f4ee9130395dad77e23aa6686998bf9700dbde224cbf SHA512 f274ede7d11ed0f2a1825a4412a52fd9e30f5caf470c6111b606a87f1e67b16278c9f2a901d512ea3516ba033e30a3c08386cc5af1a555f868b7d7175fbfeed0
AUX netpbm-10.86.21-test.patch 331 BLAKE2B 59451b2f1632afdd8e84bcec0ef91e0589604706b373281bf4963385fe971991711cc6ed4f169cc45aa460ac1db20de69039b137da1a2ec3d6cb82b60ae5f745 SHA512 e5c1a88cc03e227c7a7a01e9586ceacaf24a6752f4285f228b0176a8a12a6a9ac83d8ce1c5965e8f56ab652b5e42aa2cd535f1e121449fe668312b7e49720e4f
+AUX netpbm-10.86.22-fix-ps-test.patch 15448 BLAKE2B cfe77600197fc39ef0be0ed793f5181db57fd718a6fed268a8afb2fd2b5afab404c3be3c89dc25d178f8fe2edc4d386e33f22f7b3bc826e9c90307ef3895830f SHA512 a521c771d2384cb86d87b4efdf05e0835adcbefb84d4e66e744b2f8bc40df5358f20c4824dce5a942ccc24b18168276278d65e8e9a529b7c09b157b3e02438bb
DIST netpbm-10.70.00.tar.xz 2621612 BLAKE2B 2b07d130de0afeb3c1df32c6d267bc6bd13d4f556988cb7784b51941d81de1ad4f3381a0788eec6309bc6c024a21eb273a5f00726f6bb9a8ecb87f547678fc77 SHA512 f70d6dd79ce813f9fc4935d382b50bd3cecdf02c324b0f012056e56e33f24b621e8c1b3d054c6f470d437d0d793593de95eaa9724055d59c342228398a40f0b4
DIST netpbm-10.76.00.tar.xz 2657184 BLAKE2B b8d82268ba50881fab10bca00ea408afa39096f4f9c079b523d8e28ce62301797ee50f55c84f85a6d832b723da7449531e725bf60a4a89975c51382b2cbc4a94 SHA512 234a5616a7631a8eb70817bb88ed509ddddfce93f71739654ef78a2735245b268c391adb49b514ed883569c9fc6ea9c3eeed10aa7898c02b797fee5249b11cf3
-DIST netpbm-10.86.21.tar.xz 3768736 BLAKE2B 19d641f3519f55d737aa6cd22f60847b2b241f71134bc7f9fa558e681cbffb1bff53f16e4d89e7a85b20b86e0bf0f4d9c341dde656ca07a7bc20adc94e811e36 SHA512 caa6c18039be72c47419b3ef60b64e0a04123752beb27bab178adcbb48e5311da05b422205f52c784149bb0636be1e3155e6bbf7703ec5c5775cb9981de1008e
+DIST netpbm-10.86.22.tar.xz 3696588 BLAKE2B eabc11b4928681f2d96c8b6da1e23284868d7ba2f610f496d1ddf5b6ceb34c991160780f79c69b2c905e5210b024a1a5868656b89e23d6b63e587ce0cd70a950 SHA512 5840d0e88158ac77be7dfc5430e696701a740d56c98efdaf02b3c4e92bdf10268572ef0087b3bf263937073e0fbda3183aa7ed56bfe12dba30b3a3ff382bd4ff
EBUILD netpbm-10.70.00.ebuild 5382 BLAKE2B 8b5a70217742d7f87b59c16d777b040277cd582929a7ae5fdf3d7ca1287e598e5204d498a4b38cd3e54fd3411bfc2d2ead8cf2ee030ce34f0594d3894ff45f7d SHA512 bca0a73ebb20f6eb7543048c0e34eabf5c8a3652c8b43ab357ba3742b649bd1075ff97c522da910b80e9d9feb8125103eea4df5373b00cf7d44851bd9927c786
EBUILD netpbm-10.76.00.ebuild 5269 BLAKE2B c94c55e373301f8506a9ee6275865f0702c0bcc5ceeccf2b8433dedf71f99834475dd27ef5328db4c9d9eda5b7a5ce3943cd59e3e19e8e6db22bc35741cbf911 SHA512 a79ddc4ab964ed64e29d644ca33fc0bed01e0c90e96a3aa38d6a6be30039b5cff2dd86f8c5a798982df9e353d286e461ae560e8be6c98e008cfdd345927c611f
-EBUILD netpbm-10.86.21.ebuild 5500 BLAKE2B f87ef16b8f85afce5d4afa89efd0fa3a9f53cc1c0ecc522676e6cd2e8d0428ca0411e7d924363be90c6b98655e480d60d421e22dd3e4a8a683f3190ee99ce2e0 SHA512 6470eab0092d68f273aff46b160d8443769e1d769244c6a8c96665b999ac208cd1dde2efa50de398974a66dc7167d2b1664fa787c0eac319e8fb10b2c0f03b94
+EBUILD netpbm-10.86.22.ebuild 5691 BLAKE2B 1ab4be7f537991854dd4407c3d5fd96c578f7f863cd14f1ea5bc04966cdd7f180c76ad93c4842e53a0eb524b3694c7372067492423fb9ea257ccc7c619b97650 SHA512 71c694a08b5ba6187c66b2653f50779787cddba3865a364baf9b3c204e7db66f7d2b7b73089c8ec7618f9c3a58e9649de3cd36617dfea87c4a4c8874192ac64f
MISC metadata.xml 577 BLAKE2B c70497704f1a34aa7b8bcf905c05560e554957e6350b7c219ea2050815215aa926f4242ae233c9f6b11a1dd9900fcbef0956cb45d50044720769857c15808b4b SHA512 9813c0b3d04c040a54dadbcedb1e88f1d90cbff7001381f7136c84ae3909788423496c7c97242cb989c63bf5127df5196d62e75c503fb2475f14f14cfd3741f0
diff --git a/media-libs/netpbm/files/netpbm-10.86.22-fix-ps-test.patch b/media-libs/netpbm/files/netpbm-10.86.22-fix-ps-test.patch
new file mode 100644
index 000000000000..e8876120a181
--- /dev/null
+++ b/media-libs/netpbm/files/netpbm-10.86.22-fix-ps-test.patch
@@ -0,0 +1,506 @@
+postscript tests fail because of pbmtolps
+backport pbmtolps from netpbm-10.94.3, including tests
+see also bug #670362
+
+--- a/converter/pbm/pbmtolps.c
++++ b/converter/pbm/pbmtolps.c
+@@ -1,181 +1,253 @@
+-/*
+- * pbmtolps -- convert a Portable BitMap into Postscript. The
+- * output Postscript uses lines instead of the image operator to
+- * generate a (device dependent) picture which will be imaged
+- * much faster.
+- *
+- * The Postscript path length is constrained to be less that 1000
+- * points so that no limits are overrun on the Apple Laserwriter
+- * and (presumably) no other printers.
+- *
+- * To do:
+- * make sure encapsulated format is correct
+- * repitition of black-white strips
+- * make it more device independent (is this possible?)
+- *
+- * Author:
+- * George Phillips <phillips@cs.ubc.ca>
+- * Department of Computer Science
+- * University of British Columbia
+- */
+-
+-#include <string.h>
+-#include <stdio.h>
++/*=============================================================================
++ pbmtolps
++===============================================================================
++
++ Convert a PBM image to Postscript. The output Postscript uses lines instead
++ of the image operator to generate a (device dependent) picture which will be
++ imaged much faster.
++
++ The Postscript path length is constrained to be at most 1000 vertices so that
++ no limits are overrun on the Apple Laserwriter and (presumably) no other
++ printers. The typical limit is 1500. See "4.4 Path Construction" and
++ "Appendix B: Implementation Limits" in: PostScript Language Reference Manual
++ https://www.adobe.com/content/dam/acom/en/devnet/actionscript/
++ articles/psrefman.pdf
++
++ To do:
++ make sure encapsulated format is correct
++ repetition of black-white strips
++ make it more device independent (is this possible?)
++
++ Author:
++ George Phillips <phillips@cs.ubc.ca>
++ Department of Computer Science
++ University of British Columbia
++=============================================================================*/
++#include <stdbool.h>
+
++#include "pm_c_util.h"
++#include "mallocvar.h"
+ #include "nstring.h"
++#include "shhopt.h"
+ #include "pbm.h"
+
+
+-static int prev_white = -1;
+-static int prev_black = -1;
+-static char cmd = '\0';
+-static int pointcount = 2;
+-
+-#ifdef RUN
+-static int run = 1;
+-#endif
+-
+-static char
+-morepoints(char cmd, int howmany_pbmtolps) {
+- pointcount += 2;
+- if (pointcount > 1000) {
+- pointcount = 2;
+- cmd += 'm' - 'a';
+- }
+- return(cmd);
++static float const MAX_DPI = 5000;
++static float const MIN_DPI = 10;
++static unsigned int const MAX_PATH_VERTICES = 1000;
++
++
++struct CmdlineInfo {
++ /* All the information the user supplied in the command line, in a form
++ easy for the program to use.
++ */
++ const char * inputFileName; /* File name of input file */
++ unsigned int inputFileSpec; /* Input file name specified */
++ float lineWidth; /* Line width, if specified */
++ unsigned int lineWidthSpec; /* Line width specified */
++ float dpi; /* Resolution in DPI, if specified */
++ unsigned int dpiSpec; /* Resolution specified */
++};
++
++
++
++static void
++validateDpi(float const dpi) {
++
++ if (dpi > MAX_DPI || dpi < MIN_DPI)
++ pm_error("Specified DPI value out of range (%f)", dpi);
+ }
+
+
+
+-static void
+-addstrip(int const white,
+- int const black) {
+-
+- if (cmd) {
+-#ifdef RUN
+- if (white == prev_white && black == prev_black)
+- run++;
+- else {
+- if (run == 1)
+-#endif
+- printf("%d %d %c ",
+- prev_black, prev_white, morepoints(cmd, 2));
+-#ifdef RUN
+- else
+- /* of course, we need to give a new command */
+- printf("%d %d %d %c ",
+- prev_white, prev_black, run,
+- morepoints(cmd + 'f' - 'a', 2 * run));
+- run = 1;
+- }
+-#endif
++static void
++parseCommandLine(int argc,
++ const char ** const argv,
++ struct CmdlineInfo * const cmdlineP) {
++/*----------------------------------------------------------------------------
++ Parse program command line described in Unix standard form by argc
++ and argv. Return the information in the options as *cmdlineP.
++-----------------------------------------------------------------------------*/
++ optEntry * option_def; /* malloc'ed */
++ /* Instructions to OptParseOptions3 on how to parse our options. */
++ optStruct3 opt;
++
++ unsigned int option_def_index;
++
++ MALLOCARRAY_NOFAIL(option_def, 100);
++
++ option_def_index = 0; /* incremented by OPTENTRY */
++ OPTENT3(0, "linewidth", OPT_FLOAT, &cmdlineP->lineWidth,
++ &cmdlineP->lineWidthSpec, 0);
++ OPTENT3(0, "dpi", OPT_FLOAT, &cmdlineP->dpi,
++ &cmdlineP->dpiSpec, 0);
++
++ opt.opt_table = option_def;
++ opt.short_allowed = FALSE; /* We have no short (old-fashioned) options */
++ opt.allowNegNum = FALSE; /* We have no parms that are negative numbers */
++
++ pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0);
++ /* Uses and sets argc, argv, and some of *cmdlineP and others. */
++
++ if (cmdlineP->dpiSpec)
++ validateDpi(cmdlineP->dpi);
++ else
++ cmdlineP->dpi = 300;
++
++ if (argc-1 < 1)
++ cmdlineP->inputFileName = "-";
++ else {
++ if (argc-1 > 1)
++ pm_error("Program takes zero or one argument (filename). You "
++ "specified %u", argc-1);
++ else
++ cmdlineP->inputFileName = argv[1];
+ }
+
+- prev_white = white;
+- prev_black = black;
+- cmd = 'a';
++ if (cmdlineP->inputFileName[0] == '-' &&
++ cmdlineP->inputFileName[1] == '\0')
++ cmdlineP->inputFileSpec = false;
++ else
++ cmdlineP->inputFileSpec = true;
++
++ free(option_def);
+ }
+
+
+
+-static void
+-nextline(void) {
+- /* need to check run, should have an outcommand */
+- if (cmd)
+- printf("%d %d %c\n", prev_black, prev_white, morepoints('c', 3));
+- else
+- printf("%c\n", morepoints('b', 1));
+- cmd = '\0';
++static void
++validateLineWidth(float const scCols,
++ float const scRows,
++ float const lineWidth) {
++
++ if (lineWidth >= scCols || lineWidth >= scRows)
++ pm_error("Absurdly large -linewidth value (%f)", lineWidth);
+ }
+
+
+
+-int
+-main(int argc, char ** argv) {
+- FILE* fp;
+- bit* bits;
+- int row;
+- int col;
+- int rows;
+- int cols;
+- int format;
+- int white;
+- int black;
+- const char* name;
+- float dpi = 300.0;
+- float sc_rows;
+- float sc_cols;
+- int i;
+- const char* const usage = "[ -dpi n ] [ pbmfile ]";
+-
+-
+- pbm_init(&argc, argv);
+-
+- i = 1;
+- if (i < argc && streq(argv[i], "-dpi")) {
+- if (i == argc - 1)
+- pm_usage(usage);
+- sscanf(argv[i + 1], "%f", &dpi);
+- i += 2;
+- }
++static void
++doRaster(FILE * const ifP,
++ unsigned int const cols,
++ unsigned int const rows,
++ int const format,
++ FILE * const ofP) {
+
+- if (i < argc - 1)
+- pm_usage(usage);
++ bit * bitrow;
++ unsigned int row;
++ unsigned int vertexCt;
++ /* Number of vertices drawn since last stroke command */
+
+- if (i == argc) {
+- name = "noname";
+- fp = stdin;
+- } else {
+- name = argv[i];
+- fp = pm_openr(name);
+- }
+- pbm_readpbminit(fp, &cols, &rows, &format);
+- bits = pbm_allocrow(cols);
++ bitrow = pbm_allocrow(cols);
++
++ for (row = 0, vertexCt = 0; row < rows; ++row) {
++ unsigned int col;
++ bool firstRun;
+
+- sc_rows = (float)rows / dpi * 72.0;
+- sc_cols = (float)cols / dpi * 72.0;
++ firstRun = true; /* initial value */
++
++ pbm_readpbmrow(ifP, bitrow, cols, format);
++
++ /* output white-strip + black-strip sequences */
+
+- puts("%!PS-Adobe-2.0 EPSF-2.0");
+- puts("%%Creator: pbmtolps");
+- printf("%%%%Title: %s\n", name);
+- printf("%%%%BoundingBox: %d %d %d %d\n",
+- (int)(305.5 - sc_cols / 2.0),
+- (int)(395.5 - sc_rows / 2.0),
+- (int)(306.5 + sc_cols / 2.0),
+- (int)(396.5 + sc_rows / 2.0));
+- puts("%%EndComments");
+- puts("%%EndProlog");
+- puts("gsave");
+-
+- printf("%f %f translate\n", 306.0 - sc_cols / 2.0, 396.0 + sc_rows / 2.0);
+- printf("72 %f div dup neg scale\n", dpi);
+- puts("/a { 0 rmoveto 0 rlineto } def");
+- puts("/b { 0 row 1 add dup /row exch def moveto } def");
+- puts("/c { a b } def");
+- puts("/m { currentpoint stroke newpath moveto a } def");
+- puts("/n { currentpoint stroke newpath moveto b } def");
+- puts("/o { currentpoint stroke newpath moveto c } def");
+- puts("/row 0 def");
+- puts("newpath 0 0 moveto");
+-
+- for (row = 0; row < rows; row++) {
+- pbm_readpbmrow(fp, bits, cols, format);
+- /* output white-strip+black-strip sequences */
+ for (col = 0; col < cols; ) {
+- for (white = 0; col < cols && bits[col] == PBM_WHITE; col++)
+- white++;
+- for (black = 0; col < cols && bits[col] == PBM_BLACK; col++)
+- black++;
++ unsigned int whiteCt;
++ unsigned int blackCt;
++
++ for (whiteCt = 0; col < cols && bitrow[col] == PBM_WHITE; ++col)
++ ++whiteCt;
++ for (blackCt = 0; col < cols && bitrow[col] == PBM_BLACK; ++col)
++ ++blackCt;
++
++ if (blackCt > 0) {
++ if (vertexCt > MAX_PATH_VERTICES) {
++ printf("m ");
++ vertexCt = 0;
++ }
++
++ if (firstRun) {
++ printf("%u %u moveto %u 0 rlineto\n",
++ whiteCt, row, blackCt);
++ firstRun = false;
++ } else
++ printf("%u %u a\n", blackCt, whiteCt);
+
+- if (black != 0)
+- addstrip(white, black);
++ vertexCt += 2;
++ }
+ }
+- nextline();
+ }
+- puts("stroke grestore showpage");
+- puts("%%Trailer");
++ pbm_freerow(bitrow);
++}
++
++
++
++static void
++pbmtolps(FILE * const ifP,
++ FILE * const ofP,
++ struct CmdlineInfo const cmdline) {
++
++ const char * const psName =
++ cmdline.inputFileSpec ? cmdline.inputFileName : "noname";
++
++ int rows;
++ int cols;
++ int format;
++ float scRows, scCols;
++ /* Dimensions of the printed image in points */
++
++ pbm_readpbminit(ifP, &cols, &rows, &format);
++
++ scRows = (float) rows / (cmdline.dpi / 72.0);
++ scCols = (float) cols / (cmdline.dpi / 72.0);
++
++ if (cmdline.lineWidthSpec)
++ validateLineWidth(scCols, scRows, cmdline.lineWidth);
++
++ fputs("%!PS-Adobe-2.0 EPSF-2.0\n", ofP);
++ fputs("%%Creator: pbmtolps\n", ofP);
++ fprintf(ofP, "%%%%Title: %s\n", psName);
++ fprintf(ofP, "%%%%BoundingBox: %d %d %d %d\n",
++ (int)(305.5 - scCols / 2.0),
++ (int)(395.5 - scRows / 2.0),
++ (int)(306.5 + scCols / 2.0),
++ (int)(396.5 + scRows / 2.0));
++ fputs("%%EndComments\n", ofP);
++ fputs("%%EndProlog\n", ofP);
++ fputs("gsave\n", ofP);
++
++ fprintf(ofP, "%f %f translate\n",
++ 306.0 - scCols / 2.0, 396.0 + scRows / 2.0);
++ fprintf(ofP, "72 %f div dup neg scale\n", cmdline.dpi);
++
++ if (cmdline.lineWidthSpec)
++ fprintf(ofP, "%f setlinewidth\n", cmdline.lineWidth);
++
++ fputs("/a { 0 rmoveto 0 rlineto } def\n", ofP);
++ fputs("/m { currentpoint stroke newpath moveto } def\n", ofP);
++ fputs("newpath 0 0 moveto\n", ofP);
++
++ doRaster(ifP, cols, rows, format, ofP);
++
++ fputs("stroke grestore showpage\n", ofP);
++ fputs("%%Trailer\n", ofP);
++}
++
++
++
++int
++main(int argc, const char *argv[]) {
++ FILE * ifP;
++ struct CmdlineInfo cmdline;
++
++ pm_proginit(&argc, argv);
++
++ parseCommandLine(argc, argv, &cmdline);
++
++ ifP = pm_openr(cmdline.inputFileName);
++
++ pbmtolps(ifP, stdout, cmdline);
+
+- pm_close(fp);
++ pm_close(ifP);
+
+- exit(0);
++ return 0;
+ }
+--- a/test/lps-roundtrip.ok
++++ b/test/lps-roundtrip.ok
+@@ -0,0 +1 @@
++match
+--- a/test/lps-roundtrip.test
++++ b/test/lps-roundtrip.test
+@@ -0,0 +1,22 @@
++#! /bin/bash
++# This script tests: pbmtolps pstopnm
++# Also requires: gs pamdepth pamscale pnmcrop pnmpsnr
++
++# The ordinary round-trip does not work because of the way ghostscript
++# renders: a line is considered wider than a single pixel and all pixels
++# it touches are set to black if the output is PBM. To work around this,
++# we tell pstopnm to output PGM at a high resolution (=large dpi value).
++
++
++test_pgm=${tmpdir}/testgrid.pgm
++
++pamdepth 255 testgrid.pbm > ${test_pgm}
++
++pbmtolps -dpi 72 testgrid.pbm | \
++ pstopnm -dpi $((72*12)) -stdout -pgm | \
++ pnmcrop -white | pamscale -xsize=14 -ysize=16 | \
++ pnmpsnr -target=30 - ${test_pgm}
++
++# ghostscript version 8.71: pnmpsnr lumina 33.14dB
++
++rm ${test_pgm}
+--- a/test/ps-alt-roundtrip.ok
++++ b/test/ps-alt-roundtrip.ok
+@@ -1,3 +1,2 @@
+ 2425386270 41
+-2425386270 41
+ 2916080186 235
+--- a/test/ps-alt-roundtrip.test
++++ b/test/ps-alt-roundtrip.test
+@@ -1,21 +1,24 @@
+ #! /bin/bash
+-# This script tests: pbmtoepsi pbmtopsg3 pbmtolps psidtopgm pstopnm
++# This script tests: pbmtoepsi pbmtopsg3 psidtopgm pstopnm
+ # Also requires: gs pnmcrop
+
+
+ # This script is for testing alternative (or minor) utilities that
+ # read/write Postscript and encapsulated Postscript:
+-# pbmtoepsi, pbmtopsg3, pbmtolps and psidtopgm.
++# pbmtoepsi, pbmtopsg3 and psidtopgm.
+ #
+ # We keep these tests separate from those for pnmtops and pstopnm
+ # which are far more popular.
+ #
+-# pbmtopsg3 and pbmtolps produce output that require pstopnm for decoding.
++# pbmtopsg3 produces output that requires pstopnm for decoding.
++#
++# We used to test pbmtolps here, but moved it out when gs changed its
++# rendering formula.
+ #
+ # Failure message
+ ## If ps-roundtrip.test succeeds and this test fails, it is most likely
+ ## a problem with one of the alternate Postscipt utilities:
+-## pbmtoepsi, pbmtopsg3, pbmtolps or psidtopgm.
++## pbmtoepsi, pbmtopsg3, or psidtopgm.
+ ## If both tests fail it indicates a problem with pstopnm or gs.
+
+ # pstopnm does not use libnetpbm functions for output.
+@@ -33,18 +36,8 @@
+ rm ${testgrid1_ps}
+
+
+-# Test 2. Should print: 2425386270 41
+-testgrid2_ps=${tmpdir}/testgrid2.ps
+-
+-pbmtolps -dpi 72 testgrid.pbm \
+- > ${testgrid2_ps} && \
+-pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \
+- -quiet ${testgrid2_ps} -pbm | \
+- pnmcrop | cksum
+-
+-rm ${testgrid2_ps}
+
+-# Test 3. Should print: 2916080186 235
++# Test 2. Should print: 2916080186 235
+ # Output is pgm maxval=1 with black and white inverted.
+ #
+ testgrid_epsi=${tmpdir}/testgrid.epsi
+--- a/test/Test-Order
++++ b/test/Test-Order
+@@ -183,5 +183,6 @@
+
+ fiasco-roundtrip.test
+ jpeg-roundtrip.test
++lps-roundtrip.test
+ tiffcmyk-roundtrip.test
+ yuv-roundtrip.test
diff --git a/media-libs/netpbm/netpbm-10.86.21.ebuild b/media-libs/netpbm/netpbm-10.86.22.ebuild
index c729f0b7f70f..048c6e3162e1 100644
--- a/media-libs/netpbm/netpbm-10.86.21.ebuild
+++ b/media-libs/netpbm/netpbm-10.86.22.ebuild
@@ -3,11 +3,11 @@
EAPI=7
-inherit toolchain-funcs
+inherit multilib toolchain-funcs
DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats"
HOMEPAGE="http://netpbm.sourceforge.net/"
-SRC_URI="https://github.com/ceamac/netpbm-make-dist/releases/download/v10.86.21/${P}.tar.xz"
+SRC_URI="https://github.com/ceamac/netpbm-make-dist/releases/download/v${PV}/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
@@ -36,6 +36,7 @@ PATCHES=(
"${FILESDIR}"/netpbm-10.86.21-test.patch #450530
"${FILESDIR}"/netpbm-10.86.21-misc-deps.patch
"${FILESDIR}"/netpbm-10.86.21-format-security.patch #517524
+ "${FILESDIR}"/netpbm-10.86.22-fix-ps-test.patch #670362
)
netpbm_libtype() {
@@ -92,10 +93,14 @@ src_prepare() {
sed -i -r \
-e 's:(pbmtextps|pnmtops|pstopnm).*::' \
test/all-in-place.{ok,test} || die
+ sed -i -e 's:lps-roundtrip.*::' test/Test-Order || die
sed -i -e '/^$/d' test/all-in-place.ok || die
sed -i '2iexit 80' test/ps-{alt-,flate-,}roundtrip.test || die
fi
+ # the new postscript test needs +x
+ chmod +x test/lps-roundtrip.test
+
# Do not test png if not built
if ! use png ; then
sed -i -r \