Gentoo Archives: gentoo-commits

From: "Azamat H. Hackimov" <winterheart@××××××.ru>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gamerlay:master commit in: media-libs/freeimage/files/, media-libs/freeimage/
Date: Tue, 24 Dec 2019 18:58:12
Message-Id: 1577213864.a4cae01fd6f2b47f38e7109d667d014c7e224ecb.winterheart@gentoo
1 commit: a4cae01fd6f2b47f38e7109d667d014c7e224ecb
2 Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com>
3 AuthorDate: Tue Dec 24 18:52:39 2019 +0000
4 Commit: Azamat H. Hackimov <winterheart <AT> gentoo <DOT> ru>
5 CommitDate: Tue Dec 24 18:57:44 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=a4cae01f
7
8 media-libs/freeimage: in portage now
9
10 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com>
11
12 .../files/freeimage-3.18.0-libjpeg-turbo.patch | 481 ----------------
13 .../freeimage/files/freeimage-3.18.0-raw.patch | 16 -
14 .../files/freeimage-3.18.0-unbundling.patch | 639 ---------------------
15 media-libs/freeimage/freeimage-3.18.0.ebuild | 112 ----
16 media-libs/freeimage/metadata.xml | 11 -
17 5 files changed, 1259 deletions(-)
18
19 diff --git a/media-libs/freeimage/files/freeimage-3.18.0-libjpeg-turbo.patch b/media-libs/freeimage/files/freeimage-3.18.0-libjpeg-turbo.patch
20 deleted file mode 100644
21 index 3e152e0..0000000
22 --- a/media-libs/freeimage/files/freeimage-3.18.0-libjpeg-turbo.patch
23 +++ /dev/null
24 @@ -1,481 +0,0 @@
25 ---- /dev/null
26 -+++ b/LibJPEG/jpegcomp.h
27 -@@ -0,0 +1,26 @@
28 -+/*
29 -+ * jpegcomp.h
30 -+ *
31 -+ * Copyright (C) 2010, D. R. Commander
32 -+ * For conditions of distribution and use, see the accompanying README file.
33 -+ *
34 -+ * JPEG compatibility macros
35 -+ * These declarations are considered internal to the JPEG library; most
36 -+ * applications using the library shouldn't need to include this file.
37 -+ */
38 -+
39 -+#if JPEG_LIB_VERSION >= 70
40 -+#define _DCT_scaled_size DCT_h_scaled_size
41 -+#define _min_DCT_scaled_size min_DCT_h_scaled_size
42 -+#define _min_DCT_h_scaled_size min_DCT_h_scaled_size
43 -+#define _min_DCT_v_scaled_size min_DCT_v_scaled_size
44 -+#define _jpeg_width jpeg_width
45 -+#define _jpeg_height jpeg_height
46 -+#else
47 -+#define _DCT_scaled_size DCT_scaled_size
48 -+#define _min_DCT_scaled_size min_DCT_scaled_size
49 -+#define _min_DCT_h_scaled_size min_DCT_scaled_size
50 -+#define _min_DCT_v_scaled_size min_DCT_scaled_size
51 -+#define _jpeg_width image_width
52 -+#define _jpeg_height image_height
53 -+#endif
54 ---- a/LibJPEG/jpegint.h
55 -+++ b/LibJPEG/jpegint.h
56 -@@ -100,16 +100,14 @@
57 - };
58 -
59 - /* Forward DCT (also controls coefficient quantization) */
60 --typedef JMETHOD(void, forward_DCT_ptr,
61 -- (j_compress_ptr cinfo, jpeg_component_info * compptr,
62 -- JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
63 -- JDIMENSION start_row, JDIMENSION start_col,
64 -- JDIMENSION num_blocks));
65 --
66 - struct jpeg_forward_dct {
67 - JMETHOD(void, start_pass, (j_compress_ptr cinfo));
68 -- /* It is useful to allow each component to have a separate FDCT method. */
69 -- forward_DCT_ptr forward_DCT[MAX_COMPONENTS];
70 -+ /* perhaps this should be an array??? */
71 -+ JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
72 -+ jpeg_component_info * compptr,
73 -+ JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
74 -+ JDIMENSION start_row, JDIMENSION start_col,
75 -+ JDIMENSION num_blocks));
76 - };
77 -
78 - /* Entropy encoding */
79 -@@ -213,6 +211,10 @@
80 - JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
81 - JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, JBLOCKROW *MCU_data));
82 - JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
83 -+
84 -+ /* This is here to share code between baseline and progressive decoders; */
85 -+ /* other modules probably should not use it */
86 -+ boolean insufficient_data; /* set TRUE after emitting warning */
87 - };
88 -
89 - /* Inverse DCT (also performs dequantization) */
90 -@@ -302,6 +304,7 @@
91 - #define jinit_downsampler jIDownsampler
92 - #define jinit_forward_dct jIFDCT
93 - #define jinit_huff_encoder jIHEncoder
94 -+#define jinit_phuff_encoder jIPHEncoder
95 - #define jinit_arith_encoder jIAEncoder
96 - #define jinit_marker_writer jIMWriter
97 - #define jinit_master_decompress jIDMaster
98 -@@ -311,6 +314,7 @@
99 - #define jinit_input_controller jIInCtlr
100 - #define jinit_marker_reader jIMReader
101 - #define jinit_huff_decoder jIHDecoder
102 -+#define jinit_phuff_decoder jIPHDecoder
103 - #define jinit_arith_decoder jIADecoder
104 - #define jinit_inverse_dct jIIDCT
105 - #define jinit_upsampler jIUpsampler
106 -@@ -321,41 +325,15 @@
107 - #define jinit_memory_mgr jIMemMgr
108 - #define jdiv_round_up jDivRound
109 - #define jround_up jRound
110 --#define jzero_far jZeroFar
111 - #define jcopy_sample_rows jCopySamples
112 - #define jcopy_block_row jCopyBlocks
113 -+#define jzero_far jZeroFar
114 - #define jpeg_zigzag_order jZIGTable
115 - #define jpeg_natural_order jZAGTable
116 --#define jpeg_natural_order7 jZAG7Table
117 --#define jpeg_natural_order6 jZAG6Table
118 --#define jpeg_natural_order5 jZAG5Table
119 --#define jpeg_natural_order4 jZAG4Table
120 --#define jpeg_natural_order3 jZAG3Table
121 --#define jpeg_natural_order2 jZAG2Table
122 - #define jpeg_aritab jAriTab
123 - #endif /* NEED_SHORT_EXTERNAL_NAMES */
124 -
125 -
126 --/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
127 -- * and coefficient-block arrays. This won't work on 80x86 because the arrays
128 -- * are FAR and we're assuming a small-pointer memory model. However, some
129 -- * DOS compilers provide far-pointer versions of memcpy() and memset() even
130 -- * in the small-model libraries. These will be used if USE_FMEM is defined.
131 -- * Otherwise, the routines in jutils.c do it the hard way.
132 -- */
133 --
134 --#ifndef NEED_FAR_POINTERS /* normal case, same as regular macro */
135 --#define FMEMZERO(target,size) MEMZERO(target,size)
136 --#else /* 80x86 case */
137 --#ifdef USE_FMEM
138 --#define FMEMZERO(target,size) _fmemset((void FAR *)(target), 0, (size_t)(size))
139 --#else
140 --EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
141 --#define FMEMZERO(target,size) jzero_far(target, size)
142 --#endif
143 --#endif
144 --
145 --
146 - /* Compression module initialization routines */
147 - EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
148 - EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
149 -@@ -370,6 +348,7 @@
150 - EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
151 - EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
152 - EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
153 -+EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
154 - EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));
155 - EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
156 - /* Decompression module initialization routines */
157 -@@ -383,6 +362,7 @@
158 - EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
159 - EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
160 - EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
161 -+EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
162 - EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));
163 - EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
164 - EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
165 -@@ -401,17 +381,12 @@
166 - int num_rows, JDIMENSION num_cols));
167 - EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
168 - JDIMENSION num_blocks));
169 -+EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
170 - /* Constant tables in jutils.c */
171 - #if 0 /* This table is not actually needed in v6a */
172 - extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
173 - #endif
174 - extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
175 --extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */
176 --extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */
177 --extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */
178 --extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */
179 --extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */
180 --extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */
181 -
182 - /* Arithmetic coding probability estimation tables in jaricom.c */
183 - extern const INT32 jpeg_aritab[];
184 ---- a/LibJPEG/transupp.h
185 -+++ b/LibJPEG/transupp.h
186 -@@ -107,15 +106,13 @@
187 -
188 - /*
189 - * Codes for crop parameters, which can individually be unspecified,
190 -- * positive or negative for xoffset or yoffset,
191 -- * positive or forced for width or height.
192 -+ * positive, or negative. (Negative width or height makes no sense, though.)
193 - */
194 -
195 - typedef enum {
196 -- JCROP_UNSET,
197 -- JCROP_POS,
198 -- JCROP_NEG,
199 -- JCROP_FORCE
200 -+ JCROP_UNSET,
201 -+ JCROP_POS,
202 -+ JCROP_NEG
203 - } JCROP_CODE;
204 -
205 - /*
206 -@@ -133,6 +133,13 @@ typedef struct {
207 - boolean trim; /* if TRUE, trim partial MCUs as needed */
208 - boolean force_grayscale; /* if TRUE, convert color image to grayscale */
209 - boolean crop; /* if TRUE, crop or wipe source image */
210 -+ boolean slow_hflip; /* For best performance, the JXFORM_FLIP_H transform
211 -+ normally modifies the source coefficients in place.
212 -+ Setting this to TRUE will instead use a slower,
213 -+ double-buffered algorithm, which leaves the source
214 -+ coefficients in tact (necessary if other transformed
215 -+ images must be generated from the same set of
216 -+ coefficients. */
217 -
218 - /* Crop parameters: application need not set these unless crop is TRUE.
219 - * These can be filled in by jtransform_parse_crop_spec().
220 ---- a/LibJPEG/transupp.c
221 -+++ b/LibJPEG/transupp.c
222 -@@ -20,9 +21,19 @@
223 - #include "jinclude.h"
224 - #include "jpeglib.h"
225 - #include "transupp.h" /* My own external interface */
226 -+#include "jpegcomp.h"
227 - #include <ctype.h> /* to declare isdigit() */
228 -
229 -
230 -+#if JPEG_LIB_VERSION >= 70
231 -+#define dstinfo_min_DCT_h_scaled_size dstinfo->min_DCT_h_scaled_size
232 -+#define dstinfo_min_DCT_v_scaled_size dstinfo->min_DCT_v_scaled_size
233 -+#else
234 -+#define dstinfo_min_DCT_h_scaled_size DCTSIZE
235 -+#define dstinfo_min_DCT_v_scaled_size DCTSIZE
236 -+#endif
237 -+
238 -+
239 - #if TRANSFORMS_SUPPORTED
240 -
241 - /*
242 -@@ -134,7 +145,7 @@
243 - * Partial iMCUs at the right edge are left untouched.
244 - */
245 - MCU_cols = srcinfo->output_width /
246 -- (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
247 -+ (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
248 -
249 - for (ci = 0; ci < dstinfo->num_components; ci++) {
250 - compptr = dstinfo->comp_info + ci;
251 -@@ -200,7 +211,7 @@
252 - * this is essentially the same as the routine above.
253 - */
254 - MCU_cols = srcinfo->output_width /
255 -- (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
256 -+ (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
257 -
258 - for (ci = 0; ci < dstinfo->num_components; ci++) {
259 - compptr = dstinfo->comp_info + ci;
260 -@@ -265,7 +276,7 @@
261 - * Partial iMCUs at the bottom edge are copied verbatim.
262 - */
263 - MCU_rows = srcinfo->output_height /
264 -- (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
265 -+ (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
266 -
267 - for (ci = 0; ci < dstinfo->num_components; ci++) {
268 - compptr = dstinfo->comp_info + ci;
269 -@@ -393,7 +404,7 @@
270 - * not mirrored.
271 - */
272 - MCU_cols = srcinfo->output_height /
273 -- (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
274 -+ (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
275 -
276 - for (ci = 0; ci < dstinfo->num_components; ci++) {
277 - compptr = dstinfo->comp_info + ci;
278 -@@ -474,7 +485,7 @@
279 - * not mirrored.
280 - */
281 - MCU_rows = srcinfo->output_width /
282 -- (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
283 -+ (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
284 -
285 - for (ci = 0; ci < dstinfo->num_components; ci++) {
286 - compptr = dstinfo->comp_info + ci;
287 -@@ -542,9 +553,9 @@
288 - jpeg_component_info *compptr;
289 -
290 - MCU_cols = srcinfo->output_width /
291 -- (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
292 -+ (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
293 - MCU_rows = srcinfo->output_height /
294 -- (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
295 -+ (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
296 -
297 - for (ci = 0; ci < dstinfo->num_components; ci++) {
298 - compptr = dstinfo->comp_info + ci;
299 -@@ -653,9 +664,9 @@
300 - jpeg_component_info *compptr;
301 -
302 - MCU_cols = srcinfo->output_height /
303 -- (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
304 -+ (dstinfo->max_h_samp_factor * dstinfo_min_DCT_h_scaled_size);
305 - MCU_rows = srcinfo->output_width /
306 -- (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
307 -+ (dstinfo->max_v_samp_factor * dstinfo_min_DCT_v_scaled_size);
308 -
309 - for (ci = 0; ci < dstinfo->num_components; ci++) {
310 - compptr = dstinfo->comp_info + ci;
311 -@@ -771,7 +782,7 @@
312 - * The routine returns TRUE if the spec string is valid, FALSE if not.
313 - *
314 - * The crop spec string should have the format
315 -- * <width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>
316 -+ * <width>x<height>{+-}<xoffset>{+-}<yoffset>
317 - * where width, height, xoffset, and yoffset are unsigned integers.
318 - * Each of the elements can be omitted to indicate a default value.
319 - * (A weakness of this style is that it is not possible to omit xoffset
320 -@@ -793,22 +804,14 @@
321 - /* fetch width */
322 - if (! jt_read_integer(&spec, &info->crop_width))
323 - return FALSE;
324 -- if (*spec == 'f' || *spec == 'F') {
325 -- spec++;
326 -- info->crop_width_set = JCROP_FORCE;
327 -- } else
328 -- info->crop_width_set = JCROP_POS;
329 -+ info->crop_width_set = JCROP_POS;
330 - }
331 -- if (*spec == 'x' || *spec == 'X') {
332 -+ if (*spec == 'x' || *spec == 'X') {
333 - /* fetch height */
334 - spec++;
335 - if (! jt_read_integer(&spec, &info->crop_height))
336 - return FALSE;
337 -- if (*spec == 'f' || *spec == 'F') {
338 -- spec++;
339 -- info->crop_height_set = JCROP_FORCE;
340 -- } else
341 -- info->crop_height_set = JCROP_POS;
342 -+ info->crop_height_set = JCROP_POS;
343 - }
344 - if (*spec == '+' || *spec == '-') {
345 - /* fetch xoffset */
346 -@@ -897,7 +900,12 @@
347 - info->num_components = srcinfo->num_components;
348 -
349 - /* Compute output image dimensions and related values. */
350 -+#if JPEG_LIB_VERSION >= 80
351 - jpeg_core_output_dimensions(srcinfo);
352 -+#else
353 -+ srcinfo->output_width = srcinfo->image_width;
354 -+ srcinfo->output_height = srcinfo->image_height;
355 -+#endif
356 -
357 - /* Return right away if -perfect is given and transformation is not perfect.
358 - */
359 -@@ -905,15 +913,15 @@
360 - if (info->num_components == 1) {
361 - if (!jtransform_perfect_transform(srcinfo->output_width,
362 - srcinfo->output_height,
363 -- srcinfo->min_DCT_h_scaled_size,
364 -- srcinfo->min_DCT_v_scaled_size,
365 -+ srcinfo->_min_DCT_h_scaled_size,
366 -+ srcinfo->_min_DCT_v_scaled_size,
367 - info->transform))
368 - return FALSE;
369 - } else {
370 - if (!jtransform_perfect_transform(srcinfo->output_width,
371 - srcinfo->output_height,
372 -- srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,
373 -- srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,
374 -+ srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size,
375 -+ srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size,
376 - info->transform))
377 - return FALSE;
378 - }
379 -@@ -932,26 +940,26 @@
380 - info->output_width = srcinfo->output_height;
381 - info->output_height = srcinfo->output_width;
382 - if (info->num_components == 1) {
383 -- info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;
384 -- info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;
385 -+ info->iMCU_sample_width = srcinfo->_min_DCT_v_scaled_size;
386 -+ info->iMCU_sample_height = srcinfo->_min_DCT_h_scaled_size;
387 - } else {
388 - info->iMCU_sample_width =
389 -- srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
390 -+ srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;
391 - info->iMCU_sample_height =
392 -- srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
393 -+ srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;
394 - }
395 - break;
396 - default:
397 - info->output_width = srcinfo->output_width;
398 - info->output_height = srcinfo->output_height;
399 - if (info->num_components == 1) {
400 -- info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;
401 -- info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;
402 -+ info->iMCU_sample_width = srcinfo->_min_DCT_h_scaled_size;
403 -+ info->iMCU_sample_height = srcinfo->_min_DCT_v_scaled_size;
404 - } else {
405 - info->iMCU_sample_width =
406 -- srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
407 -+ srcinfo->max_h_samp_factor * srcinfo->_min_DCT_h_scaled_size;
408 - info->iMCU_sample_height =
409 -- srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
410 -+ srcinfo->max_v_samp_factor * srcinfo->_min_DCT_v_scaled_size;
411 - }
412 - break;
413 - }
414 -@@ -988,16 +996,8 @@
415 - (long) info->iMCU_sample_height);
416 - } else {
417 - /* Ensure the effective crop region will cover the requested */
418 -- if (info->crop_width_set == JCROP_FORCE ||
419 -- info->crop_width > info->output_width)
420 -- info->output_width = info->crop_width;
421 -- else
422 - info->output_width =
423 - info->crop_width + (xoffset % info->iMCU_sample_width);
424 -- if (info->crop_height_set == JCROP_FORCE ||
425 -- info->crop_height > info->output_height)
426 -- info->output_height = info->crop_height;
427 -- else
428 - info->output_height =
429 - info->crop_height + (yoffset % info->iMCU_sample_height);
430 - }
431 -@@ -1020,7 +1022,7 @@
432 - case JXFORM_FLIP_H:
433 - if (info->trim)
434 - trim_right_edge(info, srcinfo->output_width);
435 -- if (info->y_crop_offset != 0)
436 -+ if (info->y_crop_offset != 0 || info->slow_hflip)
437 - need_workspace = TRUE;
438 - /* do_flip_h_no_crop doesn't need a workspace array */
439 - break;
440 -@@ -1124,9 +1126,11 @@
441 - jtemp = dstinfo->image_width;
442 - dstinfo->image_width = dstinfo->image_height;
443 - dstinfo->image_height = jtemp;
444 -+#if JPEG_LIB_VERSION >= 70
445 - itemp = dstinfo->min_DCT_h_scaled_size;
446 - dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
447 - dstinfo->min_DCT_v_scaled_size = itemp;
448 -+#endif
449 -
450 - /* Transpose sampling factors */
451 - for (ci = 0; ci < dstinfo->num_components; ci++) {
452 -@@ -1362,8 +1366,10 @@
453 - /* Correct the destination's image dimensions as necessary
454 - * for rotate/flip, resize, and crop operations.
455 - */
456 -+#if JPEG_LIB_VERSION >= 70
457 - dstinfo->jpeg_width = info->output_width;
458 - dstinfo->jpeg_height = info->output_height;
459 -+#endif
460 -
461 - /* Transpose destination image parameters */
462 - switch (info->transform) {
463 -@@ -1371,9 +1377,17 @@
464 - case JXFORM_TRANSVERSE:
465 - case JXFORM_ROT_90:
466 - case JXFORM_ROT_270:
467 -+#if JPEG_LIB_VERSION < 70
468 -+ dstinfo->image_width = info->output_height;
469 -+ dstinfo->image_height = info->output_width;
470 -+#endif
471 - transpose_critical_parameters(dstinfo);
472 - break;
473 - default:
474 -+#if JPEG_LIB_VERSION < 70
475 -+ dstinfo->image_width = info->output_width;
476 -+ dstinfo->image_height = info->output_height;
477 -+#endif
478 - break;
479 - }
480 -
481 -@@ -1389,6 +1403,7 @@
482 - GETJOCTET(srcinfo->marker_list->data[5]) == 0) {
483 - /* Suppress output of JFIF marker */
484 - dstinfo->write_JFIF_header = FALSE;
485 -+#if JPEG_LIB_VERSION >= 70
486 - /* Adjust Exif image parameters */
487 - if (dstinfo->jpeg_width != srcinfo->image_width ||
488 - dstinfo->jpeg_height != srcinfo->image_height)
489 -@@ -1396,6 +1411,7 @@
490 - adjust_exif_parameters(srcinfo->marker_list->data + 6,
491 - srcinfo->marker_list->data_length - 6,
492 - dstinfo->jpeg_width, dstinfo->jpeg_height);
493 -+#endif
494 - }
495 -
496 - /* Return the appropriate output data set */
497 -@@ -1432,7 +1448,7 @@
498 - src_coef_arrays, dst_coef_arrays);
499 - break;
500 - case JXFORM_FLIP_H:
501 -- if (info->y_crop_offset != 0)
502 -+ if (info->y_crop_offset != 0 || info->slow_hflip)
503 - do_flip_h(srcinfo, dstinfo, info->x_crop_offset, info->y_crop_offset,
504 - src_coef_arrays, dst_coef_arrays);
505 - else
506
507 diff --git a/media-libs/freeimage/files/freeimage-3.18.0-raw.patch b/media-libs/freeimage/files/freeimage-3.18.0-raw.patch
508 deleted file mode 100644
509 index 44f5666..0000000
510 --- a/media-libs/freeimage/files/freeimage-3.18.0-raw.patch
511 +++ /dev/null
512 @@ -1,16 +0,0 @@
513 -https://bugs.gentoo.org/show_bug.cgi?id=458516
514 -
515 ---- FreeImage/Source/FreeImage.h
516 -+++ FreeImage/Source/FreeImage.h
517 -@@ -141,8 +141,10 @@
518 - typedef uint16_t WORD;
519 - typedef uint32_t DWORD;
520 - typedef int32_t LONG;
521 -+#ifndef _LIBRAW_TYPES_H
522 - typedef int64_t INT64;
523 - typedef uint64_t UINT64;
524 -+#endif
525 - #else
526 - // MS is not C99 ISO compliant
527 - typedef long BOOL;
528 -
529
530 diff --git a/media-libs/freeimage/files/freeimage-3.18.0-unbundling.patch b/media-libs/freeimage/files/freeimage-3.18.0-unbundling.patch
531 deleted file mode 100644
532 index 8f76d59..0000000
533 --- a/media-libs/freeimage/files/freeimage-3.18.0-unbundling.patch
534 +++ /dev/null
535 @@ -1,639 +0,0 @@
536 -lots of fixes here:
537 - - use system graphics libraries
538 - - make all of them optional
539 - - drop root users from install (fix user installs)
540 - - make static lib build optional
541 - - link with CXX and CXXFLAGS (since this is C++ code)
542 -
543 ---- a/Makefile.gnu
544 -+++ b/Makefile.gnu
545 -@@ -11,7 +11,24 @@
546 - # Converts cr/lf to just lf
547 - DOS2UNIX = dos2unix
548 -
549 --LIBRARIES = -lstdc++
550 -+PKG_CONFIG ?= pkg-config
551 -+
552 -+USE_EXR ?= yes
553 -+USE_JPEG ?= yes
554 -+USE_JPEG2K ?= yes
555 -+USE_MNG ?= yes
556 -+USE_PNG ?= yes
557 -+USE_TIFF ?= yes
558 -+USE_RAW ?= yes
559 -+
560 -+LIBRARIES-yes = $(shell $(PKG_CONFIG) --libs zlib)
561 -+LIBRARIES-$(USE_EXR) += $(shell $(PKG_CONFIG) --libs OpenEXR)
562 -+LIBRARIES-$(USE_JPEG) += -ljpeg
563 -+LIBRARIES-$(USE_JPEG2K) += $(shell $(PKG_CONFIG) --libs libopenjpeg)
564 -+LIBRARIES-$(USE_MNG) += -lmng
565 -+LIBRARIES-$(USE_PNG) += $(shell $(PKG_CONFIG) --libs libpng)
566 -+LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 IlmBase)
567 -+LIBRARIES-$(USE_RAW) += $(shell $(PKG_CONFIG) --libs libraw)
568 -
569 - MODULES = $(SRCS:.c=.o)
570 - MODULES := $(MODULES:.cpp=.o)
571 -@@ -64,13 +81,15 @@
572 - $(AR) r $@ $(MODULES)
573 -
574 - $(SHAREDLIB): $(MODULES)
575 -- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
576 -+ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES-yes)
577 -
578 - install:
579 - install -d $(INCDIR) $(INSTALLDIR)
580 -- install -m 644 -o root -g root $(HEADER) $(INCDIR)
581 -- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
582 -- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
583 -+ install -m 644 $(HEADER) $(INCDIR)
584 -+ifneq ($(STATICLIB),)
585 -+ install -m 644 $(STATICLIB) $(INSTALLDIR)
586 -+endif
587 -+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
588 - ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
589 - ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
590 - # ldconfig
591 ---- a/Source/FreeImage/J2KHelper.cpp
592 -+++ b/Source/FreeImage/J2KHelper.cpp
593 -@@ -21,7 +21,7 @@
594 -
595 - #include "FreeImage.h"
596 - #include "Utilities.h"
597 --#include "../LibOpenJPEG/openjpeg.h"
598 -+#include <openjpeg.h>
599 - #include "J2KHelper.h"
600 -
601 - // --------------------------------------------------------------------------
602 ---- a/Source/FreeImage/PluginEXR.cpp
603 -+++ b/Source/FreeImage/PluginEXR.cpp
604 -@@ -28,16 +28,16 @@
605 - #pragma warning (disable : 4800) // ImfVersion.h - 'const int' : forcing value to bool 'true' or 'false' (performance warning)
606 - #endif
607 -
608 --#include "../OpenEXR/IlmImf/ImfIO.h"
609 --#include "../OpenEXR/Iex/Iex.h"
610 --#include "../OpenEXR/IlmImf/ImfOutputFile.h"
611 --#include "../OpenEXR/IlmImf/ImfInputFile.h"
612 --#include "../OpenEXR/IlmImf/ImfRgbaFile.h"
613 --#include "../OpenEXR/IlmImf/ImfChannelList.h"
614 --#include "../OpenEXR/IlmImf/ImfRgba.h"
615 --#include "../OpenEXR/IlmImf/ImfArray.h"
616 --#include "../OpenEXR/IlmImf/ImfPreviewImage.h"
617 --#include "../OpenEXR/Half/half.h"
618 -+#include <ImfIO.h>
619 -+#include <Iex.h>
620 -+#include <ImfOutputFile.h>
621 -+#include <ImfInputFile.h>
622 -+#include <ImfRgbaFile.h>
623 -+#include <ImfChannelList.h>
624 -+#include <ImfRgba.h>
625 -+#include <ImfArray.h>
626 -+#include <ImfPreviewImage.h>
627 -+#include <half.h>
628 -
629 -
630 - // ==========================================================
631 ---- a/Source/FreeImage/PluginJ2K.cpp
632 -+++ b/Source/FreeImage/PluginJ2K.cpp
633 -@@ -21,7 +21,7 @@
634 -
635 - #include "FreeImage.h"
636 - #include "Utilities.h"
637 --#include "../LibOpenJPEG/openjpeg.h"
638 -+#include <openjpeg.h>
639 - #include "J2KHelper.h"
640 -
641 - // ==========================================================
642 ---- a/Source/FreeImage/PluginJP2.cpp
643 -+++ b/Source/FreeImage/PluginJP2.cpp
644 -@@ -21,7 +21,7 @@
645 -
646 - #include "FreeImage.h"
647 - #include "Utilities.h"
648 --#include "../LibOpenJPEG/openjpeg.h"
649 -+#include <openjpeg.h>
650 - #include "J2KHelper.h"
651 -
652 - // ==========================================================
653 ---- a/Source/FreeImage/PluginPNG.cpp
654 -+++ b/Source/FreeImage/PluginPNG.cpp
655 -@@ -37,8 +37,8 @@
656 -
657 - // ----------------------------------------------------------
658 -
659 --#include "../ZLib/zlib.h"
660 --#include "../LibPNG/png.h"
661 -+#include <zlib.h>
662 -+#include <png.h>
663 -
664 - // ----------------------------------------------------------
665 -
666 ---- a/Source/transupp.c
667 -+++ b/Source/transupp.c
668 -@@ -15,8 +15,7 @@
669 - /* Although this file really shouldn't have access to the library internals,
670 - * it's helpful to let it call jround_up() and jcopy_block_row().
671 - */
672 --#define JPEG_INTERNALS
673 --
674 -+#include <jerror.h>
675 - #include "jinclude.h"
676 - #include "jpeglib.h"
677 - #include "transupp.h" /* My own external interface */
678 ---- a/Source/FreeImage/ZLibInterface.cpp
679 -+++ b/Source/FreeImage/ZLibInterface.cpp
680 -@@ -19,10 +19,10 @@
681 - // Use at your own risk!
682 - // ==========================================================
683 -
684 --#include "../ZLib/zlib.h"
685 -+#include <zlib.h>
686 - #include "FreeImage.h"
687 - #include "Utilities.h"
688 --#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */
689 -+#define OS_CODE 0x03
690 -
691 - /**
692 - Compresses a source buffer into a target buffer, using the ZLib library.
693 ---- a/Source/FreeImage/PluginG3.cpp
694 -+++ b/Source/FreeImage/PluginG3.cpp
695 -@@ -20,7 +20,7 @@
696 - // Use at your own risk!
697 - // ==========================================================
698 -
699 --#include "../LibTIFF4/tiffiop.h"
700 -+#include "tiffiop.h"
701 -
702 - #include "FreeImage.h"
703 - #include "Utilities.h"
704 ---- a/Source/FreeImage/PluginJPEG.cpp
705 -+++ b/Source/FreeImage/PluginJPEG.cpp
706 -@@ -35,11 +35,15 @@
707 - #undef FAR
708 - #include <setjmp.h>
709 -
710 --#include "../LibJPEG/jinclude.h"
711 --#include "../LibJPEG/jpeglib.h"
712 --#include "../LibJPEG/jerror.h"
713 -+#include <string.h>
714 -+#include <stdio.h>
715 -+#include <jconfig.h>
716 -+#include <jpeglib.h>
717 -+#include <jerror.h>
718 - }
719 -
720 -+#define SIZEOF(object) ((size_t) sizeof(object))
721 -+
722 - #include "FreeImage.h"
723 - #include "Utilities.h"
724 -
725 ---- a/Source/FreeImageToolkit/JPEGTransform.cpp
726 -+++ b/Source/FreeImageToolkit/JPEGTransform.cpp
727 -@@ -25,10 +25,11 @@
728 - #undef FAR
729 - #include <setjmp.h>
730 -
731 --#include "../LibJPEG/jinclude.h"
732 --#include "../LibJPEG/jpeglib.h"
733 --#include "../LibJPEG/jerror.h"
734 --#include "../LibJPEG/transupp.h"
735 -+#include <string.h>
736 -+#include <stdio.h>
737 -+#include <jpeglib.h>
738 -+#include <jerror.h>
739 -+#include "transupp.h"
740 - }
741 -
742 - #include "FreeImage.h"
743 ---- a/Makefile.fip
744 -+++ b/Makefile.fip
745 -@@ -11,7 +11,24 @@
746 - # Converts cr/lf to just lf
747 - DOS2UNIX = dos2unix
748 -
749 --LIBRARIES = -lstdc++
750 -+PKG_CONFIG ?= pkg-config
751 -+
752 -+USE_EXR ?= yes
753 -+USE_JPEG ?= yes
754 -+USE_JPEG2K ?= yes
755 -+USE_MNG ?= yes
756 -+USE_PNG ?= yes
757 -+USE_TIFF ?= yes
758 -+USE_RAW ?= yes
759 -+
760 -+LIBRARIES-yes = $(shell $(PKG_CONFIG) --libs zlib)
761 -+LIBRARIES-$(USE_EXR) += $(shell $(PKG_CONFIG) --libs OpenEXR)
762 -+LIBRARIES-$(USE_JPEG) += -ljpeg
763 -+LIBRARIES-$(USE_JPEG2K) += $(shell $(PKG_CONFIG) --libs libopenjpeg)
764 -+LIBRARIES-$(USE_MNG) += -lmng
765 -+LIBRARIES-$(USE_PNG) += $(shell $(PKG_CONFIG) --libs libpng)
766 -+LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 IlmBase)
767 -+LIBRARIES-$(USE_RAW) += $(shell $(PKG_CONFIG) --libs libraw)
768 -
769 - MODULES = $(SRCS:.c=.o)
770 - MODULES := $(MODULES:.cpp=.o)
771 -@@ -65,14 +82,16 @@
772 - $(AR) r $@ $(MODULES)
773 -
774 - $(SHAREDLIB): $(MODULES)
775 -- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES)
776 -+ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES-yes)
777 -
778 - install:
779 - install -d $(INCDIR) $(INSTALLDIR)
780 -- install -m 644 -o root -g root $(HEADER) $(INCDIR)
781 -- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
782 -- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
783 -- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
784 -+ install -m 644 $(HEADER) $(INCDIR)
785 -+ install -m 644 $(HEADERFIP) $(INCDIR)
786 -+ifneq ($(STATICLIB),)
787 -+ install -m 644 $(STATICLIB) $(INSTALLDIR)
788 -+endif
789 -+ install -m 755 $(SHAREDLIB) $(INSTALLDIR)
790 - ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
791 - ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)
792 -
793 ---- a/Makefile.srcs
794 -+++ b/Makefile.srcs
795 -@@ -1,6 +1,14 @@
796 -+USE_EXR ?= yes
797 -+USE_JPEG ?= yes
798 -+USE_JPEG2K ?= yes
799 -+USE_MNG ?= yes
800 -+USE_PNG ?= yes
801 -+USE_TIFF ?= yes
802 -+USE_RAW ?= yes
803 -+
804 - VER_MAJOR = 3
805 - VER_MINOR = 18.0
806 --SRCS = \
807 -+SRCS-yes = \
808 - Source/FreeImage/BitmapAccess.cpp \
809 - Source/FreeImage/ColorLookup.cpp \
810 - Source/FreeImage/ConversionRGBA16.cpp \
811 -@@ -17,36 +25,74 @@ SRCS = \
812 - Source/FreeImage/LFPQuantizer.cpp \
813 - Source/FreeImage/MemoryIO.cpp \
814 - Source/FreeImage/PixelAccess.cpp \
815 -+
816 -+SRCS-$(USE_JPEG2K) += \
817 - Source/FreeImage/J2KHelper.cpp \
818 -+
819 -+SRCS-$(USE_MNG) += \
820 - Source/FreeImage/MNGHelper.cpp \
821 -+
822 -+SRCS-yes += \
823 - Source/FreeImage/Plugin.cpp \
824 - Source/FreeImage/PluginBMP.cpp \
825 - Source/FreeImage/PluginCUT.cpp \
826 - Source/FreeImage/PluginDDS.cpp \
827 -+
828 -+SRCS-$(USE_EXR) += \
829 - Source/FreeImage/PluginEXR.cpp \
830 -+
831 -+SRCS-$(USE_TIFF) += \
832 - Source/FreeImage/PluginG3.cpp \
833 -+
834 -+SRCS-yes += \
835 - Source/FreeImage/PluginGIF.cpp \
836 - Source/FreeImage/PluginHDR.cpp \
837 - Source/FreeImage/PluginICO.cpp \
838 - Source/FreeImage/PluginIFF.cpp \
839 -+
840 -+SRCS-$(USE_JPEG2K) += \
841 - Source/FreeImage/PluginJ2K.cpp \
842 -+
843 -+SRCS-$(USE_MNG) += \
844 - Source/FreeImage/PluginJNG.cpp \
845 -+
846 -+SRCS-$(USE_JPEG2K) += \
847 - Source/FreeImage/PluginJP2.cpp \
848 -+
849 -+SRCS-$(USE_JPEG) += \
850 - Source/FreeImage/PluginJPEG.cpp \
851 -+
852 -+SRCS-yes += \
853 - Source/FreeImage/PluginJXR.cpp \
854 - Source/FreeImage/PluginKOALA.cpp \
855 -+
856 -+SRCS-$(USE_MNG) += \
857 - Source/FreeImage/PluginMNG.cpp \
858 -+
859 -+SRCS-yes += \
860 - Source/FreeImage/PluginPCD.cpp \
861 - Source/FreeImage/PluginPCX.cpp \
862 - Source/FreeImage/PluginPFM.cpp \
863 - Source/FreeImage/PluginPICT.cpp \
864 -+
865 -+SRCS-$(USE_PNG) += \
866 - Source/FreeImage/PluginPNG.cpp \
867 -+
868 -+SRCS-yes += \
869 - Source/FreeImage/PluginPNM.cpp \
870 - Source/FreeImage/PluginPSD.cpp \
871 - Source/FreeImage/PluginRAS.cpp \
872 -+
873 -+SRCS-$(USE_RAW) += \
874 - Source/FreeImage/PluginRAW.cpp \
875 -+
876 -+SRCS-yes += \
877 - Source/FreeImage/PluginSGI.cpp \
878 - Source/FreeImage/PluginTARGA.cpp \
879 -+
880 -+SRCS-$(USE_TIFF) += \
881 - Source/FreeImage/PluginTIFF.cpp \
882 -+
883 -+SRCS-yes += \
884 - Source/FreeImage/PluginWBMP.cpp \
885 - Source/FreeImage/PluginXBM.cpp \
886 - Source/FreeImage/PluginXPM.cpp \
887 -@@ -83,7 +129,11 @@ SRCS = \
888 - Source/Metadata/IPTC.cpp \
889 - Source/Metadata/TagConversion.cpp \
890 - Source/Metadata/TagLib.cpp \
891 -+
892 -+SRCS-$(USE_TIFF) += \
893 - Source/Metadata/XTIFF.cpp \
894 -+
895 -+SRCS-yes += \
896 - Source/FreeImageToolkit/Background.cpp \
897 - Source/FreeImageToolkit/BSplineRotate.cpp \
898 - Source/FreeImageToolkit/Channels.cpp \
899 -@@ -92,10 +142,18 @@ SRCS = \
900 - Source/FreeImageToolkit/CopyPaste.cpp \
901 - Source/FreeImageToolkit/Display.cpp \
902 - Source/FreeImageToolkit/Flip.cpp \
903 -+
904 -+SRCS-$(USE_JPEG) += \
905 - Source/FreeImageToolkit/JPEGTransform.cpp \
906 -+
907 -+SRCS-yes += \
908 - Source/FreeImageToolkit/MultigridPoissonSolver.cpp \
909 - Source/FreeImageToolkit/Rescale.cpp \
910 - Source/FreeImageToolkit/Resize.cpp \
911 -+
912 -+SRCS-$(USE_JPEG) += \
913 -+ Source/transupp.c
914 -+SRCS = $(SRCS-yes)
915 - INCLS = \
916 - Examples/OpenGL/TextureManager/TextureManager.h \
917 - Examples/Plugin/PluginCradle.h \
918 -@@ -116,7 +174,17 @@
919 - Wrapper/FreeImagePlus/test/fipTest.h \
920 - TestAPI/TestSuite.h
921 -
922 --INCLUDE = -I. \
923 -+INCLUDE-yes = -I. \
924 - -ISource \
925 - -ISource/Metadata \
926 - -ISource/FreeImageToolkit \
927 -+
928 -+INCLUDE-yes += $(shell $(PKG_CONFIG) --cflags-only-I zlib)
929 -+INCLUDE-$(USE_EXR) += -DUSE_EXR $(shell $(PKG_CONFIG) --cflags-only-I OpenEXR)
930 -+INCLUDE-$(USE_JPEG) += -DUSE_JPEG
931 -+INCLUDE-$(USE_JPEG2K) += -DUSE_JPEG2K $(shell $(PKG_CONFIG) --cflags-only-I libopenjpeg)
932 -+INCLUDE-$(USE_MNG) += -DUSE_MNG
933 -+INCLUDE-$(USE_PNG) += -DUSE_PNG $(shell $(PKG_CONFIG) --cflags-only-I libpng)
934 -+INCLUDE-$(USE_TIFF) += -DUSE_TIFF $(shell $(PKG_CONFIG) --cflags-only-I libtiff-4 IlmBase)
935 -+INCLUDE-$(USE_RAW) += -DUSE_RAW $(shell $(PKG_CONFIG) --cflags-only-I libraw)
936 -+INCLUDE = $(INCLUDE-yes)
937 ---- a/fipMakefile.srcs
938 -+++ b/fipMakefile.srcs
939 -@@ -1,6 +1,14 @@
940 -+USE_EXR ?= yes
941 -+USE_JPEG ?= yes
942 -+USE_JPEG2K ?= yes
943 -+USE_MNG ?= yes
944 -+USE_PNG ?= yes
945 -+USE_TIFF ?= yes
946 -+USE_RAW ?= yes
947 -+
948 - VER_MAJOR = 3
949 - VER_MINOR = 18.0
950 --SRCS = \
951 -+SRCS-yes = \
952 - Source/FreeImage/BitmapAccess.cpp \
953 - Source/FreeImage/ColorLookup.cpp \
954 - Source/FreeImage/ConversionRGBA16.cpp \
955 -@@ -9,36 +17,74 @@
956 - Source/FreeImage/LFPQuantizer.cpp \
957 - Source/FreeImage/MemoryIO.cpp \
958 - Source/FreeImage/PixelAccess.cpp \
959 -+
960 -+SRCS-$(USE_JPEG2K) += \
961 - Source/FreeImage/J2KHelper.cpp \
962 -+
963 -+SRCS-$(USE_MNG) += \
964 - Source/FreeImage/MNGHelper.cpp \
965 -+
966 -+SRCS-yes += \
967 - Source/FreeImage/Plugin.cpp \
968 - Source/FreeImage/PluginBMP.cpp \
969 - Source/FreeImage/PluginCUT.cpp \
970 - Source/FreeImage/PluginDDS.cpp \
971 -+
972 -+SRCS-$(USE_EXR) += \
973 - Source/FreeImage/PluginEXR.cpp \
974 -+
975 -+SRCS-$(USE_TIFF) += \
976 - Source/FreeImage/PluginG3.cpp \
977 -+
978 -+SRCS-yes += \
979 - Source/FreeImage/PluginGIF.cpp \
980 - Source/FreeImage/PluginHDR.cpp \
981 - Source/FreeImage/PluginICO.cpp \
982 - Source/FreeImage/PluginIFF.cpp \
983 -+
984 -+SRCS-$(USE_JPEG2K) += \
985 - Source/FreeImage/PluginJ2K.cpp \
986 -+
987 -+SRCS-$(USE_MNG) += \
988 - Source/FreeImage/PluginJNG.cpp \
989 -+
990 -+SRCS-$(USE_JPEG2K) += \
991 - Source/FreeImage/PluginJP2.cpp \
992 -+
993 -+SRCS-$(USE_JPEG) += \
994 - Source/FreeImage/PluginJPEG.cpp \
995 -+
996 -+SRCS-yes += \
997 - Source/FreeImage/PluginJXR.cpp \
998 - Source/FreeImage/PluginKOALA.cpp \
999 -+
1000 -+SRCS-$(USE_MNG) += \
1001 - Source/FreeImage/PluginMNG.cpp \
1002 -+
1003 -+SRCS-yes += \
1004 - Source/FreeImage/PluginPCD.cpp \
1005 - Source/FreeImage/PluginPCX.cpp \
1006 - Source/FreeImage/PluginPFM.cpp \
1007 - Source/FreeImage/PluginPICT.cpp \
1008 -+
1009 -+SRCS-$(USE_PNG) += \
1010 - Source/FreeImage/PluginPNG.cpp \
1011 -+
1012 -+SRCS-yes += \
1013 - Source/FreeImage/PluginPNM.cpp \
1014 - Source/FreeImage/PluginPSD.cpp \
1015 - Source/FreeImage/PluginRAS.cpp \
1016 -+
1017 -+SRCS-$(USE_RAW) += \
1018 - Source/FreeImage/PluginRAW.cpp \
1019 -+
1020 -+SRCS-yes += \
1021 - Source/FreeImage/PluginSGI.cpp \
1022 - Source/FreeImage/PluginTARGA.cpp \
1023 -+
1024 -+SRCS-$(USE_TIFF) += \
1025 - Source/FreeImage/PluginTIFF.cpp \
1026 -+
1027 -+SRCS-yes += \
1028 - Source/FreeImage/PluginWBMP.cpp \
1029 - Source/FreeImage/PluginXBM.cpp \
1030 - Source/FreeImage/PluginXPM.cpp \
1031 -@@ -75,7 +121,11 @@
1032 - Source/Metadata/IPTC.cpp \
1033 - Source/Metadata/TagConversion.cpp \
1034 - Source/Metadata/TagLib.cpp \
1035 -+
1036 -+SRCS-$(USE_TIFF) += \
1037 - Source/Metadata/XTIFF.cpp \
1038 -+
1039 -+SRCS-yes += \
1040 - Source/FreeImageToolkit/Background.cpp \
1041 - Source/FreeImageToolkit/BSplineRotate.cpp \
1042 - Source/FreeImageToolkit/Channels.cpp \
1043 -@@ -84,7 +134,11 @@
1044 - Source/FreeImageToolkit/CopyPaste.cpp \
1045 - Source/FreeImageToolkit/Display.cpp \
1046 - Source/FreeImageToolkit/Flip.cpp \
1047 -+
1048 -+SRCS-$(USE_JPEG) += \
1049 - Source/FreeImageToolkit/JPEGTransform.cpp \
1050 -+
1051 -+SRCS-yes += \
1052 - Source/FreeImageToolkit/MultigridPoissonSolver.cpp \
1053 - Source/FreeImageToolkit/Rescale.cpp \
1054 - Source/FreeImageToolkit/Resize.cpp \
1055 -@@ -95,6 +149,11 @@
1056 - Wrapper/FreeImagePlus/src/fipTag.cpp \
1057 - Wrapper/FreeImagePlus/src/fipWinImage.cpp \
1058 - Wrapper/FreeImagePlus/src/FreeImagePlus.cpp
1059 -+
1060 -+SRCS-$(USE_JPEG) += \
1061 -+ Source/transupp.c
1062 -+
1063 -+SRCS = $(SRCS-yes)
1064 - INCLUDE = -I. \
1065 - -ISource \
1066 - -ISource/Metadata \
1067 ---- a/Source/FreeImage/PluginRAW.cpp
1068 -+++ b/Source/FreeImage/PluginRAW.cpp
1069 -@@ -19,7 +19,7 @@
1070 - // Use at your own risk!
1071 - // ==========================================================
1072 -
1073 --#include "../LibRawLite/libraw/libraw.h"
1074 -+#include <libraw.h>
1075 -
1076 - #include "FreeImage.h"
1077 - #include "Utilities.h"
1078 ---- a/Source/Metadata/XTIFF.cpp
1079 -+++ b/Source/Metadata/XTIFF.cpp
1080 -@@ -29,7 +29,7 @@
1081 - #pragma warning (disable : 4786) // identifier was truncated to 'number' characters
1082 - #endif
1083 -
1084 --#include "../LibTIFF4/tiffiop.h"
1085 -+#include "tiffiop.h"
1086 -
1087 - #include "FreeImage.h"
1088 - #include "Utilities.h"
1089 ---- a/Source/FreeImage/PluginTIFF.cpp
1090 -+++ b/Source/FreeImage/PluginTIFF.cpp
1091 -@@ -37,9 +37,9 @@
1092 -
1093 - #include "FreeImage.h"
1094 - #include "Utilities.h"
1095 --#include "../LibTIFF4/tiffiop.h"
1096 -+#include "tiffiop.h"
1097 - #include "../Metadata/FreeImageTag.h"
1098 --#include "../OpenEXR/Half/half.h"
1099 -+#include <half.h>
1100 -
1101 - #include "FreeImageIO.h"
1102 - #include "PSDParser.h"
1103 ---- a/Source/tiffiop.h
1104 -+++ b/Source/tiffiop.h
1105 -@@ -30,7 +30,9 @@
1106 - * ``Library-private'' definitions.
1107 - */
1108 -
1109 --#include "tif_config.h"
1110 -+#include <tiffconf.h>
1111 -+#define HAVE_SEARCH_H
1112 -+#define HAVE_FCNTL_H
1113 -
1114 - #ifdef HAVE_FCNTL_H
1115 - # include <fcntl.h>
1116 ---- a/Source/FreeImage/Plugin.cpp
1117 -+++ b/Source/FreeImage/Plugin.cpp
1118 -@@ -223,23 +223,33 @@
1119 - */
1120 - s_plugins->AddNode(InitBMP);
1121 - s_plugins->AddNode(InitICO);
1122 -+#ifdef USE_JPEG
1123 - s_plugins->AddNode(InitJPEG);
1124 -+#endif
1125 -+#ifdef USE_MNG
1126 - s_plugins->AddNode(InitJNG);
1127 -+#endif
1128 - s_plugins->AddNode(InitKOALA);
1129 - s_plugins->AddNode(InitIFF);
1130 -+#ifdef USE_MNG
1131 - s_plugins->AddNode(InitMNG);
1132 -+#endif
1133 - s_plugins->AddNode(InitPNM, NULL, "PBM", "Portable Bitmap (ASCII)", "pbm", "^P1");
1134 - s_plugins->AddNode(InitPNM, NULL, "PBMRAW", "Portable Bitmap (RAW)", "pbm", "^P4");
1135 - s_plugins->AddNode(InitPCD);
1136 - s_plugins->AddNode(InitPCX);
1137 - s_plugins->AddNode(InitPNM, NULL, "PGM", "Portable Greymap (ASCII)", "pgm", "^P2");
1138 - s_plugins->AddNode(InitPNM, NULL, "PGMRAW", "Portable Greymap (RAW)", "pgm", "^P5");
1139 -+#ifdef USE_PNG
1140 - s_plugins->AddNode(InitPNG);
1141 -+#endif
1142 - s_plugins->AddNode(InitPNM, NULL, "PPM", "Portable Pixelmap (ASCII)", "ppm", "^P3");
1143 - s_plugins->AddNode(InitPNM, NULL, "PPMRAW", "Portable Pixelmap (RAW)", "ppm", "^P6");
1144 - s_plugins->AddNode(InitRAS);
1145 - s_plugins->AddNode(InitTARGA);
1146 -+#ifdef USE_TIFF
1147 - s_plugins->AddNode(InitTIFF);
1148 -+#endif
1149 - s_plugins->AddNode(InitWBMP);
1150 - s_plugins->AddNode(InitPSD);
1151 - s_plugins->AddNode(InitCUT);
1152 -@@ -248,14 +258,22 @@
1153 - s_plugins->AddNode(InitDDS);
1154 - s_plugins->AddNode(InitGIF);
1155 - s_plugins->AddNode(InitHDR);
1156 -+#ifdef USE_TIFF
1157 - s_plugins->AddNode(InitG3);
1158 -+#endif
1159 - s_plugins->AddNode(InitSGI);
1160 -+#ifdef USE_EXR
1161 - s_plugins->AddNode(InitEXR);
1162 -+#endif
1163 -+#ifdef USE_JPEG2K
1164 - s_plugins->AddNode(InitJ2K);
1165 - s_plugins->AddNode(InitJP2);
1166 -+#endif
1167 - s_plugins->AddNode(InitPFM);
1168 - s_plugins->AddNode(InitPICT);
1169 -+#ifdef USE_RAW
1170 - s_plugins->AddNode(InitRAW);
1171 -+#endif
1172 - s_plugins->AddNode(InitWEBP);
1173 - #if !(defined(_MSC_VER) && (_MSC_VER <= 1310))
1174 - s_plugins->AddNode(InitJXR);
1175
1176 diff --git a/media-libs/freeimage/freeimage-3.18.0.ebuild b/media-libs/freeimage/freeimage-3.18.0.ebuild
1177 deleted file mode 100644
1178 index ddaae13..0000000
1179 --- a/media-libs/freeimage/freeimage-3.18.0.ebuild
1180 +++ /dev/null
1181 @@ -1,112 +0,0 @@
1182 -# Copyright 1999-2018 Gentoo Foundation
1183 -# Distributed under the terms of the GNU General Public License v2
1184 -
1185 -EAPI=6
1186 -
1187 -inherit eutils toolchain-funcs
1188 -
1189 -MY_PN=FreeImage
1190 -MY_PV=${PV//.}
1191 -MY_P=${MY_PN}${MY_PV}
1192 -
1193 -DESCRIPTION="Image library supporting many formats"
1194 -HOMEPAGE="http://freeimage.sourceforge.net/"
1195 -SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip
1196 - mirror://sourceforge/${PN}/${MY_P}.pdf"
1197 -
1198 -LICENSE="|| ( GPL-2 FIPL-1.0 )"
1199 -SLOT="0"
1200 -KEYWORDS="amd64 ~arm ~arm64 x86 ~amd64-linux ~x86-linux"
1201 -IUSE="jpeg jpeg2k mng openexr png raw static-libs tiff"
1202 -
1203 -# The tiff/ilmbase isn't a typo. The TIFF plugin cheats and
1204 -# uses code from it to handle 16bit<->float conversions.
1205 -RDEPEND="
1206 - sys-libs/zlib
1207 - jpeg? ( virtual/jpeg:0 )
1208 - jpeg2k? ( media-libs/openjpeg:0= )
1209 - mng? ( media-libs/libmng:= )
1210 - openexr? ( media-libs/openexr:= )
1211 - png? ( media-libs/libpng:0= )
1212 - raw? ( media-libs/libraw:= )
1213 - tiff? (
1214 - media-libs/ilmbase:=
1215 - media-libs/tiff:0
1216 - )"
1217 -DEPEND="${RDEPEND}
1218 - virtual/pkgconfig
1219 - app-arch/unzip"
1220 -
1221 -S=${WORKDIR}/${MY_PN}
1222 -
1223 -DOCS=( "${DISTDIR}"/${MY_P}.pdf README.linux Whatsnew.txt )
1224 -PATCHES=(
1225 - "${FILESDIR}"/${P}-{unbundling,raw}.patch
1226 -)
1227 -
1228 -src_prepare() {
1229 - pushd Source >/dev/null || die
1230 - if has_version ">=media-libs/libjpeg-turbo-1.2.1"; then
1231 - # Patch from Christian Heimes's fork (thanks)
1232 - # https://bitbucket.org/tiran/freeimageturbo
1233 - eapply "${FILESDIR}"/${P}-libjpeg-turbo.patch
1234 - cp LibJPEG/{jpegcomp.h,jpegint.h} . || die
1235 - fi
1236 - cp LibJPEG/{transupp.c,transupp.h,jinclude.h} . || die
1237 - cp LibTIFF4/{tiffiop,tif_dir}.h . || die
1238 - rm -rf LibPNG LibMNG LibOpenJPEG ZLib OpenEXR LibRawLite LibTIFF4 LibJPEG || die
1239 - popd >/dev/null || die
1240 -
1241 - edos2unix Makefile.{gnu,fip,srcs} fipMakefile.srcs */*.h */*/*.cpp
1242 - sed -i \
1243 - -e "s:/./:/:g" \
1244 - -e "s: ./: :g" \
1245 - -e 's: Source: \\\n\tSource:g' \
1246 - -e 's: Wrapper: \\\n\tWrapper:g' \
1247 - -e 's: Examples: \\\n\tExamples:g' \
1248 - -e 's: TestAPI: \\\n\tTestAPI:g' \
1249 - -e 's: -ISource: \\\n\t-ISource:g' \
1250 - -e 's: -IWrapper: \\\n\t-IWrapper:g' \
1251 - Makefile.srcs fipMakefile.srcs || die
1252 - sed -i \
1253 - -e "/LibJPEG/d" \
1254 - -e "/LibPNG/d" \
1255 - -e "/LibTIFF/d" \
1256 - -e "/Source\/ZLib/d" \
1257 - -e "/LibOpenJPEG/d" \
1258 - -e "/OpenEXR/d" \
1259 - -e "/LibRawLite/d" \
1260 - -e "/LibMNG/d" \
1261 - Makefile.srcs fipMakefile.srcs || die
1262 -
1263 - default
1264 -}
1265 -
1266 -foreach_make() {
1267 - local m
1268 - for m in Makefile.{gnu,fip} ; do
1269 - emake -f ${m} \
1270 - USE_EXR=$(usex openexr) \
1271 - USE_JPEG=$(usex jpeg) \
1272 - USE_JPEG2K=$(usex jpeg2k) \
1273 - USE_MNG=$(usex mng) \
1274 - USE_PNG=$(usex png) \
1275 - USE_TIFF=$(usex tiff) \
1276 - USE_RAW=$(usex raw) \
1277 - $(usex static-libs '' STATICLIB=) \
1278 - "$@"
1279 - done
1280 -}
1281 -
1282 -src_compile() {
1283 - tc-export AR PKG_CONFIG
1284 - foreach_make \
1285 - CXX="$(tc-getCXX) -fPIC" \
1286 - CC="$(tc-getCC) -fPIC" \
1287 - ${MY_PN}
1288 -}
1289 -
1290 -src_install() {
1291 - foreach_make install DESTDIR="${ED}" INSTALLDIR="${ED%/}"/usr/$(get_libdir)
1292 - einstalldocs
1293 -}
1294
1295 diff --git a/media-libs/freeimage/metadata.xml b/media-libs/freeimage/metadata.xml
1296 deleted file mode 100644
1297 index fec6409..0000000
1298 --- a/media-libs/freeimage/metadata.xml
1299 +++ /dev/null
1300 @@ -1,11 +0,0 @@
1301 -<?xml version="1.0" encoding="UTF-8"?>
1302 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
1303 -<pkgmetadata>
1304 - <maintainer type="project">
1305 - <email>games@g.o</email>
1306 - <name>Gentoo Games Project</name>
1307 - </maintainer>
1308 - <upstream>
1309 - <remote-id type="sourceforge">freeimage</remote-id>
1310 - </upstream>
1311 -</pkgmetadata>