Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/openexr/, media-libs/openexr/files/
Date: Mon, 10 Oct 2016 22:26:11
Message-Id: 1476138355.9d9485b2bcb02cfd80680e6949a9f7e303687311.soap@gentoo
1 commit: 9d9485b2bcb02cfd80680e6949a9f7e303687311
2 Author: Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com>
3 AuthorDate: Sun Oct 9 18:02:45 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 10 22:25:55 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d9485b2
7
8 media-libs/openexr: revision bump to fix various build errors
9
10 Gentoo-bug: 520648, 585846
11 * EAPI=6
12 * Port to 'multilib-minimal'
13 * Fix build system to not require blocker
14 * Remove .la files
15
16 Signed off by: Jonathan Scruggs (j.scruggs <AT> gmail.com, irc: Dracwyrm)
17 Closes: https://github.com/gentoo/gentoo/pull/2520
18
19 Signed-off-by: David Seifert <soap <AT> gentoo.org>
20
21 .../files/openexr-2.2.0-fix-build-system.patch | 620 +++++++++++++++++++++
22 .../openexr-2.2.0-fix-config.h-collision.patch | 43 ++
23 .../openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch | 63 +++
24 ...openexr-2.2.0-use-ull-for-64-bit-literals.patch | 60 ++
25 media-libs/openexr/openexr-2.2.0-r1.ebuild | 61 ++
26 5 files changed, 847 insertions(+)
27
28 diff --git a/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch b/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch
29 new file mode 100644
30 index 00000000..446e4e5
31 --- /dev/null
32 +++ b/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch
33 @@ -0,0 +1,620 @@
34 +* Fix completely broken build system
35 +* Change pdf+examples installation directory
36 +
37 +--- a/configure.ac
38 ++++ b/configure.ac
39 +@@ -1,6 +1,7 @@
40 + dnl Process this file with autoconf to produce a configure script.
41 +
42 + AC_INIT(OpenEXR, 2.2.0)
43 ++AC_CONFIG_MACRO_DIR([m4])
44 +
45 + AC_SUBST(OPENEXR_VERSION_MAJOR, 2)
46 + AC_SUBST(OPENEXR_VERSION_MINOR, 2)
47 +@@ -11,9 +12,8 @@
48 +
49 + AC_CANONICAL_HOST
50 + AC_CONFIG_SRCDIR(IlmImfTest/main.cpp)
51 +-AC_CONFIG_HEADER(config/OpenEXRConfig.h)
52 +-AM_INIT_AUTOMAKE(1.6.3) dnl Require automake 1.6.3 or better
53 +-AM_MAINTAINER_MODE
54 ++AC_CONFIG_HEADERS([config/OpenEXRConfig.h])
55 ++AM_INIT_AUTOMAKE
56 +
57 +
58 + LIBTOOL_CURRENT=22
59 +@@ -27,46 +27,21 @@
60 + AC_PROG_INSTALL
61 + AC_PROG_CC
62 + AC_PROG_LN_S
63 +-AC_PROG_LIBTOOL
64 ++LT_INIT
65 + AC_PROG_MAKE_SET
66 +
67 + dnl
68 + dnl PKGCONFIG preparations
69 + dnl
70 +-
71 +-if test -z "${PKG_CONFIG_PATH}"; then
72 +- PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
73 +-fi
74 +-
75 +-LIB64_IF_EXISTS=""
76 +-if [[ -e /usr/lib64 ]]; then
77 +- LIB64_IF_EXISTS="-L/usr/lib64"
78 +-fi
79 +-
80 +-
81 +-
82 +-export PKG_CONFIG_PATH
83 +-
84 +-dnl
85 +-dnl get ccflags and libs from openexr packages, then check
86 +-dnl whether test programs compile
87 +-AM_PATH_PKGCONFIG(
88 +- [ILMBASE_CXXFLAGS],
89 +- [ILMBASE_LDFLAGS],
90 +- [ILMBASE_LIBS],
91 +- [IlmBase],
92 +- [OpenEXR],
93 +- [$LIB64_IF_EXISTS -L/usr/local/lib],
94 +- [-lImath -lHalf -lIex -lIlmThread -lpthread],
95 +- [ilmbase-prefix])
96 ++PKG_CHECK_MODULES([ILMBASE], [IlmBase])
97 +
98 +
99 + dnl Define the version string
100 +-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_STRING, "${VERSION}")
101 +-AC_DEFINE_UNQUOTED(OPENEXR_PACKAGE_STRING, "${PACKAGE_STRING}")
102 +-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MAJOR, ${OPENEXR_VERSION_MAJOR})
103 +-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MINOR, ${OPENEXR_VERSION_MINOR})
104 +-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_PATCH, ${OPENEXR_VERSION_PATCH})
105 ++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_STRING], [${VERSION}], [OpenEXR version string])
106 ++AC_DEFINE_UNQUOTED([OPENEXR_PACKAGE_STRING], [${PACKAGE_STRING}], [OpenEXR version string])
107 ++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_MAJOR], [${OPENEXR_VERSION_MAJOR}], [OpenEXR version string])
108 ++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_MINOR], [${OPENEXR_VERSION_MINOR}], [OpenEXR version string])
109 ++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_PATCH], [${OPENEXR_VERSION_PATCH}], [OpenEXR version string])
110 +
111 +
112 + dnl --enable-threading
113 +@@ -75,19 +50,16 @@
114 + [enable multi-threading [[default=yes]]]),
115 + [multithread="${enableval}"], [multithread=yes])
116 +
117 +-if test x$PKG_CONFIG == xno && test "x${multithread}" != xno ; then
118 +- ACX_PTHREAD(
119 +- [
120 +- AC_DEFINE(OPENEXR_IMF_HAVE_PTHREAD)
121 +- ILMBASE_LIBS="$PTHREAD_LIBS $ILMBASE_LIBS"
122 +- ILMBASE_CXXFLAGS="$ILMBASE_CXXFLAGS $PTHREAD_CFLAGS"
123 +- CC="$PTHREAD_CC"
124 +-
125 +- AM_POSIX_SEM()
126 +- ],
127 +- [AC_MSG_ERROR([POSIX thread support required])])
128 +- AC_MSG_NOTICE([multithread true, LIBS = $LIBS, CC = $CC, CXXFLAGS = $CXXFLAGS])
129 +-fi
130 ++AS_IF([test "x${multithread}" != xno], [
131 ++ AX_PTHREAD
132 ++
133 ++ AC_DEFINE([OPENEXR_IMF_HAVE_PTHREAD], [1], [Define if pthreads are available])
134 ++
135 ++ CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
136 ++ CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}"
137 ++ LIBS="${LIBS} ${PTHREAD_CFLAGS}"
138 ++])
139 ++
140 +
141 + dnl --enable-large-stack
142 + case "$host" in
143 +@@ -110,21 +82,25 @@
144 + esac
145 +
146 + if test "x${large_stack}" != xno ; then
147 +- AC_DEFINE(OPENEXR_IMF_HAVE_LARGE_STACK)
148 ++ AC_DEFINE([OPENEXR_IMF_HAVE_LARGE_STACK], [1], [Define if large stack sizes are supported])
149 + fi
150 +
151 +-AM_COMPILELINKRUN(
152 +- [IlmBase],
153 +- [ilmbasetest],
154 +- [$ILMBASE_CXXFLAGS],
155 +- [$ILMBASE_LDFLAGS],
156 +- [$ILMBASE_LIBS],[[
157 +-#include <stdlib.h>
158 +-#include <ImathFun.h>
159 +-]],
160 +- [[double d = IMATH_NAMESPACE::succd(.23); d+= .2;]],
161 +- AC_MSG_RESULT([Compiled and ran IlmBase test program.]),
162 +- AC_MSG_ERROR([Could not compile IlmBase test program.]))
163 ++
164 ++
165 ++save_CXXFLAGS="${CXXFLAGS}"
166 ++save_LIBS="${LIBS}"
167 ++CXXFLAGS="${save_CXXFLAGS} ${ILMBASE_CFLAGS}"
168 ++LIBS="${save_LIBS} ${ILMBASE_LIBS}"
169 ++AC_LINK_IFELSE([
170 ++ AC_LANG_PROGRAM([[
171 ++ #include <stdlib.h>
172 ++ #include <ImathFun.h>
173 ++ ]], [[
174 ++ double d = IMATH_NAMESPACE::succd(.23); d+= .2;
175 ++ ]])
176 ++])
177 ++CXXFLAGS="${save_CXXFLAGS}"
178 ++LIBS="${save_LIBS}"
179 +
180 +
181 + dnl Checks for header files.
182 +@@ -137,74 +113,27 @@
183 + AC_TYPE_SIZE_T
184 +
185 + dnl Checks for zlib
186 +-AC_CHECK_LIB(z, compress,
187 +- [:],
188 +- [AC_MSG_ERROR([
189 +-*** OpenEXR requires a recent version of zlib, which you don't appear to
190 +-*** have.
191 +-***
192 +-*** This could be because the run-time linker is not finding zlib, or it
193 +-*** is finding the wrong version. In this case, you'll need to set your
194 +-*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
195 +-*** to the proper version. Also, make sure you have run ldconfig if
196 +-*** that is required on your system.
197 +- ])]
198 +-)
199 ++PKG_CHECK_MODULES([ZLIB], [zlib])
200 ++
201 ++
202 ++dnl We use a modern toolchain, don't care
203 ++dnl about ancient broken stuff
204 ++AC_DEFINE([OPENEXR_IMF_HAVE_COMPLETE_IOMANIP], [1], [Define when std::right is available])
205 +
206 +-dnl Checks for std::right etc. in iomanip
207 +-AC_MSG_CHECKING(for complete iomanip support in C++ standard library)
208 +-complete_iomanip="no"
209 +-AC_LANG_SAVE
210 +-AC_LANG_CPLUSPLUS
211 +-AC_TRY_COMPILE([#include <iomanip>],[
212 +-
213 +- std::right;
214 +-],
215 +-AC_DEFINE(OPENEXR_IMF_HAVE_COMPLETE_IOMANIP) complete_iomanip=yes)
216 +-AC_MSG_RESULT($complete_iomanip)
217 +-AC_LANG_RESTORE
218 +-
219 +-
220 +-AC_MSG_CHECKING(for gcc optimization flags)
221 +-old_cflags=$CFLAGS
222 +-CFLAGS="$CFLAGS -pipe"
223 +-AC_TRY_COMPILE([#include <stdio.h>],
224 +-[ printf ("hello, world"); ],
225 +-[ EXTRA_OPT_CFLAGS="-pipe"],[ EXTRA_OPT_CFLAGS=""])
226 +-CFLAGS=$old_cflags
227 +-AC_MSG_RESULT([$EXTRA_OPT_CFLAGS])
228 +
229 + dnl Check to see if the toolset supports AVX instructions in inline asm
230 +-AC_MSG_CHECKING(for AVX instructions in GCC style inline asm)
231 +-gcc_inline_asm_avx="no"
232 +-AC_COMPILE_IFELSE(
233 +- [
234 +- AC_LANG_PROGRAM([],
235 +- [
236 +- #if defined(__GNUC__) && defined(__SSE2__)
237 +- int n = 0;
238 +- int eax = 0;
239 +- int edx = 0;
240 +- __asm__(
241 +- "xgetbv \n"
242 +- "vzeroupper "
243 +- : "=a"(eax), "=d"(edx) : "c"(n) : );
244 +- #else
245 +- #error No GCC style inline asm supported for AVX instructions
246 +- #endif
247 +- ])
248 +- ],
249 +- [
250 +- gcc_inline_asm_avx="yes"
251 +- ],
252 +- [
253 +- gcc_inline_asm_avx="no"
254 +- ]
255 +-)
256 +-AC_MSG_RESULT([$gcc_inline_asm_avx])
257 +-if test "x${gcc_inline_asm_avx}" == xyes ; then
258 +- AC_DEFINE(OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX)
259 +-fi
260 ++AC_ARG_ENABLE([avx],
261 ++ AS_HELP_STRING([--enable-avx], [Enable avx optimization]))
262 ++
263 ++AS_IF([test "x$enable_avx" = "xyes"], [
264 ++ dnl Enable AVX
265 ++ gcc_inline_asm_avx="yes"
266 ++ AC_DEFINE([OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX], [1], [Define if AVX is available])
267 ++], [
268 ++ dnl Disable AVX
269 ++ gcc_inline_asm_avx="no"
270 ++])
271 ++
272 +
273 + dnl Check if sysconf(_SC_NPROCESSORS_ONLN) can be used for CPU count
274 + AC_MSG_CHECKING([for sysconf(_SC_NPROCESSORS_ONLN)])
275 +@@ -221,16 +150,16 @@
276 + )
277 + AC_MSG_RESULT([$sysconf_nproc])
278 + if test "x${sysconf_nproc}" == xyes ; then
279 +- AC_DEFINE(OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN)
280 ++ AC_DEFINE([OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN], [1], [Define if sysconf(_SC_NPROCESSORS_ONLN) can be used for CPU count])
281 + fi
282 +
283 + dnl Platform-specific stuff
284 + case "$host" in
285 + *linux*)
286 +- AC_DEFINE(OPENEXR_IMF_HAVE_LINUX_PROCFS)
287 ++ AC_DEFINE([OPENEXR_IMF_HAVE_LINUX_PROCFS], [1], [Define if procfs is available])
288 + ;;
289 + *darwin*)
290 +- AC_DEFINE(OPENEXR_IMF_HAVE_DARWIN)
291 ++ AC_DEFINE([OPENEXR_IMF_HAVE_DARWIN], [1], [Define if on Darwin])
292 +
293 + dnl OS X universal binary support, requires --disable-dependency-tracking
294 + AC_ARG_ENABLE(osx-universal-binaries,
295 +@@ -245,19 +174,13 @@
296 + --disable-dependency-tracking --enable-osx-universal-binary
297 + ])
298 + fi
299 +- CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
300 ++ dnl CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
301 + dnl LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386"
302 + fi
303 +
304 + ;;
305 + esac
306 +
307 +-AM_CFLAGS="$EXTRA_OPT_CFLAGS"
308 +-AM_CXXFLAGS="$EXTRA_OPT_CFLAGS"
309 +-
310 +-AC_SUBST(AM_CFLAGS)
311 +-AC_SUBST(AM_CXXFLAGS)
312 +-
313 + dnl build imfexamples example program?
314 + build_imfexamples="no"
315 + AC_ARG_ENABLE(imfexamples,
316 +@@ -286,7 +209,7 @@
317 + AM_CONDITIONAL(BUILD_IMFHUGETEST, test "x$build_imfhugetest" = xyes)
318 +
319 + if test "x${build_imfhugetest}" != xno ; then
320 +- AC_DEFINE(OPENEXR_IMF_HUGETEST)
321 ++ AC_DEFINE([OPENEXR_IMF_HUGETEST], [1], [Define if IlmImf huge input resilience])
322 + fi
323 +
324 +
325 +@@ -307,19 +230,19 @@
326 +
327 + lib_namespace="Imf"
328 + if test "x${library_namespace_versioning}" == xyes ; then
329 +- AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, Imf_${OPENEXR_VERSION_API})
330 +- AC_DEFINE(OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM)
331 ++ AC_DEFINE_UNQUOTED([OPENEXR_IMF_INTERNAL_NAMESPACE], [Imf_${OPENEXR_VERSION_API}], [OpenEXR])
332 ++ AC_DEFINE([OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM], [1], [OpenEXR])
333 +
334 + lib_namespace="Imf_${OPENEXR_VERSION_API}"
335 + LIB_SUFFIX="${OPENEXR_VERSION_API}"
336 + lib_suffix_valid="yes"
337 + elif test "x${library_namespace_versioning}" == xno ; then
338 +- AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, Imf)
339 ++ AC_DEFINE_UNQUOTED([OPENEXR_IMF_INTERNAL_NAMESPACE], [Imf], [OpenEXR])
340 +
341 + lib_namespace="Imf"
342 + else
343 +- AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, ${library_namespace_versioning} )
344 +- AC_DEFINE(OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM)
345 ++ AC_DEFINE_UNQUOTED([OPENEXR_IMF_INTERNAL_NAMESPACE], [${library_namespace_versioning}], [OpenEXR])
346 ++ AC_DEFINE([OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM], [1], [OpenEXR])
347 +
348 + lib_namespace="${library_namespace_versioning}"
349 + LIB_SUFFIX="${library_namespace_versioning}"
350 +@@ -349,14 +272,14 @@
351 +
352 + if test "x${custom_usr_namespace}" == xyes ; then
353 + AC_MSG_WARN([Enabling 'custom user namespace' requires an additional argument, reverting to 'Imf'])
354 +- AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, Imf)
355 ++ AC_DEFINE_UNQUOTED([OPENEXR_IMF_NAMESPACE], [Imf], [OpenEXR])
356 + usr_namespace="Imf"
357 + elif test "x${custom_usr_namespace}" == xno ; then
358 +- AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, Imf)
359 ++ AC_DEFINE_UNQUOTED([OPENEXR_IMF_NAMESPACE], [Imf], [OpenEXR])
360 + usr_namespace="Imf"
361 + else
362 +- AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, ${custom_usr_namespace})
363 +- AC_DEFINE(OPENEXR_IMF_NAMESPACE_CUSTOM)
364 ++ AC_DEFINE_UNQUOTED([OPENEXR_IMF_NAMESPACE], [${custom_usr_namespace}], [OpenEXR])
365 ++ AC_DEFINE([OPENEXR_IMF_NAMESPACE_CUSTOM], [1], [OpenEXR])
366 +
367 + usr_namespace=${custom_usr_namespace}
368 + fi
369 +--- a/doc/Makefile.am
370 ++++ b/doc/Makefile.am
371 +@@ -6,5 +6,4 @@
372 + InterpretingDeepPixels.pdf \
373 + TheoryDeepPixels.pdf
374 +
375 +-docdir=$(datadir)/doc/OpenEXR-@OPENEXR_VERSION@
376 + doc_DATA = $(EXTRA_DIST)
377 +--- a/exrenvmap/Makefile.am
378 ++++ b/exrenvmap/Makefile.am
379 +@@ -4,11 +4,11 @@
380 +
381 + INCLUDES = -I$(top_builddir) \
382 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
383 +- @ILMBASE_CXXFLAGS@
384 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
385 +
386 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@\
387 ++LDADD = $(ILMBASE_LIBS) \
388 + $(top_builddir)/IlmImf/libIlmImf.la \
389 +- -lz
390 ++ $(ZLIB_LIBS)
391 +
392 + exrenvmap_SOURCES = main.cpp EnvmapImage.cpp EnvmapImage.h \
393 + readInputImage.cpp readInputImage.h \
394 +--- a/exrheader/Makefile.am
395 ++++ b/exrheader/Makefile.am
396 +@@ -4,11 +4,11 @@
397 +
398 + INCLUDES = -I$(top_builddir) \
399 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
400 +- @ILMBASE_CXXFLAGS@
401 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
402 +
403 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
404 ++LDADD = $(ILMBASE_LIBS) \
405 + $(top_builddir)/IlmImf/libIlmImf.la \
406 +- -lz
407 ++ $(ZLIB_LIBS)
408 +
409 + exrheader_SOURCES = main.cpp
410 +
411 +--- a/exrmakepreview/Makefile.am
412 ++++ b/exrmakepreview/Makefile.am
413 +@@ -4,11 +4,11 @@
414 +
415 + INCLUDES = -I$(top_builddir) \
416 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
417 +- @ILMBASE_CXXFLAGS@
418 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
419 +
420 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@\
421 ++LDADD = $(ILMBASE_LIBS) \
422 + $(top_builddir)/IlmImf/libIlmImf.la \
423 +- -lz
424 ++ $(ZLIB_LIBS)
425 +
426 + exrmakepreview_SOURCES = main.cpp makePreview.cpp makePreview.h
427 +
428 +--- a/exrmaketiled/Makefile.am
429 ++++ b/exrmaketiled/Makefile.am
430 +@@ -4,11 +4,11 @@
431 +
432 + INCLUDES = -I$(top_builddir) \
433 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
434 +- @ILMBASE_CXXFLAGS@
435 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
436 +
437 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
438 ++LDADD = $(ILMBASE_LIBS) \
439 + $(top_builddir)/IlmImf/libIlmImf.la \
440 +- -lz
441 ++ $(ZLIB_LIBS)
442 +
443 + exrmaketiled_SOURCES = main.cpp \
444 + Image.h Image.cpp \
445 +--- a/exrmultipart/Makefile.am
446 ++++ b/exrmultipart/Makefile.am
447 +@@ -4,11 +4,11 @@
448 +
449 + INCLUDES = -I$(top_builddir) \
450 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
451 +-@ILMBASE_CXXFLAGS@
452 ++$(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
453 +
454 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
455 +-$(top_builddir)/IlmImf/libIlmImf.la \
456 +--lz
457 ++LDADD = $(ILMBASE_LIBS) \
458 ++ $(top_builddir)/IlmImf/libIlmImf.la \
459 ++ $(ZLIB_LIBS)
460 +
461 + exrmultipart_SOURCES = exrmultipart.cpp
462 +
463 +--- a/exrmultiview/Makefile.am
464 ++++ b/exrmultiview/Makefile.am
465 +@@ -4,11 +4,11 @@
466 +
467 + INCLUDES = -I$(top_builddir) \
468 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
469 +- @ILMBASE_CXXFLAGS@
470 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
471 +
472 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
473 ++LDADD = $(ILMBASE_LIBS) \
474 + $(top_builddir)/IlmImf/libIlmImf.la \
475 +- -lz
476 ++ $(ZLIB_LIBS)
477 +
478 + exrmultiview_SOURCES = main.cpp \
479 + Image.h Image.cpp \
480 +--- a/exrstdattr/Makefile.am
481 ++++ b/exrstdattr/Makefile.am
482 +@@ -4,11 +4,11 @@
483 +
484 + INCLUDES = -I$(top_builddir) \
485 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
486 +- @ILMBASE_CXXFLAGS@
487 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
488 +
489 +-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
490 ++LDADD = $(ILMBASE_LIBS) \
491 + $(top_builddir)/IlmImf/libIlmImf.la \
492 +- -lz
493 ++ $(ZLIB_LIBS)
494 +
495 + exrstdattr_SOURCES = main.cpp CMakeLists.txt
496 +
497 +--- a/IlmImf/Makefile.am
498 ++++ b/IlmImf/Makefile.am
499 +@@ -93,7 +93,7 @@
500 + ImfSystemSpecific.cpp ImfZip.h ImfZip.cpp
501 +
502 +
503 +-libIlmImf_la_LDFLAGS = @ILMBASE_LDFLAGS@ -version-info @LIBTOOL_VERSION@ \
504 ++libIlmImf_la_LDFLAGS = -version-info @LIBTOOL_VERSION@ \
505 + -no-undefined
506 +
507 +
508 +@@ -102,7 +102,7 @@
509 + endif
510 +
511 +
512 +-libIlmImf_la_LIBADD = -lz @ILMBASE_LIBS@
513 ++libIlmImf_la_LIBADD = $(ZLIB_LIBS) $(ILMBASE_LIBS)
514 +
515 + libIlmImfincludedir = $(includedir)/OpenEXR
516 +
517 +@@ -188,20 +188,21 @@
518 + EXTRA_DIST = $(noinst_HEADERS) b44ExpLogTable.cpp b44ExpLogTable.h dwaLookups.cpp dwaLookups.h CMakeLists.txt
519 +
520 +
521 +-INCLUDES = @ILMBASE_CXXFLAGS@ \
522 +- -I$(top_builddir) \
523 +- -I$(top_srcdir)/config
524 ++INCLUDES = \
525 ++ -I$(top_builddir) \
526 ++ -I$(top_srcdir)/config \
527 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
528 +
529 + CLEANFILES = b44ExpLogTable b44ExpLogTable.h dwaLookups dwaLookups.h
530 +
531 + b44ExpLogTable_SOURCES = b44ExpLogTable.cpp
532 +-b44ExpLogTable_LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@
533 ++b44ExpLogTable_LDADD = $(ILMBASE_LIBS)
534 +
535 + b44ExpLogTable.h: b44ExpLogTable
536 + ./b44ExpLogTable > b44ExpLogTable.h
537 +
538 + dwaLookups_SOURCES = dwaLookups.cpp
539 +-dwaLookups_LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@
540 ++dwaLookups_LDADD = $(ILMBASE_LIBS)
541 +
542 + dwaLookups.h: dwaLookups
543 + ./dwaLookups > dwaLookups.h
544 +--- a/IlmImfExamples/Makefile.am
545 ++++ b/IlmImfExamples/Makefile.am
546 +@@ -6,11 +6,11 @@
547 +
548 + INCLUDES = -I$(top_builddir) \
549 + -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
550 +- @ILMBASE_CXXFLAGS@
551 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
552 +
553 + LDADD = -L$(top_builddir)/IlmImf \
554 +- @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
555 +- -lIlmImf -lz
556 ++ $(ILMBASE_LIBS) \
557 ++ -lIlmImf $(ZLIB_CFLAGS)
558 +
559 + imfexamples_SOURCES = main.cpp drawImage.cpp rgbaInterfaceExamples.cpp \
560 + rgbaInterfaceTiledExamples.cpp \
561 +@@ -23,7 +23,7 @@
562 + lowLevelIoExamples.h previewImageExamples.h \
563 + namespaceAlias.h
564 +
565 +-examplesdir = $(datadir)/doc/OpenEXR-@OPENEXR_VERSION@/examples
566 ++examplesdir = $(docdir)/examples
567 + examples_DATA = $(imfexamples_SOURCES)
568 +
569 + imfexamplesdir = $(examplesdir)
570 +--- a/IlmImfFuzzTest/Makefile.am
571 ++++ b/IlmImfFuzzTest/Makefile.am
572 +@@ -14,11 +14,11 @@
573 + INCLUDES = -I$(top_builddir) \
574 + -I$(top_srcdir)/IlmImf \
575 + -I$(top_srcdir)/config \
576 +- @ILMBASE_CXXFLAGS@
577 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
578 +
579 + LDADD = -L$(top_builddir)/IlmImf \
580 +- @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
581 +- -lIlmImf -lz
582 ++ $(ILMBASE_LIBS) \
583 ++ -lIlmImf $(ZLIB_LIBS)
584 +
585 + if BUILD_IMFFUZZTEST
586 + TESTS = IlmImfFuzzTest
587 +--- a/IlmImfTest/Makefile.am
588 ++++ b/IlmImfTest/Makefile.am
589 +@@ -62,11 +62,11 @@
590 + INCLUDES = -I$(top_builddir) \
591 + -I$(top_srcdir)/IlmImf \
592 + -I$(top_srcdir)/config \
593 +- @ILMBASE_CXXFLAGS@
594 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
595 +
596 + LDADD = -L$(top_builddir)/IlmImf \
597 +- @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
598 +- -lIlmImf -lz
599 ++ $(ILMBASE_LIBS) \
600 ++ -lIlmImf $(ZLIB_LIBS)
601 +
602 + TESTS = IlmImfTest
603 +
604 +--- a/IlmImfUtil/Makefile.am
605 ++++ b/IlmImfUtil/Makefile.am
606 +@@ -20,7 +20,7 @@
607 + ImfImageChannelRenaming.h
608 +
609 +
610 +-libIlmImfUtil_la_LDFLAGS = @ILMBASE_LDFLAGS@ -version-info @LIBTOOL_VERSION@ \
611 ++libIlmImfUtil_la_LDFLAGS = -version-info @LIBTOOL_VERSION@ \
612 + -no-undefined
613 +
614 +
615 +@@ -29,14 +29,15 @@
616 + endif
617 +
618 +
619 +-libIlmImfUtil_la_LIBADD = -L$(top_builddir)/IlmImf @ILMBASE_LIBS@ -lIlmImf
620 ++libIlmImfUtil_la_LIBADD = -L$(top_builddir)/IlmImf $(ILMBASE_LIBS) -lIlmImf
621 +
622 + libIlmImfUtilincludedir = $(includedir)/OpenEXR
623 +
624 + EXTRA_DIST = CMakeLists.txt
625 +
626 +-INCLUDES = @ILMBASE_CXXFLAGS@ \
627 +- -I$(top_builddir) \
628 +- -I$(top_srcdir)/IlmImf \
629 +- -I$(top_srcdir)/config
630 ++INCLUDES = \
631 ++ -I$(top_builddir) \
632 ++ -I$(top_srcdir)/IlmImf \
633 ++ -I$(top_srcdir)/config \
634 ++ $(ILMBASE_CFLAGS)
635 +
636 +--- a/IlmImfUtilTest/Makefile.am
637 ++++ b/IlmImfUtilTest/Makefile.am
638 +@@ -11,12 +11,12 @@
639 + -I$(top_srcdir)/IlmImf \
640 + -I$(top_srcdir)/IlmImfUtil \
641 + -I$(top_srcdir)/config \
642 +- @ILMBASE_CXXFLAGS@
643 ++ $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
644 +
645 + LDADD = -L$(top_builddir)/IlmImf \
646 + -L$(top_builddir)/IlmImfUtil \
647 +- @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
648 +- -lIlmImfUtil -lIlmImf -lz
649 ++ $(ILMBASE_LIBS) \
650 ++ -lIlmImfUtil -lIlmImf $(ZLIB_LIBS)
651 +
652 + TESTS = IlmImfUtilTest
653 +
654
655 diff --git a/media-libs/openexr/files/openexr-2.2.0-fix-config.h-collision.patch b/media-libs/openexr/files/openexr-2.2.0-fix-config.h-collision.patch
656 new file mode 100644
657 index 00000000..5342119
658 --- /dev/null
659 +++ b/media-libs/openexr/files/openexr-2.2.0-fix-config.h-collision.patch
660 @@ -0,0 +1,43 @@
661 +Rename enum from VERSION to MYVERSION due to
662 +collision with VERSION from autoheader.
663 +
664 +--- a/IlmImf/ImfDwaCompressor.cpp
665 ++++ b/IlmImf/ImfDwaCompressor.cpp
666 +@@ -1944,7 +1944,7 @@
667 +
668 + #define OBIDX(x) (Int64 *)&_outBuffer[x * sizeof (Int64)]
669 +
670 +- Int64 *version = OBIDX (VERSION);
671 ++ Int64 *version = OBIDX (MYVERSION);
672 + Int64 *unknownUncompressedSize = OBIDX (UNKNOWN_UNCOMPRESSED_SIZE);
673 + Int64 *unknownCompressedSize = OBIDX (UNKNOWN_COMPRESSED_SIZE);
674 + Int64 *acCompressedSize = OBIDX (AC_COMPRESSED_SIZE);
675 +@@ -2356,7 +2356,7 @@
676 +
677 + const Int64 *inPtr64 = (const Int64*) inPtr;
678 +
679 +- Int64 version = *(inPtr64 + VERSION);
680 ++ Int64 version = *(inPtr64 + MYVERSION);
681 + Int64 unknownUncompressedSize = *(inPtr64 + UNKNOWN_UNCOMPRESSED_SIZE);
682 + Int64 unknownCompressedSize = *(inPtr64 + UNKNOWN_COMPRESSED_SIZE);
683 + Int64 acCompressedSize = *(inPtr64 + AC_COMPRESSED_SIZE);
684 +@@ -3142,7 +3142,7 @@
685 +
686 +
687 + //
688 +-// Setup channel classification rules when reading files with VERSION < 2
689 ++// Setup channel classification rules when reading files with MYVERSION < 2
690 + //
691 +
692 + void
693 +--- a/IlmImf/ImfDwaCompressor.h
694 ++++ b/IlmImf/ImfDwaCompressor.h
695 +@@ -124,7 +124,7 @@
696 +
697 + enum DataSizesSingle
698 + {
699 +- VERSION = 0, // Version number:
700 ++ MYVERSION = 0, // Version number:
701 + // 0: classic
702 + // 1: adds "end of block" to the AC RLE
703 +
704
705 diff --git a/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch b/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch
706 new file mode 100644
707 index 00000000..4aa7b06
708 --- /dev/null
709 +++ b/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch
710 @@ -0,0 +1,63 @@
711 +diff -Naur a/IlmImf/ImfSystemSpecific.cpp b/IlmImf/ImfSystemSpecific.cpp
712 +--- a/IlmImf/ImfSystemSpecific.cpp 2016-06-14 01:19:15.070511555 +0930
713 ++++ b/IlmImf/ImfSystemSpecific.cpp 2016-06-14 01:36:08.776496862 +0930
714 +@@ -35,6 +35,7 @@
715 + #include "ImfSystemSpecific.h"
716 + #include "ImfNamespace.h"
717 + #include "OpenEXRConfig.h"
718 ++#include <cpuid.h>
719 +
720 + OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
721 +
722 +@@ -42,19 +43,15 @@
723 + #if defined(IMF_HAVE_SSE2) && defined(__GNUC__)
724 +
725 + // Helper functions for gcc + SSE enabled
726 +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
727 ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, unsigned int &ecx, unsigned int &edx)
728 + {
729 +- __asm__ __volatile__ (
730 +- "cpuid"
731 +- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
732 +- : /* Input */ "a"(n)
733 +- : /* Clobber */);
734 ++ __get_cpuid(n, &eax, &ebx, &ecx, &edx );
735 + }
736 +
737 + #else // IMF_HAVE_SSE2 && __GNUC__
738 +
739 + // Helper functions for generic compiler - all disabled
740 +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
741 ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, unsigned int &ecx, unsigned int &edx)
742 + {
743 + eax = ebx = ecx = edx = 0;
744 + }
745 +@@ -64,7 +61,7 @@
746 +
747 + #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
748 +
749 +- void xgetbv(int n, int &eax, int &edx)
750 ++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
751 + {
752 + __asm__ __volatile__ (
753 + "xgetbv"
754 +@@ -75,7 +72,7 @@
755 +
756 + #else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
757 +
758 +- void xgetbv(int n, int &eax, int &edx)
759 ++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
760 + {
761 + eax = edx = 0;
762 + }
763 +@@ -94,8 +91,8 @@
764 + f16c(false)
765 + {
766 + bool osxsave = false;
767 +- int max = 0;
768 +- int eax, ebx, ecx, edx;
769 ++ unsigned int max = 0;
770 ++ unsigned int eax, ebx, ecx, edx;
771 +
772 + cpuid(0, max, ebx, ecx, edx);
773 + if (max > 0)
774
775 diff --git a/media-libs/openexr/files/openexr-2.2.0-use-ull-for-64-bit-literals.patch b/media-libs/openexr/files/openexr-2.2.0-use-ull-for-64-bit-literals.patch
776 new file mode 100644
777 index 00000000..6b107af
778 --- /dev/null
779 +++ b/media-libs/openexr/files/openexr-2.2.0-use-ull-for-64-bit-literals.patch
780 @@ -0,0 +1,60 @@
781 +From 57ecf581d053f5cacf2e8fc3c024490e0bbe536f Mon Sep 17 00:00:00 2001
782 +From: Brendan Bolles <brendan@×××××××××.com>
783 +Date: Wed, 13 Aug 2014 19:54:10 -0700
784 +Subject: [PATCH] Use ULL for 64-bit literals
785 +
786 +On a 32-bit architecture, these literals are too big for just a long,
787 +they need to be ULL, since Int64 is unsigned.
788 +---
789 + IlmImf/ImfFastHuf.cpp | 10 +++++-----
790 + 1 file changed, 5 insertions(+), 5 deletions(-)
791 +
792 +diff --git a/IlmImf/ImfFastHuf.cpp b/IlmImf/ImfFastHuf.cpp
793 +index 86c84dc..01edad4 100644
794 +--- a/IlmImf/ImfFastHuf.cpp
795 ++++ b/IlmImf/ImfFastHuf.cpp
796 +@@ -107,7 +107,7 @@ FastHufDecoder::FastHufDecoder
797 + for (int i = 0; i <= MAX_CODE_LEN; ++i)
798 + {
799 + codeCount[i] = 0;
800 +- base[i] = 0xffffffffffffffffL;
801 ++ base[i] = 0xffffffffffffffffULL;
802 + offset[i] = 0;
803 + }
804 +
805 +@@ -352,7 +352,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
806 +
807 + for (int i = 0; i <= MAX_CODE_LEN; ++i)
808 + {
809 +- if (base[i] != 0xffffffffffffffffL)
810 ++ if (base[i] != 0xffffffffffffffffULL)
811 + {
812 + _ljBase[i] = base[i] << (64 - i);
813 + }
814 +@@ -362,7 +362,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
815 + // Unused code length - insert dummy values
816 + //
817 +
818 +- _ljBase[i] = 0xffffffffffffffffL;
819 ++ _ljBase[i] = 0xffffffffffffffffULL;
820 + }
821 + }
822 +
823 +@@ -417,7 +417,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
824 +
825 + int minIdx = TABLE_LOOKUP_BITS;
826 +
827 +- while (minIdx > 0 && _ljBase[minIdx] == 0xffffffffffffffffL)
828 ++ while (minIdx > 0 && _ljBase[minIdx] == 0xffffffffffffffffULL)
829 + minIdx--;
830 +
831 + if (minIdx < 0)
832 +@@ -427,7 +427,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
833 + // Set the min value such that the table is never tested.
834 + //
835 +
836 +- _tableMin = 0xffffffffffffffffL;
837 ++ _tableMin = 0xffffffffffffffffULL;
838 + }
839 + else
840 + {
841
842 diff --git a/media-libs/openexr/openexr-2.2.0-r1.ebuild b/media-libs/openexr/openexr-2.2.0-r1.ebuild
843 new file mode 100644
844 index 00000000..8fd2d99
845 --- /dev/null
846 +++ b/media-libs/openexr/openexr-2.2.0-r1.ebuild
847 @@ -0,0 +1,61 @@
848 +# Copyright 1999-2016 Gentoo Foundation
849 +# Distributed under the terms of the GNU General Public License v2
850 +# $Id$
851 +
852 +EAPI=6
853 +
854 +inherit autotools multilib-minimal
855 +
856 +DESCRIPTION="ILM's OpenEXR high dynamic-range image file format libraries"
857 +HOMEPAGE="http://openexr.com/"
858 +SRC_URI="http://download.savannah.gnu.org/releases/openexr/${P}.tar.gz"
859 +
860 +LICENSE="BSD"
861 +SLOT="0/22" # based on SONAME
862 +KEYWORDS="~amd64 -arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
863 +IUSE="cpu_flags_x86_avx examples static-libs"
864 +
865 +RDEPEND="
866 + sys-libs/zlib[${MULTILIB_USEDEP}]
867 + >=media-libs/ilmbase-${PV}:=[${MULTILIB_USEDEP}]"
868 +DEPEND="${RDEPEND}
869 + virtual/pkgconfig
870 + >=sys-devel/autoconf-archive-2016.09.16"
871 +
872 +PATCHES=(
873 + "${FILESDIR}/${P}-fix-cpuid-on-abi_x86_32.patch"
874 + "${FILESDIR}/${P}-use-ull-for-64-bit-literals.patch"
875 + "${FILESDIR}/${P}-fix-build-system.patch"
876 + "${FILESDIR}/${P}-fix-config.h-collision.patch"
877 +)
878 +
879 +src_prepare() {
880 + default
881 + # Fix path for testsuite
882 + sed -i -e "s:/var/tmp/:${T}:" IlmImfTest/tmpDir.h || die
883 +
884 + # delete stray config files causing havoc
885 + rm -f config*/OpenEXRConfig.h* || die
886 +
887 + eautoreconf
888 +}
889 +
890 +multilib_src_configure() {
891 + ECONF_SOURCE="${S}" econf \
892 + --enable-threading \
893 + $(use_enable cpu_flags_x86_avx avx) \
894 + $(use_enable static-libs static) \
895 + $(use_enable examples imfexamples)
896 +}
897 +
898 +multilib_src_install_all() {
899 + einstalldocs
900 +
901 + docompress -x /usr/share/doc/${PF}/examples
902 + if ! use examples; then
903 + rm -rf "${ED%/}"/usr/share/doc/${PF}/examples || die
904 + fi
905 +
906 + # package provides .pc files
907 + find "${D}" -name '*.la' -delete || die
908 +}