1 |
commit: 3b0e97797339cd968083a5da4829db5d6c81e619 |
2 |
Author: Patrick Nicolas <patricknicolas <AT> laposte <DOT> net> |
3 |
AuthorDate: Tue Nov 13 21:11:07 2018 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 14 12:44:08 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b0e9779 |
7 |
|
8 |
media-libs/freeimage: version bump to 3.18.0 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/671106 |
11 |
Signed-off-by: Patrick Nicolas <patricknicolas <AT> laposte.net> |
12 |
|
13 |
Package-Manager: Portage-2.3.51, Repoman-2.3.12 |
14 |
Closes: https://github.com/gentoo/gentoo/pull/10411 |
15 |
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org> |
16 |
|
17 |
media-libs/freeimage/Manifest | 2 + |
18 |
.../files/freeimage-3.18.0-disable-plugin-G3.patch | 56 ++ |
19 |
.../freeimage/files/freeimage-3.18.0-raw.patch | 15 + |
20 |
.../freeimage-3.18.0-remove-jpeg-transform.patch | 82 +++ |
21 |
...image-3.18.0-rename-jpeg_read_icc_profile.patch | 34 + |
22 |
.../files/freeimage-3.18.0-unbundling.patch | 724 +++++++++++++++++++++ |
23 |
media-libs/freeimage/freeimage-3.18.0.ebuild | 116 ++++ |
24 |
7 files changed, 1029 insertions(+) |
25 |
|
26 |
diff --git a/media-libs/freeimage/Manifest b/media-libs/freeimage/Manifest |
27 |
index 79302f32dcf..d7eb8ba5764 100644 |
28 |
--- a/media-libs/freeimage/Manifest |
29 |
+++ b/media-libs/freeimage/Manifest |
30 |
@@ -1,2 +1,4 @@ |
31 |
DIST FreeImage3154.pdf 1007480 BLAKE2B 801d39c4b7eeab833c7225c2d53a3a0e8e9d2a91ea3f7173047705c8b750706f3a4a9ac60f7ba9d5e8150b548bd5add242e9e40f498c57ad9e5a623972bbb239 SHA512 cebde5e2609c9a0c06b4e07e1c595d7d6714895095cd9935f59c8b2ff9b34116248f5453b41f469f6242d87cae79be82d59f6a9ec0f75b1ea3df61ac1f651b28 |
32 |
DIST FreeImage3154.zip 5513923 BLAKE2B 376b00faaae2c10c9eb36f89726a022734e109ca7ca11951c9e6525f21d2a7ee305ec195be29a272ecb7935ba5d0b61f3d84f26a6aec5f7a9229d5e47cd665bb SHA512 0db9eb7d0ed8e08e10ff4fa274c4484541ca119c3d437a85fdc3b2d9232bf14a7877c79b1e62c8c99278d7020a9f623c161f2342475f3ee526233404138112cc |
33 |
+DIST FreeImage3180.pdf 1665541 BLAKE2B 5d40ee6fa0a1e73df0cc961edbd70a2835ef88fb540f123fd81f2bb826d4c949d2a60dfe3fc02406ce632a389935abac0d471c963c9803b8c2aece2b48afb003 SHA512 632f68b14f7a5916a1b95bbf86c268d0afe786a2537472301bb002254aa3195f046efb41f073133633211e985e90edbb99285ab6f42bc55501c756292a3c4c03 |
34 |
+DIST FreeImage3180.zip 7415716 BLAKE2B b695271f4e80eb304eccde66e38b5095eceae51fbe0dd97df69c55f364f8440d8c97139b8edc2f01c400f5c53a7336fdfab1e28aa3ea04f485901d5def443d25 SHA512 9d9cc7e2d57552c3115e277aeb036e0455204d389026b17a3f513da5be1fd595421655488bb1ec2f76faebed66049119ca55e26e2a6d37024b3fb7ef36ad4818 |
35 |
|
36 |
diff --git a/media-libs/freeimage/files/freeimage-3.18.0-disable-plugin-G3.patch b/media-libs/freeimage/files/freeimage-3.18.0-disable-plugin-G3.patch |
37 |
new file mode 100644 |
38 |
index 00000000000..a541bfa9464 |
39 |
--- /dev/null |
40 |
+++ b/media-libs/freeimage/files/freeimage-3.18.0-disable-plugin-G3.patch |
41 |
@@ -0,0 +1,56 @@ |
42 |
+From d07a573fa1e0593e6af4f59e7bef15b78a8edfca Mon Sep 17 00:00:00 2001 |
43 |
+From: Patrick Nicolas <xytovl@×××××××.net> |
44 |
+Date: Tue, 13 Nov 2018 20:48:39 +0100 |
45 |
+Subject: [PATCH 4/4] disable plugin G3 |
46 |
+ |
47 |
+--- |
48 |
+ Makefile.srcs | 3 --- |
49 |
+ Source/FreeImage/Plugin.cpp | 3 --- |
50 |
+ fipMakefile.srcs | 3 --- |
51 |
+ 3 files changed, 9 deletions(-) |
52 |
+ |
53 |
+diff --git a/Makefile.srcs b/Makefile.srcs |
54 |
+index a306aae..dac3ec2 100644 |
55 |
+--- a/Makefile.srcs |
56 |
++++ b/Makefile.srcs |
57 |
+@@ -37,9 +37,6 @@ SRCS-yes += \ |
58 |
+ SRCS-$(USE_EXR) += \ |
59 |
+ Source/FreeImage/PluginEXR.cpp \ |
60 |
+ |
61 |
+-SRCS-$(USE_TIFF) += \ |
62 |
+- Source/FreeImage/PluginG3.cpp \ |
63 |
+- |
64 |
+ SRCS-yes += \ |
65 |
+ Source/FreeImage/PluginGIF.cpp \ |
66 |
+ Source/FreeImage/PluginHDR.cpp \ |
67 |
+diff --git a/Source/FreeImage/Plugin.cpp b/Source/FreeImage/Plugin.cpp |
68 |
+index 7768a32..43d8b6d 100644 |
69 |
+--- a/Source/FreeImage/Plugin.cpp |
70 |
++++ b/Source/FreeImage/Plugin.cpp |
71 |
+@@ -273,9 +273,6 @@ FreeImage_Initialise(BOOL load_local_plugins_only) { |
72 |
+ s_plugins->AddNode(InitDDS); |
73 |
+ s_plugins->AddNode(InitGIF); |
74 |
+ s_plugins->AddNode(InitHDR); |
75 |
+-#ifdef USE_TIFF |
76 |
+- s_plugins->AddNode(InitG3); |
77 |
+-#endif |
78 |
+ s_plugins->AddNode(InitSGI); |
79 |
+ #ifdef USE_EXR |
80 |
+ s_plugins->AddNode(InitEXR); |
81 |
+diff --git a/fipMakefile.srcs b/fipMakefile.srcs |
82 |
+index 74c9ec0..8a48b67 100644 |
83 |
+--- a/fipMakefile.srcs |
84 |
++++ b/fipMakefile.srcs |
85 |
+@@ -37,9 +37,6 @@ SRCS-yes += \ |
86 |
+ SRCS-$(USE_EXR) += \ |
87 |
+ Source/FreeImage/PluginEXR.cpp \ |
88 |
+ |
89 |
+-SRCS-$(USE_TIFF) += \ |
90 |
+- Source/FreeImage/PluginG3.cpp \ |
91 |
+- |
92 |
+ SRCS-yes += \ |
93 |
+ Source/FreeImage/PluginGIF.cpp \ |
94 |
+ Source/FreeImage/PluginHDR.cpp \ |
95 |
+-- |
96 |
+2.19.1 |
97 |
+ |
98 |
|
99 |
diff --git a/media-libs/freeimage/files/freeimage-3.18.0-raw.patch b/media-libs/freeimage/files/freeimage-3.18.0-raw.patch |
100 |
new file mode 100644 |
101 |
index 00000000000..94accaba969 |
102 |
--- /dev/null |
103 |
+++ b/media-libs/freeimage/files/freeimage-3.18.0-raw.patch |
104 |
@@ -0,0 +1,15 @@ |
105 |
+Index: FreeImage/Source/FreeImage.h |
106 |
+=================================================================== |
107 |
+--- FreeImage.orig/Source/FreeImage.h |
108 |
++++ FreeImage/Source/FreeImage.h |
109 |
+@@ -155,8 +155,10 @@ typedef uint8_t BYTE; |
110 |
+ typedef uint16_t WORD; |
111 |
+ typedef uint32_t DWORD; |
112 |
+ typedef int32_t LONG; |
113 |
++#ifndef _LIBRAW_TYPES_H |
114 |
+ typedef int64_t INT64; |
115 |
+ typedef uint64_t UINT64; |
116 |
++#endif |
117 |
+ #else |
118 |
+ // MS is not C99 ISO compliant |
119 |
+ typedef long BOOL; |
120 |
|
121 |
diff --git a/media-libs/freeimage/files/freeimage-3.18.0-remove-jpeg-transform.patch b/media-libs/freeimage/files/freeimage-3.18.0-remove-jpeg-transform.patch |
122 |
new file mode 100644 |
123 |
index 00000000000..fb79cf7b513 |
124 |
--- /dev/null |
125 |
+++ b/media-libs/freeimage/files/freeimage-3.18.0-remove-jpeg-transform.patch |
126 |
@@ -0,0 +1,82 @@ |
127 |
+From cb27fc742dd0b569f9ffe91a99ebeb5f077971da Mon Sep 17 00:00:00 2001 |
128 |
+From: Patrick Nicolas <xytovl@×××××××.net> |
129 |
+Date: Tue, 13 Nov 2018 20:27:59 +0100 |
130 |
+Subject: [PATCH 2/4] remove jpeg transform |
131 |
+ |
132 |
+--- |
133 |
+ Makefile.srcs | 7 ------- |
134 |
+ Source/FreeImage.h | 2 ++ |
135 |
+ fipMakefile.srcs | 8 -------- |
136 |
+ 3 files changed, 2 insertions(+), 15 deletions(-) |
137 |
+ |
138 |
+diff --git a/Makefile.srcs b/Makefile.srcs |
139 |
+index cb41903..a306aae 100644 |
140 |
+--- a/Makefile.srcs |
141 |
++++ b/Makefile.srcs |
142 |
+@@ -141,17 +141,10 @@ SRCS-yes += \ |
143 |
+ Source/FreeImageToolkit/CopyPaste.cpp \ |
144 |
+ Source/FreeImageToolkit/Display.cpp \ |
145 |
+ Source/FreeImageToolkit/Flip.cpp \ |
146 |
+- |
147 |
+-SRCS-$(USE_JPEG) += \ |
148 |
+- Source/FreeImageToolkit/JPEGTransform.cpp \ |
149 |
+- |
150 |
+-SRCS-yes += \ |
151 |
+ Source/FreeImageToolkit/MultigridPoissonSolver.cpp \ |
152 |
+ Source/FreeImageToolkit/Rescale.cpp \ |
153 |
+ Source/FreeImageToolkit/Resize.cpp \ |
154 |
+ |
155 |
+-SRCS-$(USE_JPEG) += \ |
156 |
+- Source/transupp.c |
157 |
+ SRCS = $(SRCS-yes) |
158 |
+ |
159 |
+ INCLS = Dist/FreeImage.h \ |
160 |
+diff --git a/Source/FreeImage.h b/Source/FreeImage.h |
161 |
+index 12182cd..ac4e6a0 100644 |
162 |
+--- a/Source/FreeImage.h |
163 |
++++ b/Source/FreeImage.h |
164 |
+@@ -1089,6 +1089,7 @@ DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, |
165 |
+ // JPEG lossless transformation routines |
166 |
+ // -------------------------------------------------------------------------- |
167 |
+ |
168 |
++#if 0 // not supported on Gentoo |
169 |
+ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); |
170 |
+ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); |
171 |
+ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom); |
172 |
+@@ -1097,6 +1098,7 @@ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformFromHandle(FreeImageIO* src_io, |
173 |
+ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombined(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); |
174 |
+ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); |
175 |
+ DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedFromMemory(FIMEMORY* src_stream, FIMEMORY* dst_stream, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); |
176 |
++#endif |
177 |
+ |
178 |
+ |
179 |
+ // -------------------------------------------------------------------------- |
180 |
+diff --git a/fipMakefile.srcs b/fipMakefile.srcs |
181 |
+index e58f046..74c9ec0 100644 |
182 |
+--- a/fipMakefile.srcs |
183 |
++++ b/fipMakefile.srcs |
184 |
+@@ -141,11 +141,6 @@ SRCS-yes += \ |
185 |
+ Source/FreeImageToolkit/CopyPaste.cpp \ |
186 |
+ Source/FreeImageToolkit/Display.cpp \ |
187 |
+ Source/FreeImageToolkit/Flip.cpp \ |
188 |
+- |
189 |
+-SRCS-$(USE_JPEG) += \ |
190 |
+- Source/FreeImageToolkit/JPEGTransform.cpp \ |
191 |
+- |
192 |
+-SRCS-yes += \ |
193 |
+ Source/FreeImageToolkit/MultigridPoissonSolver.cpp \ |
194 |
+ Source/FreeImageToolkit/Rescale.cpp \ |
195 |
+ Source/FreeImageToolkit/Resize.cpp \ |
196 |
+@@ -157,9 +152,6 @@ SRCS-yes += \ |
197 |
+ Wrapper/FreeImagePlus/src/fipWinImage.cpp \ |
198 |
+ Wrapper/FreeImagePlus/src/FreeImagePlus.cpp |
199 |
+ |
200 |
+-SRCS-$(USE_JPEG) += \ |
201 |
+- Source/transupp.c |
202 |
+- |
203 |
+ SRCS = $(SRCS-yes) |
204 |
+ INCLUDE = -I. \ |
205 |
+ -ISource \ |
206 |
+-- |
207 |
+2.19.1 |
208 |
+ |
209 |
|
210 |
diff --git a/media-libs/freeimage/files/freeimage-3.18.0-rename-jpeg_read_icc_profile.patch b/media-libs/freeimage/files/freeimage-3.18.0-rename-jpeg_read_icc_profile.patch |
211 |
new file mode 100644 |
212 |
index 00000000000..982d00747c5 |
213 |
--- /dev/null |
214 |
+++ b/media-libs/freeimage/files/freeimage-3.18.0-rename-jpeg_read_icc_profile.patch |
215 |
@@ -0,0 +1,34 @@ |
216 |
+From 27c02a3ed6196b4b0bab5524f2825da58a76d706 Mon Sep 17 00:00:00 2001 |
217 |
+From: Patrick Nicolas <xytovl@×××××××.net> |
218 |
+Date: Tue, 13 Nov 2018 20:28:51 +0100 |
219 |
+Subject: [PATCH 3/4] rename jpeg_read_icc_profile |
220 |
+ |
221 |
+--- |
222 |
+ Source/FreeImage/PluginJPEG.cpp | 4 ++-- |
223 |
+ 1 file changed, 2 insertions(+), 2 deletions(-) |
224 |
+ |
225 |
+diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp |
226 |
+index dd97e63..569f71e 100644 |
227 |
+--- a/Source/FreeImage/PluginJPEG.cpp |
228 |
++++ b/Source/FreeImage/PluginJPEG.cpp |
229 |
+@@ -507,7 +507,7 @@ marker_is_icc(jpeg_saved_marker_ptr marker) { |
230 |
+ return FALSE. You might want to issue an error message instead. |
231 |
+ */ |
232 |
+ static BOOL |
233 |
+-jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) { |
234 |
++_jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) { |
235 |
+ jpeg_saved_marker_ptr marker; |
236 |
+ int num_markers = 0; |
237 |
+ int seq_no; |
238 |
+@@ -749,7 +749,7 @@ read_markers(j_decompress_ptr cinfo, FIBITMAP *dib) { |
239 |
+ BYTE *icc_profile = NULL; |
240 |
+ unsigned icc_length = 0; |
241 |
+ |
242 |
+- if( jpeg_read_icc_profile(cinfo, &icc_profile, &icc_length) ) { |
243 |
++ if( _jpeg_read_icc_profile(cinfo, &icc_profile, &icc_length) ) { |
244 |
+ // copy ICC profile data |
245 |
+ FreeImage_CreateICCProfile(dib, icc_profile, icc_length); |
246 |
+ // clean up |
247 |
+-- |
248 |
+2.19.1 |
249 |
+ |
250 |
|
251 |
diff --git a/media-libs/freeimage/files/freeimage-3.18.0-unbundling.patch b/media-libs/freeimage/files/freeimage-3.18.0-unbundling.patch |
252 |
new file mode 100644 |
253 |
index 00000000000..ad2e4961e44 |
254 |
--- /dev/null |
255 |
+++ b/media-libs/freeimage/files/freeimage-3.18.0-unbundling.patch |
256 |
@@ -0,0 +1,724 @@ |
257 |
+From 03a713e62529d1bcb45aedf767c7cb33ddd6e1a7 Mon Sep 17 00:00:00 2001 |
258 |
+From: Patrick Nicolas <xytovl@×××××××.net> |
259 |
+Date: Tue, 13 Nov 2018 19:40:58 +0100 |
260 |
+Subject: [PATCH 1/4] unbundling |
261 |
+ |
262 |
+diff --git a/Makefile.fip b/Makefile.fip |
263 |
+index b59c419..c6b82bb 100644 |
264 |
+--- a/Makefile.fip |
265 |
++++ b/Makefile.fip |
266 |
+@@ -11,7 +11,26 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib |
267 |
+ # Converts cr/lf to just lf |
268 |
+ DOS2UNIX = dos2unix |
269 |
+ |
270 |
+-LIBRARIES = -lstdc++ |
271 |
++PKG_CONFIG ?= pkg-config |
272 |
++ |
273 |
++USE_EXR ?= yes |
274 |
++USE_JPEG ?= yes |
275 |
++USE_JPEG2K ?= yes |
276 |
++USE_MNG ?= yes |
277 |
++USE_PNG ?= yes |
278 |
++USE_TIFF ?= yes |
279 |
++USE_RAW ?= yes |
280 |
++USE_WEBP ?= yes |
281 |
++ |
282 |
++LIBRARIES-yes = $(shell $(PKG_CONFIG) --libs zlib) |
283 |
++LIBRARIES-$(USE_EXR) += $(shell $(PKG_CONFIG) --libs OpenEXR) |
284 |
++LIBRARIES-$(USE_JPEG) += -ljpeg |
285 |
++LIBRARIES-$(USE_JPEG2K) += $(shell $(PKG_CONFIG) --libs libopenjp2) |
286 |
++LIBRARIES-$(USE_MNG) += -lmng |
287 |
++LIBRARIES-$(USE_PNG) += $(shell $(PKG_CONFIG) --libs libpng) |
288 |
++LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 IlmBase) |
289 |
++LIBRARIES-$(USE_RAW) += $(shell $(PKG_CONFIG) --libs libraw) |
290 |
++LIBRARIES-$(USE_WEBP) += $(shell $(PKG_CONFIG) --libs libwebp) |
291 |
+ |
292 |
+ MODULES = $(SRCS:.c=.o) |
293 |
+ MODULES := $(MODULES:.cpp=.o) |
294 |
+@@ -68,16 +87,18 @@ $(STATICLIB): $(MODULES) |
295 |
+ $(AR) r $@ $(MODULES) |
296 |
+ |
297 |
+ $(SHAREDLIB): $(MODULES) |
298 |
+- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) |
299 |
++ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES-yes) |
300 |
+ |
301 |
+ install: |
302 |
+ install -d $(INCDIR) $(INSTALLDIR) |
303 |
+- install -m 644 -o root -g root $(HEADER) $(INCDIR) |
304 |
+- install -m 644 -o root -g root $(HEADERFIP) $(INCDIR) |
305 |
+- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) |
306 |
+- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR) |
307 |
++ install -m 644 $(HEADER) $(INCDIR) |
308 |
++ install -m 644 $(HEADERFIP) $(INCDIR) |
309 |
++ifneq ($(STATICLIB),) |
310 |
++ install -m 644 $(STATICLIB) $(INSTALLDIR) |
311 |
++endif |
312 |
++ install -m 755 $(SHAREDLIB) $(INSTALLDIR) |
313 |
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME) |
314 |
+- ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME) |
315 |
++ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME) |
316 |
+ |
317 |
+ clean: |
318 |
+ rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) |
319 |
+diff --git a/Makefile.gnu b/Makefile.gnu |
320 |
+index 92f6358..345f0db 100644 |
321 |
+--- a/Makefile.gnu |
322 |
++++ b/Makefile.gnu |
323 |
+@@ -11,7 +11,26 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib |
324 |
+ # Converts cr/lf to just lf |
325 |
+ DOS2UNIX = dos2unix |
326 |
+ |
327 |
+-LIBRARIES = -lstdc++ |
328 |
++PKG_CONFIG ?= pkg-config |
329 |
++ |
330 |
++USE_EXR ?= yes |
331 |
++USE_JPEG ?= yes |
332 |
++USE_JPEG2K ?= yes |
333 |
++USE_MNG ?= yes |
334 |
++USE_PNG ?= yes |
335 |
++USE_TIFF ?= yes |
336 |
++USE_RAW ?= yes |
337 |
++USE_WEBP ?= yes |
338 |
++ |
339 |
++LIBRARIES-yes = $(shell $(PKG_CONFIG) --libs zlib) |
340 |
++LIBRARIES-$(USE_EXR) += $(shell $(PKG_CONFIG) --libs OpenEXR) |
341 |
++LIBRARIES-$(USE_JPEG) += -ljpeg |
342 |
++LIBRARIES-$(USE_JPEG2K) += $(shell $(PKG_CONFIG) --libs libopenjp2) |
343 |
++LIBRARIES-$(USE_MNG) += -lmng |
344 |
++LIBRARIES-$(USE_PNG) += $(shell $(PKG_CONFIG) --libs libpng) |
345 |
++LIBRARIES-$(USE_TIFF) += $(shell $(PKG_CONFIG) --libs libtiff-4 IlmBase) |
346 |
++LIBRARIES-$(USE_RAW) += $(shell $(PKG_CONFIG) --libs libraw) |
347 |
++LIBRARIES-$(USE_WEBP) += $(shell $(PKG_CONFIG) --libs libwebp) |
348 |
+ |
349 |
+ MODULES = $(SRCS:.c=.o) |
350 |
+ MODULES := $(MODULES:.cpp=.o) |
351 |
+@@ -67,13 +86,15 @@ $(STATICLIB): $(MODULES) |
352 |
+ $(AR) r $@ $(MODULES) |
353 |
+ |
354 |
+ $(SHAREDLIB): $(MODULES) |
355 |
+- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) |
356 |
++ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES-yes) |
357 |
+ |
358 |
+ install: |
359 |
+ install -d $(INCDIR) $(INSTALLDIR) |
360 |
+- install -m 644 -o root -g root $(HEADER) $(INCDIR) |
361 |
+- install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) |
362 |
+- install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR) |
363 |
++ install -m 644 $(HEADER) $(INCDIR) |
364 |
++ifneq ($(STATICLIB),) |
365 |
++ install -m 644 $(STATICLIB) $(INSTALLDIR) |
366 |
++endif |
367 |
++ install -m 755 $(SHAREDLIB) $(INSTALLDIR) |
368 |
+ ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME) |
369 |
+ ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME) |
370 |
+ # ldconfig |
371 |
+diff --git a/Makefile.srcs b/Makefile.srcs |
372 |
+index de25754..cb41903 100644 |
373 |
+--- a/Makefile.srcs |
374 |
++++ b/Makefile.srcs |
375 |
+@@ -1,6 +1,15 @@ |
376 |
++USE_EXR ?= yes |
377 |
++USE_JPEG ?= yes |
378 |
++USE_JPEG2K ?= yes |
379 |
++USE_MNG ?= yes |
380 |
++USE_PNG ?= yes |
381 |
++USE_TIFF ?= yes |
382 |
++USE_RAW ?= yes |
383 |
++USE_WEBP ?= yes |
384 |
++ |
385 |
+ VER_MAJOR = 3 |
386 |
+ VER_MINOR = 18.0 |
387 |
+-SRCS = \ |
388 |
++SRCS-yes = \ |
389 |
+ Source/FreeImage/BitmapAccess.cpp \ |
390 |
+ Source/FreeImage/ColorLookup.cpp \ |
391 |
+ Source/FreeImage/ConversionRGBA16.cpp \ |
392 |
+@@ -12,39 +21,80 @@ SRCS = \ |
393 |
+ Source/FreeImage/LFPQuantizer.cpp \ |
394 |
+ Source/FreeImage/MemoryIO.cpp \ |
395 |
+ Source/FreeImage/PixelAccess.cpp \ |
396 |
++ |
397 |
++SRCS-$(USE_JPEG2K) += \ |
398 |
+ Source/FreeImage/J2KHelper.cpp \ |
399 |
++ |
400 |
++SRCS-$(USE_MNG) += \ |
401 |
+ Source/FreeImage/MNGHelper.cpp \ |
402 |
++ |
403 |
++SRCS-yes += \ |
404 |
+ Source/FreeImage/Plugin.cpp \ |
405 |
+ Source/FreeImage/PluginBMP.cpp \ |
406 |
+ Source/FreeImage/PluginCUT.cpp \ |
407 |
+ Source/FreeImage/PluginDDS.cpp \ |
408 |
++ |
409 |
++SRCS-$(USE_EXR) += \ |
410 |
+ Source/FreeImage/PluginEXR.cpp \ |
411 |
++ |
412 |
++SRCS-$(USE_TIFF) += \ |
413 |
+ Source/FreeImage/PluginG3.cpp \ |
414 |
++ |
415 |
++SRCS-yes += \ |
416 |
+ Source/FreeImage/PluginGIF.cpp \ |
417 |
+ Source/FreeImage/PluginHDR.cpp \ |
418 |
+ Source/FreeImage/PluginICO.cpp \ |
419 |
+ Source/FreeImage/PluginIFF.cpp \ |
420 |
++ |
421 |
++SRCS-$(USE_JPEG2K) += \ |
422 |
+ Source/FreeImage/PluginJ2K.cpp \ |
423 |
++ |
424 |
++SRCS-$(USE_MNG) += \ |
425 |
+ Source/FreeImage/PluginJNG.cpp \ |
426 |
++ |
427 |
++SRCS-$(USE_JPEG2K) += \ |
428 |
+ Source/FreeImage/PluginJP2.cpp \ |
429 |
++ |
430 |
++SRCS-$(USE_JPEG) += \ |
431 |
+ Source/FreeImage/PluginJPEG.cpp \ |
432 |
+- Source/FreeImage/PluginJXR.cpp \ |
433 |
++ |
434 |
++SRCS-yes += \ |
435 |
+ Source/FreeImage/PluginKOALA.cpp \ |
436 |
++ |
437 |
++SRCS-$(USE_MNG) += \ |
438 |
+ Source/FreeImage/PluginMNG.cpp \ |
439 |
++ |
440 |
++SRCS-yes += \ |
441 |
+ Source/FreeImage/PluginPCD.cpp \ |
442 |
+ Source/FreeImage/PluginPCX.cpp \ |
443 |
+ Source/FreeImage/PluginPFM.cpp \ |
444 |
+ Source/FreeImage/PluginPICT.cpp \ |
445 |
++ |
446 |
++SRCS-$(USE_PNG) += \ |
447 |
+ Source/FreeImage/PluginPNG.cpp \ |
448 |
++ |
449 |
++SRCS-yes += \ |
450 |
+ Source/FreeImage/PluginPNM.cpp \ |
451 |
+ Source/FreeImage/PluginPSD.cpp \ |
452 |
+ Source/FreeImage/PluginRAS.cpp \ |
453 |
++ |
454 |
++SRCS-$(USE_RAW) += \ |
455 |
+ Source/FreeImage/PluginRAW.cpp \ |
456 |
++ |
457 |
++SRCS-yes += \ |
458 |
+ Source/FreeImage/PluginSGI.cpp \ |
459 |
+ Source/FreeImage/PluginTARGA.cpp \ |
460 |
++ |
461 |
++SRCS-$(USE_TIFF) += \ |
462 |
+ Source/FreeImage/PluginTIFF.cpp \ |
463 |
++ |
464 |
++SRCS-yes += \ |
465 |
+ Source/FreeImage/PluginWBMP.cpp \ |
466 |
++ |
467 |
++SRCS-$(USE_WEBP) += \ |
468 |
+ Source/FreeImage/PluginWebP.cpp \ |
469 |
++ |
470 |
++SRCS-yes += \ |
471 |
+ Source/FreeImage/PluginXBM.cpp \ |
472 |
+ Source/FreeImage/PluginXPM.cpp \ |
473 |
+ Source/FreeImage/PSDParser.cpp \ |
474 |
+@@ -78,7 +128,11 @@ SRCS = \ |
475 |
+ Source/Metadata/IPTC.cpp \ |
476 |
+ Source/Metadata/TagConversion.cpp \ |
477 |
+ Source/Metadata/TagLib.cpp \ |
478 |
++ |
479 |
++SRCS-$(USE_TIFF) += \ |
480 |
+ Source/Metadata/XTIFF.cpp \ |
481 |
++ |
482 |
++SRCS-yes += \ |
483 |
+ Source/FreeImageToolkit/Background.cpp \ |
484 |
+ Source/FreeImageToolkit/BSplineRotate.cpp \ |
485 |
+ Source/FreeImageToolkit/Channels.cpp \ |
486 |
+@@ -87,11 +141,19 @@ SRCS = \ |
487 |
+ Source/FreeImageToolkit/CopyPaste.cpp \ |
488 |
+ Source/FreeImageToolkit/Display.cpp \ |
489 |
+ Source/FreeImageToolkit/Flip.cpp \ |
490 |
++ |
491 |
++SRCS-$(USE_JPEG) += \ |
492 |
+ Source/FreeImageToolkit/JPEGTransform.cpp \ |
493 |
++ |
494 |
++SRCS-yes += \ |
495 |
+ Source/FreeImageToolkit/MultigridPoissonSolver.cpp \ |
496 |
+ Source/FreeImageToolkit/Rescale.cpp \ |
497 |
+ Source/FreeImageToolkit/Resize.cpp \ |
498 |
+ |
499 |
++SRCS-$(USE_JPEG) += \ |
500 |
++ Source/transupp.c |
501 |
++SRCS = $(SRCS-yes) |
502 |
++ |
503 |
+ INCLS = Dist/FreeImage.h \ |
504 |
+ Examples/OpenGL/TextureManager/TextureManager.h \ |
505 |
+ Examples/Plugin/PluginCradle.h \ |
506 |
+@@ -117,7 +179,18 @@ INCLS = Dist/FreeImage.h \ |
507 |
+ Wrapper/FreeImagePlus/test/fipTest.h \ |
508 |
+ TestAPI/TestSuite.h |
509 |
+ |
510 |
+-INCLUDE = -I. \ |
511 |
++INCLUDE-yes = -I. \ |
512 |
+ -ISource \ |
513 |
+ -ISource/Metadata \ |
514 |
+ -ISource/FreeImageToolkit \ |
515 |
++ |
516 |
++INCLUDE-yes += $(shell $(PKG_CONFIG) --cflags-only-I zlib) |
517 |
++INCLUDE-$(USE_EXR) += -DUSE_EXR $(shell $(PKG_CONFIG) --cflags-only-I OpenEXR) |
518 |
++INCLUDE-$(USE_JPEG) += -DUSE_JPEG |
519 |
++INCLUDE-$(USE_JPEG2K) += -DUSE_JPEG2K $(shell $(PKG_CONFIG) --cflags-only-I libopenjp2) |
520 |
++INCLUDE-$(USE_MNG) += -DUSE_MNG |
521 |
++INCLUDE-$(USE_PNG) += -DUSE_PNG $(shell $(PKG_CONFIG) --cflags-only-I libpng) |
522 |
++INCLUDE-$(USE_TIFF) += -DUSE_TIFF $(shell $(PKG_CONFIG) --cflags-only-I libtiff-4 IlmBase) |
523 |
++INCLUDE-$(USE_RAW) += -DUSE_RAW $(shell $(PKG_CONFIG) --cflags-only-I libraw) |
524 |
++INCLUDE-$(USE_WEBP) += -DUSE_WEBP $(shell $(PKG_CONFIG) --cflags-only-I libwebp) |
525 |
++INCLUDE = $(INCLUDE-yes) |
526 |
+diff --git a/Source/FreeImage/J2KHelper.cpp b/Source/FreeImage/J2KHelper.cpp |
527 |
+index 1776c3b..538f1c5 100644 |
528 |
+--- a/Source/FreeImage/J2KHelper.cpp |
529 |
++++ b/Source/FreeImage/J2KHelper.cpp |
530 |
+@@ -21,7 +21,7 @@ |
531 |
+ |
532 |
+ #include "FreeImage.h" |
533 |
+ #include "Utilities.h" |
534 |
+-#include "../LibOpenJPEG/openjpeg.h" |
535 |
++#include <openjpeg.h> |
536 |
+ #include "J2KHelper.h" |
537 |
+ |
538 |
+ // -------------------------------------------------------------------------- |
539 |
+diff --git a/Source/FreeImage/Plugin.cpp b/Source/FreeImage/Plugin.cpp |
540 |
+index 11e7294..7768a32 100644 |
541 |
+--- a/Source/FreeImage/Plugin.cpp |
542 |
++++ b/Source/FreeImage/Plugin.cpp |
543 |
+@@ -238,23 +238,33 @@ FreeImage_Initialise(BOOL load_local_plugins_only) { |
544 |
+ */ |
545 |
+ s_plugins->AddNode(InitBMP); |
546 |
+ s_plugins->AddNode(InitICO); |
547 |
++#ifdef USE_JPEG |
548 |
+ s_plugins->AddNode(InitJPEG); |
549 |
++#endif |
550 |
++#ifdef USE_MNG |
551 |
+ s_plugins->AddNode(InitJNG); |
552 |
++#endif |
553 |
+ s_plugins->AddNode(InitKOALA); |
554 |
+ s_plugins->AddNode(InitIFF); |
555 |
++#ifdef USE_MNG |
556 |
+ s_plugins->AddNode(InitMNG); |
557 |
++#endif |
558 |
+ s_plugins->AddNode(InitPNM, NULL, "PBM", "Portable Bitmap (ASCII)", "pbm", "^P1"); |
559 |
+ s_plugins->AddNode(InitPNM, NULL, "PBMRAW", "Portable Bitmap (RAW)", "pbm", "^P4"); |
560 |
+ s_plugins->AddNode(InitPCD); |
561 |
+ s_plugins->AddNode(InitPCX); |
562 |
+ s_plugins->AddNode(InitPNM, NULL, "PGM", "Portable Greymap (ASCII)", "pgm", "^P2"); |
563 |
+ s_plugins->AddNode(InitPNM, NULL, "PGMRAW", "Portable Greymap (RAW)", "pgm", "^P5"); |
564 |
++#ifdef USE_PNG |
565 |
+ s_plugins->AddNode(InitPNG); |
566 |
++#endif |
567 |
+ s_plugins->AddNode(InitPNM, NULL, "PPM", "Portable Pixelmap (ASCII)", "ppm", "^P3"); |
568 |
+ s_plugins->AddNode(InitPNM, NULL, "PPMRAW", "Portable Pixelmap (RAW)", "ppm", "^P6"); |
569 |
+ s_plugins->AddNode(InitRAS); |
570 |
+ s_plugins->AddNode(InitTARGA); |
571 |
++#ifdef USE_TIFF |
572 |
+ s_plugins->AddNode(InitTIFF); |
573 |
++#endif |
574 |
+ s_plugins->AddNode(InitWBMP); |
575 |
+ s_plugins->AddNode(InitPSD); |
576 |
+ s_plugins->AddNode(InitCUT); |
577 |
+@@ -263,16 +273,26 @@ FreeImage_Initialise(BOOL load_local_plugins_only) { |
578 |
+ s_plugins->AddNode(InitDDS); |
579 |
+ s_plugins->AddNode(InitGIF); |
580 |
+ s_plugins->AddNode(InitHDR); |
581 |
++#ifdef USE_TIFF |
582 |
+ s_plugins->AddNode(InitG3); |
583 |
++#endif |
584 |
+ s_plugins->AddNode(InitSGI); |
585 |
++#ifdef USE_EXR |
586 |
+ s_plugins->AddNode(InitEXR); |
587 |
++#endif |
588 |
++#ifdef USE_JPEG2K |
589 |
+ s_plugins->AddNode(InitJ2K); |
590 |
+ s_plugins->AddNode(InitJP2); |
591 |
++#endif |
592 |
+ s_plugins->AddNode(InitPFM); |
593 |
+ s_plugins->AddNode(InitPICT); |
594 |
++#ifdef USE_RAW |
595 |
+ s_plugins->AddNode(InitRAW); |
596 |
++#endif |
597 |
++#ifdef USE_WEBP |
598 |
+ s_plugins->AddNode(InitWEBP); |
599 |
+-#if !(defined(_MSC_VER) && (_MSC_VER <= 1310)) |
600 |
++#endif |
601 |
++#if 0 |
602 |
+ s_plugins->AddNode(InitJXR); |
603 |
+ #endif // unsupported by MS Visual Studio 2003 !!! |
604 |
+ |
605 |
+diff --git a/Source/FreeImage/PluginEXR.cpp b/Source/FreeImage/PluginEXR.cpp |
606 |
+index b286430..faa8037 100644 |
607 |
+--- a/Source/FreeImage/PluginEXR.cpp |
608 |
++++ b/Source/FreeImage/PluginEXR.cpp |
609 |
+@@ -28,16 +28,16 @@ |
610 |
+ #pragma warning (disable : 4800) // ImfVersion.h - 'const int' : forcing value to bool 'true' or 'false' (performance warning) |
611 |
+ #endif |
612 |
+ |
613 |
+-#include "../OpenEXR/IlmImf/ImfIO.h" |
614 |
+-#include "../OpenEXR/Iex/Iex.h" |
615 |
+-#include "../OpenEXR/IlmImf/ImfOutputFile.h" |
616 |
+-#include "../OpenEXR/IlmImf/ImfInputFile.h" |
617 |
+-#include "../OpenEXR/IlmImf/ImfRgbaFile.h" |
618 |
+-#include "../OpenEXR/IlmImf/ImfChannelList.h" |
619 |
+-#include "../OpenEXR/IlmImf/ImfRgba.h" |
620 |
+-#include "../OpenEXR/IlmImf/ImfArray.h" |
621 |
+-#include "../OpenEXR/IlmImf/ImfPreviewImage.h" |
622 |
+-#include "../OpenEXR/Half/half.h" |
623 |
++#include <ImfIO.h> |
624 |
++#include <Iex.h> |
625 |
++#include <ImfOutputFile.h> |
626 |
++#include <ImfInputFile.h> |
627 |
++#include <ImfRgbaFile.h> |
628 |
++#include <ImfChannelList.h> |
629 |
++#include <ImfRgba.h> |
630 |
++#include <ImfArray.h> |
631 |
++#include <ImfPreviewImage.h> |
632 |
++#include <half.h> |
633 |
+ |
634 |
+ |
635 |
+ // ========================================================== |
636 |
+diff --git a/Source/FreeImage/PluginG3.cpp b/Source/FreeImage/PluginG3.cpp |
637 |
+index 0a083b4..b3a9bd7 100644 |
638 |
+--- a/Source/FreeImage/PluginG3.cpp |
639 |
++++ b/Source/FreeImage/PluginG3.cpp |
640 |
+@@ -20,7 +20,7 @@ |
641 |
+ // Use at your own risk! |
642 |
+ // ========================================================== |
643 |
+ |
644 |
+-#include "../LibTIFF4/tiffiop.h" |
645 |
++#include "tiffiop.h" |
646 |
+ |
647 |
+ #include "FreeImage.h" |
648 |
+ #include "Utilities.h" |
649 |
+diff --git a/Source/FreeImage/PluginJ2K.cpp b/Source/FreeImage/PluginJ2K.cpp |
650 |
+index b8bcfc8..621a903 100644 |
651 |
+--- a/Source/FreeImage/PluginJ2K.cpp |
652 |
++++ b/Source/FreeImage/PluginJ2K.cpp |
653 |
+@@ -21,7 +21,7 @@ |
654 |
+ |
655 |
+ #include "FreeImage.h" |
656 |
+ #include "Utilities.h" |
657 |
+-#include "../LibOpenJPEG/openjpeg.h" |
658 |
++#include <openjpeg.h> |
659 |
+ #include "J2KHelper.h" |
660 |
+ |
661 |
+ // ========================================================== |
662 |
+diff --git a/Source/FreeImage/PluginJP2.cpp b/Source/FreeImage/PluginJP2.cpp |
663 |
+index 742fe2c..c57f626 100644 |
664 |
+--- a/Source/FreeImage/PluginJP2.cpp |
665 |
++++ b/Source/FreeImage/PluginJP2.cpp |
666 |
+@@ -21,7 +21,7 @@ |
667 |
+ |
668 |
+ #include "FreeImage.h" |
669 |
+ #include "Utilities.h" |
670 |
+-#include "../LibOpenJPEG/openjpeg.h" |
671 |
++#include <openjpeg.h> |
672 |
+ #include "J2KHelper.h" |
673 |
+ |
674 |
+ // ========================================================== |
675 |
+diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp |
676 |
+index 8db177d..dd97e63 100644 |
677 |
+--- a/Source/FreeImage/PluginJPEG.cpp |
678 |
++++ b/Source/FreeImage/PluginJPEG.cpp |
679 |
+@@ -35,11 +35,15 @@ extern "C" { |
680 |
+ #undef FAR |
681 |
+ #include <setjmp.h> |
682 |
+ |
683 |
+-#include "../LibJPEG/jinclude.h" |
684 |
+-#include "../LibJPEG/jpeglib.h" |
685 |
+-#include "../LibJPEG/jerror.h" |
686 |
++#include <string.h> |
687 |
++#include <stdio.h> |
688 |
++#include <jconfig.h> |
689 |
++#include <jpeglib.h> |
690 |
++#include <jerror.h> |
691 |
+ } |
692 |
+ |
693 |
++#define SIZEOF(object) ((size_t) sizeof(object)) |
694 |
++ |
695 |
+ #include "FreeImage.h" |
696 |
+ #include "Utilities.h" |
697 |
+ |
698 |
+diff --git a/Source/FreeImage/PluginPNG.cpp b/Source/FreeImage/PluginPNG.cpp |
699 |
+index 661f160..504fafe 100644 |
700 |
+--- a/Source/FreeImage/PluginPNG.cpp |
701 |
++++ b/Source/FreeImage/PluginPNG.cpp |
702 |
+@@ -40,8 +40,8 @@ |
703 |
+ |
704 |
+ // ---------------------------------------------------------- |
705 |
+ |
706 |
+-#include "../ZLib/zlib.h" |
707 |
+-#include "../LibPNG/png.h" |
708 |
++#include <zlib.h> |
709 |
++#include <png.h> |
710 |
+ |
711 |
+ // ---------------------------------------------------------- |
712 |
+ |
713 |
+diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp |
714 |
+index e9bd5bf..680e634 100644 |
715 |
+--- a/Source/FreeImage/PluginRAW.cpp |
716 |
++++ b/Source/FreeImage/PluginRAW.cpp |
717 |
+@@ -19,7 +19,7 @@ |
718 |
+ // Use at your own risk! |
719 |
+ // ========================================================== |
720 |
+ |
721 |
+-#include "../LibRawLite/libraw/libraw.h" |
722 |
++#include <libraw.h> |
723 |
+ |
724 |
+ #include "FreeImage.h" |
725 |
+ #include "Utilities.h" |
726 |
+diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp |
727 |
+index 67fab0b..36f99e8 100644 |
728 |
+--- a/Source/FreeImage/PluginTIFF.cpp |
729 |
++++ b/Source/FreeImage/PluginTIFF.cpp |
730 |
+@@ -37,9 +37,9 @@ |
731 |
+ |
732 |
+ #include "FreeImage.h" |
733 |
+ #include "Utilities.h" |
734 |
+-#include "../LibTIFF4/tiffiop.h" |
735 |
++#include "tiffiop.h" |
736 |
+ #include "../Metadata/FreeImageTag.h" |
737 |
+-#include "../OpenEXR/Half/half.h" |
738 |
++#include <half.h> |
739 |
+ |
740 |
+ #include "FreeImageIO.h" |
741 |
+ #include "PSDParser.h" |
742 |
+diff --git a/Source/FreeImage/PluginWebP.cpp b/Source/FreeImage/PluginWebP.cpp |
743 |
+index 7c9f62f..c401447 100644 |
744 |
+--- a/Source/FreeImage/PluginWebP.cpp |
745 |
++++ b/Source/FreeImage/PluginWebP.cpp |
746 |
+@@ -24,9 +24,9 @@ |
747 |
+ |
748 |
+ #include "../Metadata/FreeImageTag.h" |
749 |
+ |
750 |
+-#include "../LibWebP/src/webp/decode.h" |
751 |
+-#include "../LibWebP/src/webp/encode.h" |
752 |
+-#include "../LibWebP/src/webp/mux.h" |
753 |
++#include <webp/decode.h> |
754 |
++#include <webp/encode.h> |
755 |
++#include <webp/mux.h> |
756 |
+ |
757 |
+ // ========================================================== |
758 |
+ // Plugin Interface |
759 |
+diff --git a/Source/FreeImage/ZLibInterface.cpp b/Source/FreeImage/ZLibInterface.cpp |
760 |
+index 3ab6d32..7e32110 100644 |
761 |
+--- a/Source/FreeImage/ZLibInterface.cpp |
762 |
++++ b/Source/FreeImage/ZLibInterface.cpp |
763 |
+@@ -19,10 +19,10 @@ |
764 |
+ // Use at your own risk! |
765 |
+ // ========================================================== |
766 |
+ |
767 |
+-#include "../ZLib/zlib.h" |
768 |
++#include <zlib.h> |
769 |
+ #include "FreeImage.h" |
770 |
+ #include "Utilities.h" |
771 |
+-#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */ |
772 |
++#define OS_CODE 0x03 |
773 |
+ |
774 |
+ /** |
775 |
+ Compresses a source buffer into a target buffer, using the ZLib library. |
776 |
+diff --git a/Source/FreeImageToolkit/JPEGTransform.cpp b/Source/FreeImageToolkit/JPEGTransform.cpp |
777 |
+index 6f9ba8e..988d777 100644 |
778 |
+--- a/Source/FreeImageToolkit/JPEGTransform.cpp |
779 |
++++ b/Source/FreeImageToolkit/JPEGTransform.cpp |
780 |
+@@ -26,10 +26,11 @@ extern "C" { |
781 |
+ #undef FAR |
782 |
+ #include <setjmp.h> |
783 |
+ |
784 |
+-#include "../LibJPEG/jinclude.h" |
785 |
+-#include "../LibJPEG/jpeglib.h" |
786 |
+-#include "../LibJPEG/jerror.h" |
787 |
+-#include "../LibJPEG/transupp.h" |
788 |
++#include <string.h> |
789 |
++#include <stdio.h> |
790 |
++#include <jpeglib.h> |
791 |
++#include <jerror.h> |
792 |
++#include "transupp.h" |
793 |
+ } |
794 |
+ |
795 |
+ #include "FreeImage.h" |
796 |
+diff --git a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp |
797 |
+index d5be902..7f2be42 100644 |
798 |
+--- a/Source/Metadata/XTIFF.cpp |
799 |
++++ b/Source/Metadata/XTIFF.cpp |
800 |
+@@ -29,7 +29,7 @@ |
801 |
+ #pragma warning (disable : 4786) // identifier was truncated to 'number' characters |
802 |
+ #endif |
803 |
+ |
804 |
+-#include "../LibTIFF4/tiffiop.h" |
805 |
++#include "tiffiop.h" |
806 |
+ |
807 |
+ #include "FreeImage.h" |
808 |
+ #include "Utilities.h" |
809 |
+diff --git a/Source/tiffiop.h b/Source/tiffiop.h |
810 |
+index 2fe7556..1642582 100644 |
811 |
+--- a/Source/tiffiop.h |
812 |
++++ b/Source/tiffiop.h |
813 |
+@@ -28,7 +28,10 @@ |
814 |
+ * ``Library-private'' definitions. |
815 |
+ */ |
816 |
+ |
817 |
+-#include "tif_config.h" |
818 |
++#include <tiffconf.h> |
819 |
++#define HAVE_SEARCH_H |
820 |
++#define HAVE_FCNTL_H |
821 |
++#define HAVE_SNPRINTF |
822 |
+ |
823 |
+ #ifdef HAVE_FCNTL_H |
824 |
+ # include <fcntl.h> |
825 |
+diff --git a/Source/transupp.c b/Source/transupp.c |
826 |
+index d10f57b..d50216c 100644 |
827 |
+--- a/Source/transupp.c |
828 |
++++ b/Source/transupp.c |
829 |
+@@ -15,8 +15,7 @@ |
830 |
+ /* Although this file really shouldn't have access to the library internals, |
831 |
+ * it's helpful to let it call jround_up() and jcopy_block_row(). |
832 |
+ */ |
833 |
+-#define JPEG_INTERNALS |
834 |
+- |
835 |
++#include <jerror.h> |
836 |
+ #include "jinclude.h" |
837 |
+ #include "jpeglib.h" |
838 |
+ #include "transupp.h" /* My own external interface */ |
839 |
+diff --git a/fipMakefile.srcs b/fipMakefile.srcs |
840 |
+index d271b4b..e58f046 100644 |
841 |
+--- a/fipMakefile.srcs |
842 |
++++ b/fipMakefile.srcs |
843 |
+@@ -1,6 +1,15 @@ |
844 |
++USE_EXR ?= yes |
845 |
++USE_JPEG ?= yes |
846 |
++USE_JPEG2K ?= yes |
847 |
++USE_MNG ?= yes |
848 |
++USE_PNG ?= yes |
849 |
++USE_TIFF ?= yes |
850 |
++USE_RAW ?= yes |
851 |
++USE_WEBP ?= yes |
852 |
++ |
853 |
+ VER_MAJOR = 3 |
854 |
+ VER_MINOR = 18.0 |
855 |
+-SRCS = \ |
856 |
++SRCS-yes = \ |
857 |
+ Source/FreeImage/BitmapAccess.cpp \ |
858 |
+ Source/FreeImage/ColorLookup.cpp \ |
859 |
+ Source/FreeImage/ConversionRGBA16.cpp \ |
860 |
+@@ -12,39 +21,80 @@ SRCS = \ |
861 |
+ Source/FreeImage/LFPQuantizer.cpp \ |
862 |
+ Source/FreeImage/MemoryIO.cpp \ |
863 |
+ Source/FreeImage/PixelAccess.cpp \ |
864 |
++ |
865 |
++SRCS-$(USE_JPEG2K) += \ |
866 |
+ Source/FreeImage/J2KHelper.cpp \ |
867 |
++ |
868 |
++SRCS-$(USE_MNG) += \ |
869 |
+ Source/FreeImage/MNGHelper.cpp \ |
870 |
++ |
871 |
++SRCS-yes += \ |
872 |
+ Source/FreeImage/Plugin.cpp \ |
873 |
+ Source/FreeImage/PluginBMP.cpp \ |
874 |
+ Source/FreeImage/PluginCUT.cpp \ |
875 |
+ Source/FreeImage/PluginDDS.cpp \ |
876 |
++ |
877 |
++SRCS-$(USE_EXR) += \ |
878 |
+ Source/FreeImage/PluginEXR.cpp \ |
879 |
++ |
880 |
++SRCS-$(USE_TIFF) += \ |
881 |
+ Source/FreeImage/PluginG3.cpp \ |
882 |
++ |
883 |
++SRCS-yes += \ |
884 |
+ Source/FreeImage/PluginGIF.cpp \ |
885 |
+ Source/FreeImage/PluginHDR.cpp \ |
886 |
+ Source/FreeImage/PluginICO.cpp \ |
887 |
+ Source/FreeImage/PluginIFF.cpp \ |
888 |
++ |
889 |
++SRCS-$(USE_JPEG2K) += \ |
890 |
+ Source/FreeImage/PluginJ2K.cpp \ |
891 |
++ |
892 |
++SRCS-$(USE_MNG) += \ |
893 |
+ Source/FreeImage/PluginJNG.cpp \ |
894 |
++ |
895 |
++SRCS-$(USE_JPEG2K) += \ |
896 |
+ Source/FreeImage/PluginJP2.cpp \ |
897 |
++ |
898 |
++SRCS-$(USE_JPEG) += \ |
899 |
+ Source/FreeImage/PluginJPEG.cpp \ |
900 |
+- Source/FreeImage/PluginJXR.cpp \ |
901 |
++ |
902 |
++SRCS-yes += \ |
903 |
+ Source/FreeImage/PluginKOALA.cpp \ |
904 |
++ |
905 |
++SRCS-$(USE_MNG) += \ |
906 |
+ Source/FreeImage/PluginMNG.cpp \ |
907 |
++ |
908 |
++SRCS-yes += \ |
909 |
+ Source/FreeImage/PluginPCD.cpp \ |
910 |
+ Source/FreeImage/PluginPCX.cpp \ |
911 |
+ Source/FreeImage/PluginPFM.cpp \ |
912 |
+ Source/FreeImage/PluginPICT.cpp \ |
913 |
++ |
914 |
++SRCS-$(USE_PNG) += \ |
915 |
+ Source/FreeImage/PluginPNG.cpp \ |
916 |
++ |
917 |
++SRCS-yes += \ |
918 |
+ Source/FreeImage/PluginPNM.cpp \ |
919 |
+ Source/FreeImage/PluginPSD.cpp \ |
920 |
+ Source/FreeImage/PluginRAS.cpp \ |
921 |
++ |
922 |
++SRCS-$(USE_RAW) += \ |
923 |
+ Source/FreeImage/PluginRAW.cpp \ |
924 |
++ |
925 |
++SRCS-yes += \ |
926 |
+ Source/FreeImage/PluginSGI.cpp \ |
927 |
+ Source/FreeImage/PluginTARGA.cpp \ |
928 |
++ |
929 |
++SRCS-$(USE_TIFF) += \ |
930 |
+ Source/FreeImage/PluginTIFF.cpp \ |
931 |
++ |
932 |
++SRCS-yes += \ |
933 |
+ Source/FreeImage/PluginWBMP.cpp \ |
934 |
++ |
935 |
++SRCS-$(USE_WEBP) += \ |
936 |
+ Source/FreeImage/PluginWebP.cpp \ |
937 |
++ |
938 |
++SRCS-yes += \ |
939 |
+ Source/FreeImage/PluginXBM.cpp \ |
940 |
+ Source/FreeImage/PluginXPM.cpp \ |
941 |
+ Source/FreeImage/PSDParser.cpp \ |
942 |
+@@ -78,7 +128,11 @@ SRCS = \ |
943 |
+ Source/Metadata/IPTC.cpp \ |
944 |
+ Source/Metadata/TagConversion.cpp \ |
945 |
+ Source/Metadata/TagLib.cpp \ |
946 |
++ |
947 |
++SRCS-$(USE_TIFF) += \ |
948 |
+ Source/Metadata/XTIFF.cpp \ |
949 |
++ |
950 |
++SRCS-yes += \ |
951 |
+ Source/FreeImageToolkit/Background.cpp \ |
952 |
+ Source/FreeImageToolkit/BSplineRotate.cpp \ |
953 |
+ Source/FreeImageToolkit/Channels.cpp \ |
954 |
+@@ -87,7 +141,11 @@ SRCS = \ |
955 |
+ Source/FreeImageToolkit/CopyPaste.cpp \ |
956 |
+ Source/FreeImageToolkit/Display.cpp \ |
957 |
+ Source/FreeImageToolkit/Flip.cpp \ |
958 |
++ |
959 |
++SRCS-$(USE_JPEG) += \ |
960 |
+ Source/FreeImageToolkit/JPEGTransform.cpp \ |
961 |
++ |
962 |
++SRCS-yes += \ |
963 |
+ Source/FreeImageToolkit/MultigridPoissonSolver.cpp \ |
964 |
+ Source/FreeImageToolkit/Rescale.cpp \ |
965 |
+ Source/FreeImageToolkit/Resize.cpp \ |
966 |
+@@ -98,6 +156,11 @@ SRCS = \ |
967 |
+ Wrapper/FreeImagePlus/src/fipTag.cpp \ |
968 |
+ Wrapper/FreeImagePlus/src/fipWinImage.cpp \ |
969 |
+ Wrapper/FreeImagePlus/src/FreeImagePlus.cpp |
970 |
++ |
971 |
++SRCS-$(USE_JPEG) += \ |
972 |
++ Source/transupp.c |
973 |
++ |
974 |
++SRCS = $(SRCS-yes) |
975 |
+ INCLUDE = -I. \ |
976 |
+ -ISource \ |
977 |
+ -ISource/Metadata \ |
978 |
+-- |
979 |
+2.19.1 |
980 |
+ |
981 |
|
982 |
diff --git a/media-libs/freeimage/freeimage-3.18.0.ebuild b/media-libs/freeimage/freeimage-3.18.0.ebuild |
983 |
new file mode 100644 |
984 |
index 00000000000..bde23753bf0 |
985 |
--- /dev/null |
986 |
+++ b/media-libs/freeimage/freeimage-3.18.0.ebuild |
987 |
@@ -0,0 +1,116 @@ |
988 |
+# Copyright 1999-2018 Gentoo Authors |
989 |
+# Distributed under the terms of the GNU General Public License v2 |
990 |
+ |
991 |
+EAPI=6 |
992 |
+ |
993 |
+inherit eutils toolchain-funcs |
994 |
+ |
995 |
+MY_PN=FreeImage |
996 |
+MY_PV=${PV//.} |
997 |
+MY_P=${MY_PN}${MY_PV} |
998 |
+ |
999 |
+DESCRIPTION="Image library supporting many formats" |
1000 |
+HOMEPAGE="http://freeimage.sourceforge.net/" |
1001 |
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}.zip |
1002 |
+ mirror://sourceforge/${PN}/${MY_P}.pdf" |
1003 |
+ |
1004 |
+LICENSE="|| ( GPL-2 FIPL-1.0 )" |
1005 |
+SLOT="0" |
1006 |
+KEYWORDS="~amd64 ~arm ~x86 ~amd64-linux ~x86-linux" |
1007 |
+IUSE="jpeg jpeg2k mng openexr png raw static-libs tiff webp" |
1008 |
+ |
1009 |
+# The tiff/ilmbase isn't a typo. The TIFF plugin cheats and |
1010 |
+# uses code from it to handle 16bit<->float conversions. |
1011 |
+RDEPEND=" |
1012 |
+ sys-libs/zlib |
1013 |
+ jpeg? ( virtual/jpeg:0 ) |
1014 |
+ jpeg2k? ( media-libs/openjpeg:2= ) |
1015 |
+ mng? ( media-libs/libmng:= ) |
1016 |
+ openexr? ( media-libs/openexr:= ) |
1017 |
+ png? ( media-libs/libpng:0= ) |
1018 |
+ raw? ( media-libs/libraw:= ) |
1019 |
+ tiff? ( |
1020 |
+ media-libs/ilmbase:= |
1021 |
+ media-libs/tiff:0 |
1022 |
+ ) |
1023 |
+ webp? ( media-libs/libwebp:= )" |
1024 |
+DEPEND="${RDEPEND} |
1025 |
+ virtual/pkgconfig |
1026 |
+ app-arch/unzip" |
1027 |
+ |
1028 |
+S=${WORKDIR}/${MY_PN} |
1029 |
+ |
1030 |
+DOCS=( "${DISTDIR}"/${MY_P}.pdf README.linux Whatsnew.txt ) |
1031 |
+PATCHES=( |
1032 |
+ "${FILESDIR}"/${PN}-3.18.0-unbundling.patch |
1033 |
+ "${FILESDIR}"/${PN}-3.18.0-remove-jpeg-transform.patch |
1034 |
+ "${FILESDIR}"/${PN}-3.18.0-rename-jpeg_read_icc_profile.patch |
1035 |
+ "${FILESDIR}"/${PN}-3.18.0-disable-plugin-G3.patch |
1036 |
+ "${FILESDIR}"/${PN}-3.18.0-raw.patch |
1037 |
+) |
1038 |
+ |
1039 |
+src_prepare() { |
1040 |
+ pushd Source >/dev/null || die |
1041 |
+ cp LibJPEG/{transupp.c,transupp.h,jinclude.h} . || die |
1042 |
+ cp LibTIFF4/{tiffiop,tif_dir}.h . || die |
1043 |
+ rm -rf LibPNG LibMNG LibOpenJPEG ZLib OpenEXR LibRawLite LibTIFF4 LibJPEG LibWebP LibJXR || die |
1044 |
+ popd >/dev/null || die |
1045 |
+ |
1046 |
+ edos2unix Makefile.{gnu,fip,srcs} fipMakefile.srcs */*.h */*/*.cpp |
1047 |
+ sed -i \ |
1048 |
+ -e "s:/./:/:g" \ |
1049 |
+ -e "s: ./: :g" \ |
1050 |
+ -e 's: Source: \\\n\tSource:g' \ |
1051 |
+ -e 's: Wrapper: \\\n\tWrapper:g' \ |
1052 |
+ -e 's: Examples: \\\n\tExamples:g' \ |
1053 |
+ -e 's: TestAPI: \\\n\tTestAPI:g' \ |
1054 |
+ -e 's: -ISource: \\\n\t-ISource:g' \ |
1055 |
+ -e 's: -IWrapper: \\\n\t-IWrapper:g' \ |
1056 |
+ -e 's:INCLS:\nINCLS:g' \ |
1057 |
+ Makefile.srcs fipMakefile.srcs || die |
1058 |
+ sed -i \ |
1059 |
+ -e "/LibJPEG/d" \ |
1060 |
+ -e "/LibJXR/d" \ |
1061 |
+ -e "/LibPNG/d" \ |
1062 |
+ -e "/LibTIFF/d" \ |
1063 |
+ -e "/Source\/ZLib/d" \ |
1064 |
+ -e "/LibOpenJPEG/d" \ |
1065 |
+ -e "/OpenEXR/d" \ |
1066 |
+ -e "/LibRawLite/d" \ |
1067 |
+ -e "/LibMNG/d" \ |
1068 |
+ -e "/LibWebP/d" \ |
1069 |
+ -e "/LibJXR/d" \ |
1070 |
+ Makefile.srcs fipMakefile.srcs || die |
1071 |
+ |
1072 |
+ default |
1073 |
+} |
1074 |
+ |
1075 |
+foreach_make() { |
1076 |
+ local m |
1077 |
+ for m in Makefile.{gnu,fip} ; do |
1078 |
+ emake -f ${m} \ |
1079 |
+ USE_EXR=$(usex openexr) \ |
1080 |
+ USE_JPEG=$(usex jpeg) \ |
1081 |
+ USE_JPEG2K=$(usex jpeg2k) \ |
1082 |
+ USE_MNG=$(usex mng) \ |
1083 |
+ USE_PNG=$(usex png) \ |
1084 |
+ USE_TIFF=$(usex tiff) \ |
1085 |
+ USE_RAW=$(usex raw) \ |
1086 |
+ USE_WEBP=$(usex webp) \ |
1087 |
+ $(usex static-libs '' STATICLIB=) \ |
1088 |
+ "$@" |
1089 |
+ done |
1090 |
+} |
1091 |
+ |
1092 |
+src_compile() { |
1093 |
+ tc-export AR PKG_CONFIG |
1094 |
+ foreach_make \ |
1095 |
+ CXX="$(tc-getCXX) -fPIC" \ |
1096 |
+ CC="$(tc-getCC) -fPIC" \ |
1097 |
+ ${MY_PN} |
1098 |
+} |
1099 |
+ |
1100 |
+src_install() { |
1101 |
+ foreach_make install DESTDIR="${ED}" INSTALLDIR="${ED%/}"/usr/$(get_libdir) |
1102 |
+ einstalldocs |
1103 |
+} |