1 |
commit: 5ddd362b77fa5ba98bb4e09db554afc653558206 |
2 |
Author: Viorel Munteanu <ceamac.paragon <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu May 27 18:15:26 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 31 08:17:20 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ddd362b |
7 |
|
8 |
media-libs/netpbm: new version 10.86.22 |
9 |
|
10 |
Also backported a fix from 10.94.3 for tests failing with USE=postfix |
11 |
Closes: https://bugs.gentoo.org/670362 |
12 |
Package-Manager: Portage-3.0.18, Repoman-3.0.2 |
13 |
Signed-off-by: Viorel Munteanu <ceamac.paragon <AT> gmail.com> |
14 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
15 |
|
16 |
media-libs/netpbm/Manifest | 1 + |
17 |
.../netpbm/files/netpbm-10.86.22-fix-ps-test.patch | 506 +++++++++++++++++++++ |
18 |
media-libs/netpbm/netpbm-10.86.22.ebuild | 211 +++++++++ |
19 |
3 files changed, 718 insertions(+) |
20 |
|
21 |
diff --git a/media-libs/netpbm/Manifest b/media-libs/netpbm/Manifest |
22 |
index be3d0a3dff3..ddc99b62a12 100644 |
23 |
--- a/media-libs/netpbm/Manifest |
24 |
+++ b/media-libs/netpbm/Manifest |
25 |
@@ -1,3 +1,4 @@ |
26 |
DIST netpbm-10.70.00.tar.xz 2621612 BLAKE2B 2b07d130de0afeb3c1df32c6d267bc6bd13d4f556988cb7784b51941d81de1ad4f3381a0788eec6309bc6c024a21eb273a5f00726f6bb9a8ecb87f547678fc77 SHA512 f70d6dd79ce813f9fc4935d382b50bd3cecdf02c324b0f012056e56e33f24b621e8c1b3d054c6f470d437d0d793593de95eaa9724055d59c342228398a40f0b4 |
27 |
DIST netpbm-10.76.00.tar.xz 2657184 BLAKE2B b8d82268ba50881fab10bca00ea408afa39096f4f9c079b523d8e28ce62301797ee50f55c84f85a6d832b723da7449531e725bf60a4a89975c51382b2cbc4a94 SHA512 234a5616a7631a8eb70817bb88ed509ddddfce93f71739654ef78a2735245b268c391adb49b514ed883569c9fc6ea9c3eeed10aa7898c02b797fee5249b11cf3 |
28 |
DIST netpbm-10.86.21.tar.xz 3768736 BLAKE2B 19d641f3519f55d737aa6cd22f60847b2b241f71134bc7f9fa558e681cbffb1bff53f16e4d89e7a85b20b86e0bf0f4d9c341dde656ca07a7bc20adc94e811e36 SHA512 caa6c18039be72c47419b3ef60b64e0a04123752beb27bab178adcbb48e5311da05b422205f52c784149bb0636be1e3155e6bbf7703ec5c5775cb9981de1008e |
29 |
+DIST netpbm-10.86.22.tar.xz 3696588 BLAKE2B eabc11b4928681f2d96c8b6da1e23284868d7ba2f610f496d1ddf5b6ceb34c991160780f79c69b2c905e5210b024a1a5868656b89e23d6b63e587ce0cd70a950 SHA512 5840d0e88158ac77be7dfc5430e696701a740d56c98efdaf02b3c4e92bdf10268572ef0087b3bf263937073e0fbda3183aa7ed56bfe12dba30b3a3ff382bd4ff |
30 |
|
31 |
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 |
32 |
new file mode 100644 |
33 |
index 00000000000..e8876120a18 |
34 |
--- /dev/null |
35 |
+++ b/media-libs/netpbm/files/netpbm-10.86.22-fix-ps-test.patch |
36 |
@@ -0,0 +1,506 @@ |
37 |
+postscript tests fail because of pbmtolps |
38 |
+backport pbmtolps from netpbm-10.94.3, including tests |
39 |
+see also bug #670362 |
40 |
+ |
41 |
+--- a/converter/pbm/pbmtolps.c |
42 |
++++ b/converter/pbm/pbmtolps.c |
43 |
+@@ -1,181 +1,253 @@ |
44 |
+-/* |
45 |
+- * pbmtolps -- convert a Portable BitMap into Postscript. The |
46 |
+- * output Postscript uses lines instead of the image operator to |
47 |
+- * generate a (device dependent) picture which will be imaged |
48 |
+- * much faster. |
49 |
+- * |
50 |
+- * The Postscript path length is constrained to be less that 1000 |
51 |
+- * points so that no limits are overrun on the Apple Laserwriter |
52 |
+- * and (presumably) no other printers. |
53 |
+- * |
54 |
+- * To do: |
55 |
+- * make sure encapsulated format is correct |
56 |
+- * repitition of black-white strips |
57 |
+- * make it more device independent (is this possible?) |
58 |
+- * |
59 |
+- * Author: |
60 |
+- * George Phillips <phillips@××××××.ca> |
61 |
+- * Department of Computer Science |
62 |
+- * University of British Columbia |
63 |
+- */ |
64 |
+- |
65 |
+-#include <string.h> |
66 |
+-#include <stdio.h> |
67 |
++/*============================================================================= |
68 |
++ pbmtolps |
69 |
++=============================================================================== |
70 |
++ |
71 |
++ Convert a PBM image to Postscript. The output Postscript uses lines instead |
72 |
++ of the image operator to generate a (device dependent) picture which will be |
73 |
++ imaged much faster. |
74 |
++ |
75 |
++ The Postscript path length is constrained to be at most 1000 vertices so that |
76 |
++ no limits are overrun on the Apple Laserwriter and (presumably) no other |
77 |
++ printers. The typical limit is 1500. See "4.4 Path Construction" and |
78 |
++ "Appendix B: Implementation Limits" in: PostScript Language Reference Manual |
79 |
++ https://www.adobe.com/content/dam/acom/en/devnet/actionscript/ |
80 |
++ articles/psrefman.pdf |
81 |
++ |
82 |
++ To do: |
83 |
++ make sure encapsulated format is correct |
84 |
++ repetition of black-white strips |
85 |
++ make it more device independent (is this possible?) |
86 |
++ |
87 |
++ Author: |
88 |
++ George Phillips <phillips@××××××.ca> |
89 |
++ Department of Computer Science |
90 |
++ University of British Columbia |
91 |
++=============================================================================*/ |
92 |
++#include <stdbool.h> |
93 |
+ |
94 |
++#include "pm_c_util.h" |
95 |
++#include "mallocvar.h" |
96 |
+ #include "nstring.h" |
97 |
++#include "shhopt.h" |
98 |
+ #include "pbm.h" |
99 |
+ |
100 |
+ |
101 |
+-static int prev_white = -1; |
102 |
+-static int prev_black = -1; |
103 |
+-static char cmd = '\0'; |
104 |
+-static int pointcount = 2; |
105 |
+- |
106 |
+-#ifdef RUN |
107 |
+-static int run = 1; |
108 |
+-#endif |
109 |
+- |
110 |
+-static char |
111 |
+-morepoints(char cmd, int howmany_pbmtolps) { |
112 |
+- pointcount += 2; |
113 |
+- if (pointcount > 1000) { |
114 |
+- pointcount = 2; |
115 |
+- cmd += 'm' - 'a'; |
116 |
+- } |
117 |
+- return(cmd); |
118 |
++static float const MAX_DPI = 5000; |
119 |
++static float const MIN_DPI = 10; |
120 |
++static unsigned int const MAX_PATH_VERTICES = 1000; |
121 |
++ |
122 |
++ |
123 |
++struct CmdlineInfo { |
124 |
++ /* All the information the user supplied in the command line, in a form |
125 |
++ easy for the program to use. |
126 |
++ */ |
127 |
++ const char * inputFileName; /* File name of input file */ |
128 |
++ unsigned int inputFileSpec; /* Input file name specified */ |
129 |
++ float lineWidth; /* Line width, if specified */ |
130 |
++ unsigned int lineWidthSpec; /* Line width specified */ |
131 |
++ float dpi; /* Resolution in DPI, if specified */ |
132 |
++ unsigned int dpiSpec; /* Resolution specified */ |
133 |
++}; |
134 |
++ |
135 |
++ |
136 |
++ |
137 |
++static void |
138 |
++validateDpi(float const dpi) { |
139 |
++ |
140 |
++ if (dpi > MAX_DPI || dpi < MIN_DPI) |
141 |
++ pm_error("Specified DPI value out of range (%f)", dpi); |
142 |
+ } |
143 |
+ |
144 |
+ |
145 |
+ |
146 |
+-static void |
147 |
+-addstrip(int const white, |
148 |
+- int const black) { |
149 |
+- |
150 |
+- if (cmd) { |
151 |
+-#ifdef RUN |
152 |
+- if (white == prev_white && black == prev_black) |
153 |
+- run++; |
154 |
+- else { |
155 |
+- if (run == 1) |
156 |
+-#endif |
157 |
+- printf("%d %d %c ", |
158 |
+- prev_black, prev_white, morepoints(cmd, 2)); |
159 |
+-#ifdef RUN |
160 |
+- else |
161 |
+- /* of course, we need to give a new command */ |
162 |
+- printf("%d %d %d %c ", |
163 |
+- prev_white, prev_black, run, |
164 |
+- morepoints(cmd + 'f' - 'a', 2 * run)); |
165 |
+- run = 1; |
166 |
+- } |
167 |
+-#endif |
168 |
++static void |
169 |
++parseCommandLine(int argc, |
170 |
++ const char ** const argv, |
171 |
++ struct CmdlineInfo * const cmdlineP) { |
172 |
++/*---------------------------------------------------------------------------- |
173 |
++ Parse program command line described in Unix standard form by argc |
174 |
++ and argv. Return the information in the options as *cmdlineP. |
175 |
++-----------------------------------------------------------------------------*/ |
176 |
++ optEntry * option_def; /* malloc'ed */ |
177 |
++ /* Instructions to OptParseOptions3 on how to parse our options. */ |
178 |
++ optStruct3 opt; |
179 |
++ |
180 |
++ unsigned int option_def_index; |
181 |
++ |
182 |
++ MALLOCARRAY_NOFAIL(option_def, 100); |
183 |
++ |
184 |
++ option_def_index = 0; /* incremented by OPTENTRY */ |
185 |
++ OPTENT3(0, "linewidth", OPT_FLOAT, &cmdlineP->lineWidth, |
186 |
++ &cmdlineP->lineWidthSpec, 0); |
187 |
++ OPTENT3(0, "dpi", OPT_FLOAT, &cmdlineP->dpi, |
188 |
++ &cmdlineP->dpiSpec, 0); |
189 |
++ |
190 |
++ opt.opt_table = option_def; |
191 |
++ opt.short_allowed = FALSE; /* We have no short (old-fashioned) options */ |
192 |
++ opt.allowNegNum = FALSE; /* We have no parms that are negative numbers */ |
193 |
++ |
194 |
++ pm_optParseOptions3(&argc, (char **)argv, opt, sizeof(opt), 0); |
195 |
++ /* Uses and sets argc, argv, and some of *cmdlineP and others. */ |
196 |
++ |
197 |
++ if (cmdlineP->dpiSpec) |
198 |
++ validateDpi(cmdlineP->dpi); |
199 |
++ else |
200 |
++ cmdlineP->dpi = 300; |
201 |
++ |
202 |
++ if (argc-1 < 1) |
203 |
++ cmdlineP->inputFileName = "-"; |
204 |
++ else { |
205 |
++ if (argc-1 > 1) |
206 |
++ pm_error("Program takes zero or one argument (filename). You " |
207 |
++ "specified %u", argc-1); |
208 |
++ else |
209 |
++ cmdlineP->inputFileName = argv[1]; |
210 |
+ } |
211 |
+ |
212 |
+- prev_white = white; |
213 |
+- prev_black = black; |
214 |
+- cmd = 'a'; |
215 |
++ if (cmdlineP->inputFileName[0] == '-' && |
216 |
++ cmdlineP->inputFileName[1] == '\0') |
217 |
++ cmdlineP->inputFileSpec = false; |
218 |
++ else |
219 |
++ cmdlineP->inputFileSpec = true; |
220 |
++ |
221 |
++ free(option_def); |
222 |
+ } |
223 |
+ |
224 |
+ |
225 |
+ |
226 |
+-static void |
227 |
+-nextline(void) { |
228 |
+- /* need to check run, should have an outcommand */ |
229 |
+- if (cmd) |
230 |
+- printf("%d %d %c\n", prev_black, prev_white, morepoints('c', 3)); |
231 |
+- else |
232 |
+- printf("%c\n", morepoints('b', 1)); |
233 |
+- cmd = '\0'; |
234 |
++static void |
235 |
++validateLineWidth(float const scCols, |
236 |
++ float const scRows, |
237 |
++ float const lineWidth) { |
238 |
++ |
239 |
++ if (lineWidth >= scCols || lineWidth >= scRows) |
240 |
++ pm_error("Absurdly large -linewidth value (%f)", lineWidth); |
241 |
+ } |
242 |
+ |
243 |
+ |
244 |
+ |
245 |
+-int |
246 |
+-main(int argc, char ** argv) { |
247 |
+- FILE* fp; |
248 |
+- bit* bits; |
249 |
+- int row; |
250 |
+- int col; |
251 |
+- int rows; |
252 |
+- int cols; |
253 |
+- int format; |
254 |
+- int white; |
255 |
+- int black; |
256 |
+- const char* name; |
257 |
+- float dpi = 300.0; |
258 |
+- float sc_rows; |
259 |
+- float sc_cols; |
260 |
+- int i; |
261 |
+- const char* const usage = "[ -dpi n ] [ pbmfile ]"; |
262 |
+- |
263 |
+- |
264 |
+- pbm_init(&argc, argv); |
265 |
+- |
266 |
+- i = 1; |
267 |
+- if (i < argc && streq(argv[i], "-dpi")) { |
268 |
+- if (i == argc - 1) |
269 |
+- pm_usage(usage); |
270 |
+- sscanf(argv[i + 1], "%f", &dpi); |
271 |
+- i += 2; |
272 |
+- } |
273 |
++static void |
274 |
++doRaster(FILE * const ifP, |
275 |
++ unsigned int const cols, |
276 |
++ unsigned int const rows, |
277 |
++ int const format, |
278 |
++ FILE * const ofP) { |
279 |
+ |
280 |
+- if (i < argc - 1) |
281 |
+- pm_usage(usage); |
282 |
++ bit * bitrow; |
283 |
++ unsigned int row; |
284 |
++ unsigned int vertexCt; |
285 |
++ /* Number of vertices drawn since last stroke command */ |
286 |
+ |
287 |
+- if (i == argc) { |
288 |
+- name = "noname"; |
289 |
+- fp = stdin; |
290 |
+- } else { |
291 |
+- name = argv[i]; |
292 |
+- fp = pm_openr(name); |
293 |
+- } |
294 |
+- pbm_readpbminit(fp, &cols, &rows, &format); |
295 |
+- bits = pbm_allocrow(cols); |
296 |
++ bitrow = pbm_allocrow(cols); |
297 |
++ |
298 |
++ for (row = 0, vertexCt = 0; row < rows; ++row) { |
299 |
++ unsigned int col; |
300 |
++ bool firstRun; |
301 |
+ |
302 |
+- sc_rows = (float)rows / dpi * 72.0; |
303 |
+- sc_cols = (float)cols / dpi * 72.0; |
304 |
++ firstRun = true; /* initial value */ |
305 |
++ |
306 |
++ pbm_readpbmrow(ifP, bitrow, cols, format); |
307 |
++ |
308 |
++ /* output white-strip + black-strip sequences */ |
309 |
+ |
310 |
+- puts("%!PS-Adobe-2.0 EPSF-2.0"); |
311 |
+- puts("%%Creator: pbmtolps"); |
312 |
+- printf("%%%%Title: %s\n", name); |
313 |
+- printf("%%%%BoundingBox: %d %d %d %d\n", |
314 |
+- (int)(305.5 - sc_cols / 2.0), |
315 |
+- (int)(395.5 - sc_rows / 2.0), |
316 |
+- (int)(306.5 + sc_cols / 2.0), |
317 |
+- (int)(396.5 + sc_rows / 2.0)); |
318 |
+- puts("%%EndComments"); |
319 |
+- puts("%%EndProlog"); |
320 |
+- puts("gsave"); |
321 |
+- |
322 |
+- printf("%f %f translate\n", 306.0 - sc_cols / 2.0, 396.0 + sc_rows / 2.0); |
323 |
+- printf("72 %f div dup neg scale\n", dpi); |
324 |
+- puts("/a { 0 rmoveto 0 rlineto } def"); |
325 |
+- puts("/b { 0 row 1 add dup /row exch def moveto } def"); |
326 |
+- puts("/c { a b } def"); |
327 |
+- puts("/m { currentpoint stroke newpath moveto a } def"); |
328 |
+- puts("/n { currentpoint stroke newpath moveto b } def"); |
329 |
+- puts("/o { currentpoint stroke newpath moveto c } def"); |
330 |
+- puts("/row 0 def"); |
331 |
+- puts("newpath 0 0 moveto"); |
332 |
+- |
333 |
+- for (row = 0; row < rows; row++) { |
334 |
+- pbm_readpbmrow(fp, bits, cols, format); |
335 |
+- /* output white-strip+black-strip sequences */ |
336 |
+ for (col = 0; col < cols; ) { |
337 |
+- for (white = 0; col < cols && bits[col] == PBM_WHITE; col++) |
338 |
+- white++; |
339 |
+- for (black = 0; col < cols && bits[col] == PBM_BLACK; col++) |
340 |
+- black++; |
341 |
++ unsigned int whiteCt; |
342 |
++ unsigned int blackCt; |
343 |
++ |
344 |
++ for (whiteCt = 0; col < cols && bitrow[col] == PBM_WHITE; ++col) |
345 |
++ ++whiteCt; |
346 |
++ for (blackCt = 0; col < cols && bitrow[col] == PBM_BLACK; ++col) |
347 |
++ ++blackCt; |
348 |
++ |
349 |
++ if (blackCt > 0) { |
350 |
++ if (vertexCt > MAX_PATH_VERTICES) { |
351 |
++ printf("m "); |
352 |
++ vertexCt = 0; |
353 |
++ } |
354 |
++ |
355 |
++ if (firstRun) { |
356 |
++ printf("%u %u moveto %u 0 rlineto\n", |
357 |
++ whiteCt, row, blackCt); |
358 |
++ firstRun = false; |
359 |
++ } else |
360 |
++ printf("%u %u a\n", blackCt, whiteCt); |
361 |
+ |
362 |
+- if (black != 0) |
363 |
+- addstrip(white, black); |
364 |
++ vertexCt += 2; |
365 |
++ } |
366 |
+ } |
367 |
+- nextline(); |
368 |
+ } |
369 |
+- puts("stroke grestore showpage"); |
370 |
+- puts("%%Trailer"); |
371 |
++ pbm_freerow(bitrow); |
372 |
++} |
373 |
++ |
374 |
++ |
375 |
++ |
376 |
++static void |
377 |
++pbmtolps(FILE * const ifP, |
378 |
++ FILE * const ofP, |
379 |
++ struct CmdlineInfo const cmdline) { |
380 |
++ |
381 |
++ const char * const psName = |
382 |
++ cmdline.inputFileSpec ? cmdline.inputFileName : "noname"; |
383 |
++ |
384 |
++ int rows; |
385 |
++ int cols; |
386 |
++ int format; |
387 |
++ float scRows, scCols; |
388 |
++ /* Dimensions of the printed image in points */ |
389 |
++ |
390 |
++ pbm_readpbminit(ifP, &cols, &rows, &format); |
391 |
++ |
392 |
++ scRows = (float) rows / (cmdline.dpi / 72.0); |
393 |
++ scCols = (float) cols / (cmdline.dpi / 72.0); |
394 |
++ |
395 |
++ if (cmdline.lineWidthSpec) |
396 |
++ validateLineWidth(scCols, scRows, cmdline.lineWidth); |
397 |
++ |
398 |
++ fputs("%!PS-Adobe-2.0 EPSF-2.0\n", ofP); |
399 |
++ fputs("%%Creator: pbmtolps\n", ofP); |
400 |
++ fprintf(ofP, "%%%%Title: %s\n", psName); |
401 |
++ fprintf(ofP, "%%%%BoundingBox: %d %d %d %d\n", |
402 |
++ (int)(305.5 - scCols / 2.0), |
403 |
++ (int)(395.5 - scRows / 2.0), |
404 |
++ (int)(306.5 + scCols / 2.0), |
405 |
++ (int)(396.5 + scRows / 2.0)); |
406 |
++ fputs("%%EndComments\n", ofP); |
407 |
++ fputs("%%EndProlog\n", ofP); |
408 |
++ fputs("gsave\n", ofP); |
409 |
++ |
410 |
++ fprintf(ofP, "%f %f translate\n", |
411 |
++ 306.0 - scCols / 2.0, 396.0 + scRows / 2.0); |
412 |
++ fprintf(ofP, "72 %f div dup neg scale\n", cmdline.dpi); |
413 |
++ |
414 |
++ if (cmdline.lineWidthSpec) |
415 |
++ fprintf(ofP, "%f setlinewidth\n", cmdline.lineWidth); |
416 |
++ |
417 |
++ fputs("/a { 0 rmoveto 0 rlineto } def\n", ofP); |
418 |
++ fputs("/m { currentpoint stroke newpath moveto } def\n", ofP); |
419 |
++ fputs("newpath 0 0 moveto\n", ofP); |
420 |
++ |
421 |
++ doRaster(ifP, cols, rows, format, ofP); |
422 |
++ |
423 |
++ fputs("stroke grestore showpage\n", ofP); |
424 |
++ fputs("%%Trailer\n", ofP); |
425 |
++} |
426 |
++ |
427 |
++ |
428 |
++ |
429 |
++int |
430 |
++main(int argc, const char *argv[]) { |
431 |
++ FILE * ifP; |
432 |
++ struct CmdlineInfo cmdline; |
433 |
++ |
434 |
++ pm_proginit(&argc, argv); |
435 |
++ |
436 |
++ parseCommandLine(argc, argv, &cmdline); |
437 |
++ |
438 |
++ ifP = pm_openr(cmdline.inputFileName); |
439 |
++ |
440 |
++ pbmtolps(ifP, stdout, cmdline); |
441 |
+ |
442 |
+- pm_close(fp); |
443 |
++ pm_close(ifP); |
444 |
+ |
445 |
+- exit(0); |
446 |
++ return 0; |
447 |
+ } |
448 |
+--- a/test/lps-roundtrip.ok |
449 |
++++ b/test/lps-roundtrip.ok |
450 |
+@@ -0,0 +1 @@ |
451 |
++match |
452 |
+--- a/test/lps-roundtrip.test |
453 |
++++ b/test/lps-roundtrip.test |
454 |
+@@ -0,0 +1,22 @@ |
455 |
++#! /bin/bash |
456 |
++# This script tests: pbmtolps pstopnm |
457 |
++# Also requires: gs pamdepth pamscale pnmcrop pnmpsnr |
458 |
++ |
459 |
++# The ordinary round-trip does not work because of the way ghostscript |
460 |
++# renders: a line is considered wider than a single pixel and all pixels |
461 |
++# it touches are set to black if the output is PBM. To work around this, |
462 |
++# we tell pstopnm to output PGM at a high resolution (=large dpi value). |
463 |
++ |
464 |
++ |
465 |
++test_pgm=${tmpdir}/testgrid.pgm |
466 |
++ |
467 |
++pamdepth 255 testgrid.pbm > ${test_pgm} |
468 |
++ |
469 |
++pbmtolps -dpi 72 testgrid.pbm | \ |
470 |
++ pstopnm -dpi $((72*12)) -stdout -pgm | \ |
471 |
++ pnmcrop -white | pamscale -xsize=14 -ysize=16 | \ |
472 |
++ pnmpsnr -target=30 - ${test_pgm} |
473 |
++ |
474 |
++# ghostscript version 8.71: pnmpsnr lumina 33.14dB |
475 |
++ |
476 |
++rm ${test_pgm} |
477 |
+--- a/test/ps-alt-roundtrip.ok |
478 |
++++ b/test/ps-alt-roundtrip.ok |
479 |
+@@ -1,3 +1,2 @@ |
480 |
+ 2425386270 41 |
481 |
+-2425386270 41 |
482 |
+ 2916080186 235 |
483 |
+--- a/test/ps-alt-roundtrip.test |
484 |
++++ b/test/ps-alt-roundtrip.test |
485 |
+@@ -1,21 +1,24 @@ |
486 |
+ #! /bin/bash |
487 |
+-# This script tests: pbmtoepsi pbmtopsg3 pbmtolps psidtopgm pstopnm |
488 |
++# This script tests: pbmtoepsi pbmtopsg3 psidtopgm pstopnm |
489 |
+ # Also requires: gs pnmcrop |
490 |
+ |
491 |
+ |
492 |
+ # This script is for testing alternative (or minor) utilities that |
493 |
+ # read/write Postscript and encapsulated Postscript: |
494 |
+-# pbmtoepsi, pbmtopsg3, pbmtolps and psidtopgm. |
495 |
++# pbmtoepsi, pbmtopsg3 and psidtopgm. |
496 |
+ # |
497 |
+ # We keep these tests separate from those for pnmtops and pstopnm |
498 |
+ # which are far more popular. |
499 |
+ # |
500 |
+-# pbmtopsg3 and pbmtolps produce output that require pstopnm for decoding. |
501 |
++# pbmtopsg3 produces output that requires pstopnm for decoding. |
502 |
++# |
503 |
++# We used to test pbmtolps here, but moved it out when gs changed its |
504 |
++# rendering formula. |
505 |
+ # |
506 |
+ # Failure message |
507 |
+ ## If ps-roundtrip.test succeeds and this test fails, it is most likely |
508 |
+ ## a problem with one of the alternate Postscipt utilities: |
509 |
+-## pbmtoepsi, pbmtopsg3, pbmtolps or psidtopgm. |
510 |
++## pbmtoepsi, pbmtopsg3, or psidtopgm. |
511 |
+ ## If both tests fail it indicates a problem with pstopnm or gs. |
512 |
+ |
513 |
+ # pstopnm does not use libnetpbm functions for output. |
514 |
+@@ -33,18 +36,8 @@ |
515 |
+ rm ${testgrid1_ps} |
516 |
+ |
517 |
+ |
518 |
+-# Test 2. Should print: 2425386270 41 |
519 |
+-testgrid2_ps=${tmpdir}/testgrid2.ps |
520 |
+- |
521 |
+-pbmtolps -dpi 72 testgrid.pbm \ |
522 |
+- > ${testgrid2_ps} && \ |
523 |
+-pstopnm -xborder=0 -yborder=0 -dpi=72 -stdout \ |
524 |
+- -quiet ${testgrid2_ps} -pbm | \ |
525 |
+- pnmcrop | cksum |
526 |
+- |
527 |
+-rm ${testgrid2_ps} |
528 |
+ |
529 |
+-# Test 3. Should print: 2916080186 235 |
530 |
++# Test 2. Should print: 2916080186 235 |
531 |
+ # Output is pgm maxval=1 with black and white inverted. |
532 |
+ # |
533 |
+ testgrid_epsi=${tmpdir}/testgrid.epsi |
534 |
+--- a/test/Test-Order |
535 |
++++ b/test/Test-Order |
536 |
+@@ -183,5 +183,6 @@ |
537 |
+ |
538 |
+ fiasco-roundtrip.test |
539 |
+ jpeg-roundtrip.test |
540 |
++lps-roundtrip.test |
541 |
+ tiffcmyk-roundtrip.test |
542 |
+ yuv-roundtrip.test |
543 |
|
544 |
diff --git a/media-libs/netpbm/netpbm-10.86.22.ebuild b/media-libs/netpbm/netpbm-10.86.22.ebuild |
545 |
new file mode 100644 |
546 |
index 00000000000..048c6e3162e |
547 |
--- /dev/null |
548 |
+++ b/media-libs/netpbm/netpbm-10.86.22.ebuild |
549 |
@@ -0,0 +1,211 @@ |
550 |
+# Copyright 1999-2021 Gentoo Authors |
551 |
+# Distributed under the terms of the GNU General Public License v2 |
552 |
+ |
553 |
+EAPI=7 |
554 |
+ |
555 |
+inherit multilib toolchain-funcs |
556 |
+ |
557 |
+DESCRIPTION="A set of utilities for converting to/from the netpbm (and related) formats" |
558 |
+HOMEPAGE="http://netpbm.sourceforge.net/" |
559 |
+SRC_URI="https://github.com/ceamac/netpbm-make-dist/releases/download/v${PV}/${P}.tar.xz" |
560 |
+ |
561 |
+LICENSE="GPL-2" |
562 |
+SLOT="0" |
563 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
564 |
+IUSE="doc jbig jpeg png postscript rle cpu_flags_x86_sse2 static-libs svga tiff X xml zlib" |
565 |
+ |
566 |
+BDEPEND=" |
567 |
+ app-arch/xz-utils |
568 |
+ sys-devel/flex |
569 |
+ virtual/pkgconfig |
570 |
+" |
571 |
+RDEPEND="jbig? ( media-libs/jbigkit ) |
572 |
+ jpeg? ( virtual/jpeg:0 ) |
573 |
+ png? ( >=media-libs/libpng-1.4:0 ) |
574 |
+ postscript? ( app-text/ghostscript-gpl ) |
575 |
+ rle? ( media-libs/urt ) |
576 |
+ svga? ( media-libs/svgalib ) |
577 |
+ tiff? ( >=media-libs/tiff-3.5.5:0 ) |
578 |
+ xml? ( dev-libs/libxml2 ) |
579 |
+ zlib? ( sys-libs/zlib ) |
580 |
+ X? ( x11-libs/libX11 )" |
581 |
+DEPEND="${RDEPEND}" |
582 |
+ |
583 |
+PATCHES=( |
584 |
+ "${FILESDIR}"/netpbm-10.86.21-build.patch |
585 |
+ "${FILESDIR}"/netpbm-10.86.21-test.patch #450530 |
586 |
+ "${FILESDIR}"/netpbm-10.86.21-misc-deps.patch |
587 |
+ "${FILESDIR}"/netpbm-10.86.21-format-security.patch #517524 |
588 |
+ "${FILESDIR}"/netpbm-10.86.22-fix-ps-test.patch #670362 |
589 |
+) |
590 |
+ |
591 |
+netpbm_libtype() { |
592 |
+ case ${CHOST} in |
593 |
+ *-darwin*) echo dylib;; |
594 |
+ *) echo unixshared;; |
595 |
+ esac |
596 |
+} |
597 |
+ |
598 |
+netpbm_libsuffix() { |
599 |
+ local suffix=$(get_libname) |
600 |
+ echo ${suffix//\.} |
601 |
+} |
602 |
+ |
603 |
+netpbm_ldshlib() { |
604 |
+ case ${CHOST} in |
605 |
+ *-darwin*) echo '$(LDFLAGS) -dynamiclib -install_name $(SONAME)';; |
606 |
+ *) echo '$(LDFLAGS) -shared -Wl,-soname,$(SONAME)';; |
607 |
+ esac |
608 |
+} |
609 |
+netpbm_config() { |
610 |
+ if use ${1} ; then |
611 |
+ [[ ${2} != "!" ]] && echo -l${2:-$1} |
612 |
+ else |
613 |
+ echo NONE |
614 |
+ fi |
615 |
+} |
616 |
+ |
617 |
+src_prepare() { |
618 |
+ default |
619 |
+ |
620 |
+ # make sure we use system libs |
621 |
+ sed -i '/SUPPORT_SUBDIRS/s:urt::' GNUmakefile || die |
622 |
+ rm -r urt converter/other/jbig/libjbig converter/other/jpeg2000/libjasper || die |
623 |
+ |
624 |
+ # take care of the importinc stuff ourselves by only doing it once |
625 |
+ # at the top level and having all subdirs use that one set #149843 |
626 |
+ sed -i \ |
627 |
+ -e '/^importinc:/s|^|importinc:\nmanual_|' \ |
628 |
+ -e '/-Iimportinc/s|-Iimp|-I"$(BUILDDIR)"/imp|g'\ |
629 |
+ common.mk || die |
630 |
+ sed -i \ |
631 |
+ -e '/%.c/s: importinc$::' \ |
632 |
+ common.mk lib/Makefile lib/util/Makefile || die |
633 |
+ sed -i \ |
634 |
+ -e 's:pkg-config:$(PKG_CONFIG):' \ |
635 |
+ GNUmakefile converter/other/Makefile other/pamx/Makefile || die |
636 |
+ |
637 |
+ # The postscript knob is currently bound up with a fork test. |
638 |
+ if ! use postscript ; then |
639 |
+ sed -i \ |
640 |
+ -e 's:$(DONT_HAVE_PROCESS_MGMT):Y:' \ |
641 |
+ converter/other/Makefile generator/Makefile || die |
642 |
+ sed -i -r \ |
643 |
+ -e 's:(pbmtextps|pnmtops|pstopnm).*::' \ |
644 |
+ test/all-in-place.{ok,test} || die |
645 |
+ sed -i -e 's:lps-roundtrip.*::' test/Test-Order || die |
646 |
+ sed -i -e '/^$/d' test/all-in-place.ok || die |
647 |
+ sed -i '2iexit 80' test/ps-{alt-,flate-,}roundtrip.test || die |
648 |
+ fi |
649 |
+ |
650 |
+ # the new postscript test needs +x |
651 |
+ chmod +x test/lps-roundtrip.test |
652 |
+ |
653 |
+ # Do not test png if not built |
654 |
+ if ! use png ; then |
655 |
+ sed -i -r \ |
656 |
+ -e 's:(pamtopng|pngtopam|pnmtopng).*::' \ |
657 |
+ test/all-in-place.{ok,test} || die |
658 |
+ sed -i -e '/^$/d' test/all-in-place.ok || die |
659 |
+ |
660 |
+ sed -i -r \ |
661 |
+ -e 's:(pamrgbatopng|pngtopnm).*::' \ |
662 |
+ test/legacy-names.{ok,test} || die |
663 |
+ sed -i -e '/^$/d' test/legacy-names.ok || die |
664 |
+ fi |
665 |
+} |
666 |
+ |
667 |
+src_configure() { |
668 |
+ # cannot chain the die with the heredoc, please check the comment below |
669 |
+ cat config.mk.in - >> config.mk <<-EOF |
670 |
+ # Misc crap |
671 |
+ BUILD_FIASCO = N |
672 |
+ SYMLINK = ln -sf |
673 |
+ |
674 |
+ # These vars let src_test work by default |
675 |
+ PKGDIR_DEFAULT = ${T}/netpbm |
676 |
+ RESULTDIR_DEFAULT = ${T}/netpbm-test |
677 |
+ |
678 |
+ # Toolchain options |
679 |
+ CC = $(tc-getCC) -Wall |
680 |
+ LD = \$(CC) |
681 |
+ CC_FOR_BUILD = $(tc-getBUILD_CC) |
682 |
+ LD_FOR_BUILD = \$(CC_FOR_BUILD) |
683 |
+ AR = $(tc-getAR) |
684 |
+ RANLIB = $(tc-getRANLIB) |
685 |
+ PKG_CONFIG = $(tc-getPKG_CONFIG) |
686 |
+ |
687 |
+ STRIPFLAG = |
688 |
+ CFLAGS_SHLIB = -fPIC |
689 |
+ |
690 |
+ LDRELOC = \$(LD) -r |
691 |
+ LDSHLIB = $(netpbm_ldshlib) |
692 |
+ LINKER_CAN_DO_EXPLICIT_LIBRARY = N # we can, but dont want to |
693 |
+ LINKERISCOMPILER = Y |
694 |
+ NETPBMLIBSUFFIX = $(netpbm_libsuffix) |
695 |
+ NETPBMLIBTYPE = $(netpbm_libtype) |
696 |
+ STATICLIB_TOO = $(usex static-libs Y N) |
697 |
+ |
698 |
+ # The var is called SSE, but the code is actually SSE2. |
699 |
+ WANT_SSE = $(usex cpu_flags_x86_sse2 Y N) |
700 |
+ |
701 |
+ # Gentoo build options |
702 |
+ TIFFLIB = $(netpbm_config tiff) |
703 |
+ # Let tiff worry about its own dependencies #395753 |
704 |
+ TIFFLIB_NEEDS_JPEG = N |
705 |
+ TIFFLIB_NEEDS_Z = N |
706 |
+ JPEGLIB = $(netpbm_config jpeg) |
707 |
+ PNGLIB = $(netpbm_config png) |
708 |
+ ZLIB = $(netpbm_config zlib z) |
709 |
+ LINUXSVGALIB = $(netpbm_config svga vga) |
710 |
+ XML2_LIBS = $(netpbm_config xml xml2) |
711 |
+ JBIGLIB = $(netpbm_config jbig) |
712 |
+ JBIGHDR_DIR = |
713 |
+ JASPERLIB = NONE |
714 |
+ JASPERHDR_DIR = |
715 |
+ URTLIB = $(netpbm_config rle) |
716 |
+ URTHDR_DIR = |
717 |
+ X11LIB = $(netpbm_config X X11) |
718 |
+ X11HDR_DIR = |
719 |
+ EOF |
720 |
+ # cannot chain the die with the heredoc above as bash-3 |
721 |
+ # has a parser bug in that setup #282902 |
722 |
+ [[ $? -eq 0 ]] || die "writing config.mk failed" |
723 |
+} |
724 |
+ |
725 |
+src_compile() { |
726 |
+ emake -j1 pm_config.h version.h manual_importinc #149843 |
727 |
+ emake |
728 |
+} |
729 |
+ |
730 |
+src_test() { |
731 |
+ # The code wants to install everything first and then test the result. |
732 |
+ emake install.{bin,lib,data} |
733 |
+ emake check |
734 |
+} |
735 |
+ |
736 |
+src_install() { |
737 |
+ # Subdir make targets like to use `mkdir` all over the place |
738 |
+ # without any actual dependencies, thus the -j1. |
739 |
+ emake -j1 package pkgdir="${ED}"/usr |
740 |
+ |
741 |
+ if [[ $(get_libdir) != "lib" ]] ; then |
742 |
+ mv "${ED}"/usr/lib "${ED}"/usr/$(get_libdir) || die |
743 |
+ fi |
744 |
+ |
745 |
+ # Remove cruft that we don't need, and move around stuff we want |
746 |
+ rm "${ED}"/usr/{README,VERSION,{pkgconfig,config}_template,pkginfo} || die |
747 |
+ |
748 |
+ dodir /usr/share |
749 |
+ mv "${ED}"/usr/misc "${ED}"/usr/share/netpbm || die |
750 |
+ |
751 |
+ doman userguide/*.[0-9] |
752 |
+ dodoc README |
753 |
+ |
754 |
+ cd doc || die |
755 |
+ dodoc HISTORY Netpbm.programming USERDOC |
756 |
+ docinto html |
757 |
+ dodoc -r *.html |
758 |
+ |
759 |
+ use doc && dodoc -r ../userguide/*.html |
760 |
+} |