commit:     9d9485b2bcb02cfd80680e6949a9f7e303687311
Author:     Jonathan Scruggs <j.scruggs <AT> gmail <DOT> com>
AuthorDate: Sun Oct  9 18:02:45 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Oct 10 22:25:55 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d9485b2

media-libs/openexr: revision bump to fix various build errors

Gentoo-bug: 520648, 585846
* EAPI=6
* Port to 'multilib-minimal'
* Fix build system to not require blocker
* Remove .la files

Signed off by: Jonathan Scruggs (j.scruggs <AT> gmail.com, irc: Dracwyrm)
Closes: https://github.com/gentoo/gentoo/pull/2520

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/openexr-2.2.0-fix-build-system.patch     | 620 +++++++++++++++++++++
 .../openexr-2.2.0-fix-config.h-collision.patch     |  43 ++
 .../openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch    |  63 +++
 ...openexr-2.2.0-use-ull-for-64-bit-literals.patch |  60 ++
 media-libs/openexr/openexr-2.2.0-r1.ebuild         |  61 ++
 5 files changed, 847 insertions(+)

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
new file mode 100644
index 00000000..446e4e5
--- /dev/null
+++ b/media-libs/openexr/files/openexr-2.2.0-fix-build-system.patch
@@ -0,0 +1,620 @@
+* Fix completely broken build system
+* Change pdf+examples installation directory
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,6 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ 
+ AC_INIT(OpenEXR, 2.2.0)
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ AC_SUBST(OPENEXR_VERSION_MAJOR, 2)
+ AC_SUBST(OPENEXR_VERSION_MINOR, 2)
+@@ -11,9 +12,8 @@
+ 
+ AC_CANONICAL_HOST
+ AC_CONFIG_SRCDIR(IlmImfTest/main.cpp)
+-AC_CONFIG_HEADER(config/OpenEXRConfig.h)
+-AM_INIT_AUTOMAKE(1.6.3)  dnl Require automake 1.6.3 or better
+-AM_MAINTAINER_MODE
++AC_CONFIG_HEADERS([config/OpenEXRConfig.h])
++AM_INIT_AUTOMAKE
+ 
+ 
+ LIBTOOL_CURRENT=22
+@@ -27,46 +27,21 @@
+ AC_PROG_INSTALL
+ AC_PROG_CC
+ AC_PROG_LN_S
+-AC_PROG_LIBTOOL
++LT_INIT
+ AC_PROG_MAKE_SET
+ 
+ dnl
+ dnl PKGCONFIG preparations
+ dnl
+-
+-if test -z "${PKG_CONFIG_PATH}"; then
+-      
PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
+-fi
+-
+-LIB64_IF_EXISTS=""
+-if [[ -e /usr/lib64 ]]; then
+-   LIB64_IF_EXISTS="-L/usr/lib64"
+-fi         
+-
+-
+-
+-export PKG_CONFIG_PATH
+-
+-dnl
+-dnl get ccflags and libs from openexr packages, then check 
+-dnl whether test programs compile
+-AM_PATH_PKGCONFIG(
+-   [ILMBASE_CXXFLAGS],
+-   [ILMBASE_LDFLAGS],
+-   [ILMBASE_LIBS],
+-   [IlmBase],
+-   [OpenEXR],
+-   [$LIB64_IF_EXISTS -L/usr/local/lib],
+-   [-lImath -lHalf -lIex -lIlmThread -lpthread],
+-   [ilmbase-prefix])
++PKG_CHECK_MODULES([ILMBASE], [IlmBase])
+ 
+ 
+ dnl Define the version string
+-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_STRING, "${VERSION}")
+-AC_DEFINE_UNQUOTED(OPENEXR_PACKAGE_STRING, "${PACKAGE_STRING}")
+-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MAJOR, ${OPENEXR_VERSION_MAJOR})
+-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_MINOR, ${OPENEXR_VERSION_MINOR})
+-AC_DEFINE_UNQUOTED(OPENEXR_VERSION_PATCH, ${OPENEXR_VERSION_PATCH})
++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_STRING], [${VERSION}], [OpenEXR version 
string])
++AC_DEFINE_UNQUOTED([OPENEXR_PACKAGE_STRING], [${PACKAGE_STRING}], [OpenEXR 
version string])
++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_MAJOR], [${OPENEXR_VERSION_MAJOR}], 
[OpenEXR version string])
++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_MINOR], [${OPENEXR_VERSION_MINOR}], 
[OpenEXR version string])
++AC_DEFINE_UNQUOTED([OPENEXR_VERSION_PATCH], [${OPENEXR_VERSION_PATCH}], 
[OpenEXR version string])
+ 
+ 
+ dnl --enable-threading
+@@ -75,19 +50,16 @@
+                              [enable multi-threading [[default=yes]]]),
+               [multithread="${enableval}"], [multithread=yes])
+ 
+-if test x$PKG_CONFIG == xno && test "x${multithread}" != xno ; then
+-    ACX_PTHREAD(
+-    [
+-      AC_DEFINE(OPENEXR_IMF_HAVE_PTHREAD)
+-      ILMBASE_LIBS="$PTHREAD_LIBS $ILMBASE_LIBS"
+-      ILMBASE_CXXFLAGS="$ILMBASE_CXXFLAGS $PTHREAD_CFLAGS"
+-      CC="$PTHREAD_CC"
+-      
+-      AM_POSIX_SEM()
+-    ],
+-    [AC_MSG_ERROR([POSIX thread support required])])
+-    AC_MSG_NOTICE([multithread true, LIBS = $LIBS, CC = $CC, CXXFLAGS = 
$CXXFLAGS])
+-fi
++AS_IF([test "x${multithread}" != xno], [
++      AX_PTHREAD
++
++      AC_DEFINE([OPENEXR_IMF_HAVE_PTHREAD], [1], [Define if pthreads are 
available])
++
++      CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
++      CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}"
++      LIBS="${LIBS} ${PTHREAD_CFLAGS}"
++])
++
+ 
+ dnl --enable-large-stack
+ case "$host" in
+@@ -110,21 +82,25 @@
+ esac
+ 
+ if test "x${large_stack}" != xno ; then
+-    AC_DEFINE(OPENEXR_IMF_HAVE_LARGE_STACK)
++    AC_DEFINE([OPENEXR_IMF_HAVE_LARGE_STACK], [1], [Define if large stack 
sizes are supported])
+ fi
+ 
+-AM_COMPILELINKRUN(
+-   [IlmBase],
+-   [ilmbasetest],
+-   [$ILMBASE_CXXFLAGS],
+-   [$ILMBASE_LDFLAGS],
+-   [$ILMBASE_LIBS],[[
+-#include <stdlib.h>
+-#include <ImathFun.h>
+-]],
+-   [[double d = IMATH_NAMESPACE::succd(.23); d+= .2;]],
+-   AC_MSG_RESULT([Compiled and ran IlmBase test program.]), 
+-   AC_MSG_ERROR([Could not compile IlmBase test program.]))
++
++
++save_CXXFLAGS="${CXXFLAGS}"
++save_LIBS="${LIBS}"
++CXXFLAGS="${save_CXXFLAGS} ${ILMBASE_CFLAGS}"
++LIBS="${save_LIBS} ${ILMBASE_LIBS}"
++AC_LINK_IFELSE([
++      AC_LANG_PROGRAM([[
++              #include <stdlib.h>
++              #include <ImathFun.h>
++      ]], [[
++              double d = IMATH_NAMESPACE::succd(.23); d+= .2;
++      ]])
++])
++CXXFLAGS="${save_CXXFLAGS}"
++LIBS="${save_LIBS}"
+ 
+ 
+ dnl Checks for header files.
+@@ -137,74 +113,27 @@
+ AC_TYPE_SIZE_T
+ 
+ dnl Checks for zlib
+-AC_CHECK_LIB(z, compress,
+-             [:],
+-             [AC_MSG_ERROR([
+-*** OpenEXR requires a recent version of zlib, which you don't appear to
+-*** have.
+-***
+-*** This could be because the run-time linker is not finding zlib, or it
+-*** is finding the wrong version.  In this case, you'll need to set your
+-*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
+-*** to the proper version.  Also, make sure you have run ldconfig if
+-*** that is required on your system.
+-                         ])]
+-)
++PKG_CHECK_MODULES([ZLIB], [zlib])
++
++
++dnl We use a modern toolchain, don't care
++dnl about ancient broken stuff
++AC_DEFINE([OPENEXR_IMF_HAVE_COMPLETE_IOMANIP], [1], [Define when std::right 
is available])
+ 
+-dnl Checks for std::right etc. in iomanip
+-AC_MSG_CHECKING(for complete iomanip support in C++ standard library)
+-complete_iomanip="no"
+-AC_LANG_SAVE
+-AC_LANG_CPLUSPLUS
+-AC_TRY_COMPILE([#include <iomanip>],[
+-
+-      std::right;
+-],
+-AC_DEFINE(OPENEXR_IMF_HAVE_COMPLETE_IOMANIP) complete_iomanip=yes)
+-AC_MSG_RESULT($complete_iomanip)
+-AC_LANG_RESTORE
+-
+-
+-AC_MSG_CHECKING(for gcc optimization flags)
+-old_cflags=$CFLAGS
+-CFLAGS="$CFLAGS -pipe"
+-AC_TRY_COMPILE([#include <stdio.h>],
+-[ printf ("hello, world"); ],
+-[ EXTRA_OPT_CFLAGS="-pipe"],[ EXTRA_OPT_CFLAGS=""])
+-CFLAGS=$old_cflags
+-AC_MSG_RESULT([$EXTRA_OPT_CFLAGS])
+ 
+ dnl Check to see if the toolset supports AVX instructions in inline asm
+-AC_MSG_CHECKING(for AVX instructions in GCC style inline asm)
+-gcc_inline_asm_avx="no"
+-AC_COMPILE_IFELSE(
+-    [
+-        AC_LANG_PROGRAM([],
+-        [
+-             #if defined(__GNUC__) && defined(__SSE2__) 
+-                 int n   = 0;
+-                 int eax = 0;
+-                 int edx = 0;
+-                 __asm__(
+-                     "xgetbv     \n"
+-                     "vzeroupper  "
+-                     : "=a"(eax), "=d"(edx) : "c"(n) : );
+-             #else
+-                 #error No GCC style inline asm supported for AVX instructions
+-             #endif
+-        ]) 
+-   ],
+-   [
+-      gcc_inline_asm_avx="yes"
+-   ],
+-   [
+-      gcc_inline_asm_avx="no"
+-   ]
+-)
+-AC_MSG_RESULT([$gcc_inline_asm_avx])
+-if test "x${gcc_inline_asm_avx}" == xyes ; then
+-    AC_DEFINE(OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX)
+-fi
++AC_ARG_ENABLE([avx],
++      AS_HELP_STRING([--enable-avx], [Enable avx optimization]))
++
++AS_IF([test "x$enable_avx" = "xyes"], [
++      dnl Enable AVX
++      gcc_inline_asm_avx="yes"
++      AC_DEFINE([OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX], [1], [Define if AVX is 
available])
++], [
++      dnl Disable AVX
++      gcc_inline_asm_avx="no"
++])
++
+ 
+ dnl Check if sysconf(_SC_NPROCESSORS_ONLN) can be used for CPU count
+ AC_MSG_CHECKING([for sysconf(_SC_NPROCESSORS_ONLN)])
+@@ -221,16 +150,16 @@
+ )
+ AC_MSG_RESULT([$sysconf_nproc])
+ if test "x${sysconf_nproc}" == xyes ; then
+-    AC_DEFINE(OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN)
++    AC_DEFINE([OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN], [1], [Define if 
sysconf(_SC_NPROCESSORS_ONLN) can be used for CPU count])
+ fi
+ 
+ dnl Platform-specific stuff
+ case "$host" in
+ *linux*)
+-  AC_DEFINE(OPENEXR_IMF_HAVE_LINUX_PROCFS)
++  AC_DEFINE([OPENEXR_IMF_HAVE_LINUX_PROCFS], [1], [Define if procfs is 
available])
+   ;;
+ *darwin*) 
+-  AC_DEFINE(OPENEXR_IMF_HAVE_DARWIN) 
++  AC_DEFINE([OPENEXR_IMF_HAVE_DARWIN], [1], [Define if on Darwin]) 
+ 
+   dnl OS X universal binary support, requires --disable-dependency-tracking
+   AC_ARG_ENABLE(osx-universal-binaries,
+@@ -245,19 +174,13 @@
+   --disable-dependency-tracking --enable-osx-universal-binary
+                 ])
+     fi
+-    CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc 
-arch i386"
++    dnl CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch 
ppc -arch i386"
+     dnl LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk 
-arch ppc -arch i386"
+   fi
+ 
+   ;;
+ esac
+ 
+-AM_CFLAGS="$EXTRA_OPT_CFLAGS"
+-AM_CXXFLAGS="$EXTRA_OPT_CFLAGS"
+-
+-AC_SUBST(AM_CFLAGS)
+-AC_SUBST(AM_CXXFLAGS)
+-
+ dnl build imfexamples example program?
+ build_imfexamples="no"
+ AC_ARG_ENABLE(imfexamples,
+@@ -286,7 +209,7 @@
+ AM_CONDITIONAL(BUILD_IMFHUGETEST, test "x$build_imfhugetest" = xyes)
+ 
+ if test "x${build_imfhugetest}" != xno ; then
+-    AC_DEFINE(OPENEXR_IMF_HUGETEST)
++    AC_DEFINE([OPENEXR_IMF_HUGETEST], [1], [Define if IlmImf huge input 
resilience])
+ fi
+ 
+ 
+@@ -307,19 +230,19 @@
+ 
+ lib_namespace="Imf"
+ if test "x${library_namespace_versioning}" == xyes ; then
+-    AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, 
Imf_${OPENEXR_VERSION_API})
+-    AC_DEFINE(OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM)
++    AC_DEFINE_UNQUOTED([OPENEXR_IMF_INTERNAL_NAMESPACE], 
[Imf_${OPENEXR_VERSION_API}], [OpenEXR])
++    AC_DEFINE([OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM], [1], [OpenEXR])
+ 
+     lib_namespace="Imf_${OPENEXR_VERSION_API}"
+     LIB_SUFFIX="${OPENEXR_VERSION_API}"
+     lib_suffix_valid="yes"
+ elif test "x${library_namespace_versioning}" == xno ; then
+-    AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, Imf)
++    AC_DEFINE_UNQUOTED([OPENEXR_IMF_INTERNAL_NAMESPACE], [Imf], [OpenEXR])
+ 
+     lib_namespace="Imf"
+ else
+-    AC_DEFINE_UNQUOTED(OPENEXR_IMF_INTERNAL_NAMESPACE, 
${library_namespace_versioning} )
+-    AC_DEFINE(OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM)
++    AC_DEFINE_UNQUOTED([OPENEXR_IMF_INTERNAL_NAMESPACE], 
[${library_namespace_versioning}], [OpenEXR])
++    AC_DEFINE([OPENEXR_IMF_INTERNAL_NAMESPACE_CUSTOM], [1], [OpenEXR])
+ 
+     lib_namespace="${library_namespace_versioning}"
+     LIB_SUFFIX="${library_namespace_versioning}"
+@@ -349,14 +272,14 @@
+ 
+ if test "x${custom_usr_namespace}" == xyes ; then
+     AC_MSG_WARN([Enabling 'custom user namespace' requires an additional 
argument, reverting to 'Imf'])
+-    AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, Imf)
++    AC_DEFINE_UNQUOTED([OPENEXR_IMF_NAMESPACE], [Imf], [OpenEXR])
+     usr_namespace="Imf"
+ elif test "x${custom_usr_namespace}" == xno ; then
+-    AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, Imf)
++    AC_DEFINE_UNQUOTED([OPENEXR_IMF_NAMESPACE], [Imf], [OpenEXR])
+     usr_namespace="Imf"
+ else
+-    AC_DEFINE_UNQUOTED(OPENEXR_IMF_NAMESPACE, ${custom_usr_namespace})
+-    AC_DEFINE(OPENEXR_IMF_NAMESPACE_CUSTOM)
++    AC_DEFINE_UNQUOTED([OPENEXR_IMF_NAMESPACE], [${custom_usr_namespace}], 
[OpenEXR])
++    AC_DEFINE([OPENEXR_IMF_NAMESPACE_CUSTOM], [1], [OpenEXR])
+     
+     usr_namespace=${custom_usr_namespace}
+ fi
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -6,5 +6,4 @@
+       InterpretingDeepPixels.pdf \
+       TheoryDeepPixels.pdf
+ 
+-docdir=$(datadir)/doc/OpenEXR-@OPENEXR_VERSION@
+ doc_DATA = $(EXTRA_DIST)
+--- a/exrenvmap/Makefile.am
++++ b/exrenvmap/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@\
++LDADD = $(ILMBASE_LIBS) \
+       $(top_builddir)/IlmImf/libIlmImf.la \
+-      -lz
++      $(ZLIB_LIBS)
+ 
+ exrenvmap_SOURCES = main.cpp EnvmapImage.cpp EnvmapImage.h \
+                   readInputImage.cpp readInputImage.h \
+--- a/exrheader/Makefile.am
++++ b/exrheader/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
++LDADD = $(ILMBASE_LIBS) \
+       $(top_builddir)/IlmImf/libIlmImf.la \
+-      -lz
++      $(ZLIB_LIBS)
+ 
+ exrheader_SOURCES = main.cpp
+ 
+--- a/exrmakepreview/Makefile.am
++++ b/exrmakepreview/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@\
++LDADD = $(ILMBASE_LIBS) \
+       $(top_builddir)/IlmImf/libIlmImf.la \
+-      -lz
++      $(ZLIB_LIBS)
+ 
+ exrmakepreview_SOURCES = main.cpp makePreview.cpp makePreview.h
+ 
+--- a/exrmaketiled/Makefile.am
++++ b/exrmaketiled/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
++LDADD = $(ILMBASE_LIBS) \
+       $(top_builddir)/IlmImf/libIlmImf.la \
+-      -lz
++      $(ZLIB_LIBS)
+ 
+ exrmaketiled_SOURCES = main.cpp \
+                      Image.h Image.cpp \
+--- a/exrmultipart/Makefile.am
++++ b/exrmultipart/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+ -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-@ILMBASE_CXXFLAGS@
++$(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
+-$(top_builddir)/IlmImf/libIlmImf.la \
+--lz
++LDADD = $(ILMBASE_LIBS) \
++      $(top_builddir)/IlmImf/libIlmImf.la \
++      $(ZLIB_LIBS)
+ 
+ exrmultipart_SOURCES = exrmultipart.cpp
+ 
+--- a/exrmultiview/Makefile.am
++++ b/exrmultiview/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
++LDADD = $(ILMBASE_LIBS) \
+       $(top_builddir)/IlmImf/libIlmImf.la \
+-      -lz
++      $(ZLIB_LIBS)
+ 
+ exrmultiview_SOURCES = main.cpp  \
+                      Image.h Image.cpp \
+--- a/exrstdattr/Makefile.am
++++ b/exrstdattr/Makefile.am
+@@ -4,11 +4,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+-LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
++LDADD = $(ILMBASE_LIBS) \
+       $(top_builddir)/IlmImf/libIlmImf.la \
+-      -lz
++      $(ZLIB_LIBS)
+ 
+ exrstdattr_SOURCES = main.cpp CMakeLists.txt
+ 
+--- a/IlmImf/Makefile.am
++++ b/IlmImf/Makefile.am
+@@ -93,7 +93,7 @@
+                      ImfSystemSpecific.cpp ImfZip.h ImfZip.cpp
+ 
+ 
+-libIlmImf_la_LDFLAGS = @ILMBASE_LDFLAGS@ -version-info @LIBTOOL_VERSION@ \
++libIlmImf_la_LDFLAGS = -version-info @LIBTOOL_VERSION@ \
+                       -no-undefined 
+ 
+ 
+@@ -102,7 +102,7 @@
+ endif
+ 
+ 
+-libIlmImf_la_LIBADD =  -lz @ILMBASE_LIBS@
++libIlmImf_la_LIBADD = $(ZLIB_LIBS) $(ILMBASE_LIBS)
+ 
+ libIlmImfincludedir = $(includedir)/OpenEXR
+ 
+@@ -188,20 +188,21 @@
+ EXTRA_DIST = $(noinst_HEADERS) b44ExpLogTable.cpp b44ExpLogTable.h 
dwaLookups.cpp dwaLookups.h CMakeLists.txt
+ 
+ 
+-INCLUDES = @ILMBASE_CXXFLAGS@ \
+-         -I$(top_builddir)  \
+-         -I$(top_srcdir)/config
++INCLUDES = \
++         -I$(top_builddir) \
++         -I$(top_srcdir)/config \
++         $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+ CLEANFILES = b44ExpLogTable b44ExpLogTable.h dwaLookups dwaLookups.h
+ 
+ b44ExpLogTable_SOURCES = b44ExpLogTable.cpp
+-b44ExpLogTable_LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@
++b44ExpLogTable_LDADD = $(ILMBASE_LIBS)
+ 
+ b44ExpLogTable.h: b44ExpLogTable
+       ./b44ExpLogTable > b44ExpLogTable.h
+ 
+ dwaLookups_SOURCES = dwaLookups.cpp
+-dwaLookups_LDADD = @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@
++dwaLookups_LDADD = $(ILMBASE_LIBS)
+ 
+ dwaLookups.h: dwaLookups
+       ./dwaLookups > dwaLookups.h
+--- a/IlmImfExamples/Makefile.am
++++ b/IlmImfExamples/Makefile.am
+@@ -6,11 +6,11 @@
+ 
+ INCLUDES = -I$(top_builddir) \
+            -I$(top_srcdir)/IlmImf -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++           $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+ LDADD = -L$(top_builddir)/IlmImf \
+-      @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
+-      -lIlmImf -lz
++      $(ILMBASE_LIBS) \
++      -lIlmImf $(ZLIB_CFLAGS)
+ 
+ imfexamples_SOURCES = main.cpp drawImage.cpp rgbaInterfaceExamples.cpp \
+                     rgbaInterfaceTiledExamples.cpp \
+@@ -23,7 +23,7 @@
+                     lowLevelIoExamples.h previewImageExamples.h \
+                     namespaceAlias.h
+ 
+-examplesdir = $(datadir)/doc/OpenEXR-@OPENEXR_VERSION@/examples
++examplesdir = $(docdir)/examples
+ examples_DATA = $(imfexamples_SOURCES)
+ 
+ imfexamplesdir = $(examplesdir)
+--- a/IlmImfFuzzTest/Makefile.am
++++ b/IlmImfFuzzTest/Makefile.am
+@@ -14,11 +14,11 @@
+ INCLUDES = -I$(top_builddir)  \
+          -I$(top_srcdir)/IlmImf \
+          -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++         $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+ LDADD = -L$(top_builddir)/IlmImf \
+-      @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
+-      -lIlmImf -lz
++      $(ILMBASE_LIBS) \
++      -lIlmImf $(ZLIB_LIBS)
+ 
+ if BUILD_IMFFUZZTEST
+ TESTS = IlmImfFuzzTest
+--- a/IlmImfTest/Makefile.am
++++ b/IlmImfTest/Makefile.am
+@@ -62,11 +62,11 @@
+ INCLUDES = -I$(top_builddir)  \
+          -I$(top_srcdir)/IlmImf \
+          -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++         $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+ LDADD = -L$(top_builddir)/IlmImf \
+-      @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
+-      -lIlmImf -lz
++      $(ILMBASE_LIBS) \
++      -lIlmImf $(ZLIB_LIBS)
+ 
+ TESTS = IlmImfTest
+ 
+--- a/IlmImfUtil/Makefile.am
++++ b/IlmImfUtil/Makefile.am
+@@ -20,7 +20,7 @@
+       ImfImageChannelRenaming.h
+       
+ 
+-libIlmImfUtil_la_LDFLAGS = @ILMBASE_LDFLAGS@ -version-info @LIBTOOL_VERSION@ \
++libIlmImfUtil_la_LDFLAGS = -version-info @LIBTOOL_VERSION@ \
+                       -no-undefined 
+ 
+ 
+@@ -29,14 +29,15 @@
+ endif
+ 
+ 
+-libIlmImfUtil_la_LIBADD =  -L$(top_builddir)/IlmImf @ILMBASE_LIBS@ -lIlmImf
++libIlmImfUtil_la_LIBADD =  -L$(top_builddir)/IlmImf $(ILMBASE_LIBS) -lIlmImf
+ 
+ libIlmImfUtilincludedir = $(includedir)/OpenEXR
+ 
+ EXTRA_DIST = CMakeLists.txt
+ 
+-INCLUDES = @ILMBASE_CXXFLAGS@ \
+-         -I$(top_builddir)  \
+-         -I$(top_srcdir)/IlmImf  \
+-         -I$(top_srcdir)/config
++INCLUDES = \
++         -I$(top_builddir) \
++         -I$(top_srcdir)/IlmImf \
++         -I$(top_srcdir)/config \
++         $(ILMBASE_CFLAGS)
+ 
+--- a/IlmImfUtilTest/Makefile.am
++++ b/IlmImfUtilTest/Makefile.am
+@@ -11,12 +11,12 @@
+          -I$(top_srcdir)/IlmImf \
+          -I$(top_srcdir)/IlmImfUtil \
+          -I$(top_srcdir)/config \
+-         @ILMBASE_CXXFLAGS@
++         $(ILMBASE_CFLAGS) $(ZLIB_CFLAGS)
+ 
+ LDADD = -L$(top_builddir)/IlmImf \
+       -L$(top_builddir)/IlmImfUtil \
+-      @ILMBASE_LDFLAGS@ @ILMBASE_LIBS@ \
+-      -lIlmImfUtil -lIlmImf -lz
++      $(ILMBASE_LIBS) \
++      -lIlmImfUtil -lIlmImf $(ZLIB_LIBS)
+ 
+ TESTS = IlmImfUtilTest
+ 

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
new file mode 100644
index 00000000..5342119
--- /dev/null
+++ b/media-libs/openexr/files/openexr-2.2.0-fix-config.h-collision.patch
@@ -0,0 +1,43 @@
+Rename enum from VERSION to MYVERSION due to
+collision with VERSION from autoheader.
+
+--- a/IlmImf/ImfDwaCompressor.cpp
++++ b/IlmImf/ImfDwaCompressor.cpp
+@@ -1944,7 +1944,7 @@
+ 
+     #define OBIDX(x) (Int64 *)&_outBuffer[x * sizeof (Int64)]
+ 
+-    Int64 *version                 = OBIDX (VERSION);
++    Int64 *version                 = OBIDX (MYVERSION);
+     Int64 *unknownUncompressedSize = OBIDX (UNKNOWN_UNCOMPRESSED_SIZE);
+     Int64 *unknownCompressedSize   = OBIDX (UNKNOWN_COMPRESSED_SIZE);
+     Int64 *acCompressedSize        = OBIDX (AC_COMPRESSED_SIZE);
+@@ -2356,7 +2356,7 @@
+ 
+     const Int64 *inPtr64 = (const Int64*) inPtr;
+ 
+-    Int64 version                  = *(inPtr64 + VERSION);
++    Int64 version                  = *(inPtr64 + MYVERSION);
+     Int64 unknownUncompressedSize  = *(inPtr64 + UNKNOWN_UNCOMPRESSED_SIZE);
+     Int64 unknownCompressedSize    = *(inPtr64 + UNKNOWN_COMPRESSED_SIZE);
+     Int64 acCompressedSize         = *(inPtr64 + AC_COMPRESSED_SIZE);
+@@ -3142,7 +3142,7 @@
+ 
+ 
+ //
+-// Setup channel classification rules when reading files with VERSION < 2
++// Setup channel classification rules when reading files with MYVERSION < 2
+ //
+ 
+ void
+--- a/IlmImf/ImfDwaCompressor.h
++++ b/IlmImf/ImfDwaCompressor.h
+@@ -124,7 +124,7 @@
+ 
+     enum DataSizesSingle 
+     {
+-        VERSION = 0,                  // Version number:
++        MYVERSION = 0,                // Version number:
+                                       //   0: classic
+                                       //   1: adds "end of block" to the AC 
RLE
+ 

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
new file mode 100644
index 00000000..4aa7b06
--- /dev/null
+++ b/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch
@@ -0,0 +1,63 @@
+diff -Naur a/IlmImf/ImfSystemSpecific.cpp b/IlmImf/ImfSystemSpecific.cpp
+--- a/IlmImf/ImfSystemSpecific.cpp     2016-06-14 01:19:15.070511555 +0930
++++ b/IlmImf/ImfSystemSpecific.cpp     2016-06-14 01:36:08.776496862 +0930
+@@ -35,6 +35,7 @@
+ #include "ImfSystemSpecific.h"
+ #include "ImfNamespace.h"
+ #include "OpenEXRConfig.h"
++#include <cpuid.h>
+ 
+ OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
+ 
+@@ -42,19 +43,15 @@
+ #if defined(IMF_HAVE_SSE2) &&  defined(__GNUC__)
+ 
+     // Helper functions for gcc + SSE enabled
+-    void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
++    void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, unsigned 
int &ecx, unsigned int &edx)
+     {
+-        __asm__ __volatile__ (
+-            "cpuid"
+-            : /* Output  */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) 
+-            : /* Input   */ "a"(n)
+-            : /* Clobber */);
++      __get_cpuid(n, &eax, &ebx, &ecx, &edx );
+     }
+ 
+ #else // IMF_HAVE_SSE2 && __GNUC__
+ 
+     // Helper functions for generic compiler - all disabled
+-    void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
++    void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, unsigned 
int &ecx, unsigned int &edx)
+     {
+         eax = ebx = ecx = edx = 0;
+     }
+@@ -64,7 +61,7 @@
+ 
+ #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
+ 
+-    void xgetbv(int n, int &eax, int &edx)
++    void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
+     {
+         __asm__ __volatile__ (
+             "xgetbv"
+@@ -75,7 +72,7 @@
+ 
+ #else //  OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
+ 
+-    void xgetbv(int n, int &eax, int &edx)
++    void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx)
+     {
+         eax = edx = 0;
+     }
+@@ -94,8 +91,8 @@
+     f16c(false)
+ {
+     bool osxsave = false;
+-    int  max     = 0;
+-    int  eax, ebx, ecx, edx;
++    unsigned int  max     = 0;
++    unsigned int  eax, ebx, ecx, edx;
+ 
+     cpuid(0, max, ebx, ecx, edx);
+     if (max > 0)

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
new file mode 100644
index 00000000..6b107af
--- /dev/null
+++ b/media-libs/openexr/files/openexr-2.2.0-use-ull-for-64-bit-literals.patch
@@ -0,0 +1,60 @@
+From 57ecf581d053f5cacf2e8fc3c024490e0bbe536f Mon Sep 17 00:00:00 2001
+From: Brendan Bolles <bren...@fnordware.com>
+Date: Wed, 13 Aug 2014 19:54:10 -0700
+Subject: [PATCH] Use ULL for 64-bit literals
+
+On a 32-bit architecture, these literals are too big for just a long,
+they need to be ULL, since Int64 is unsigned.
+---
+ IlmImf/ImfFastHuf.cpp | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/IlmImf/ImfFastHuf.cpp b/IlmImf/ImfFastHuf.cpp
+index 86c84dc..01edad4 100644
+--- a/IlmImf/ImfFastHuf.cpp
++++ b/IlmImf/ImfFastHuf.cpp
+@@ -107,7 +107,7 @@ FastHufDecoder::FastHufDecoder
+     for (int i = 0; i <= MAX_CODE_LEN; ++i)
+     {
+         codeCount[i] = 0;
+-        base[i]      = 0xffffffffffffffffL;
++        base[i]      = 0xffffffffffffffffULL;
+         offset[i]    = 0;
+     }
+ 
+@@ -352,7 +352,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
+ 
+     for (int i = 0; i <= MAX_CODE_LEN; ++i)
+     {
+-        if (base[i] != 0xffffffffffffffffL)
++        if (base[i] != 0xffffffffffffffffULL)
+         {
+             _ljBase[i] = base[i] << (64 - i);
+         }
+@@ -362,7 +362,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
+             // Unused code length - insert dummy values
+             //
+ 
+-            _ljBase[i] = 0xffffffffffffffffL;
++            _ljBase[i] = 0xffffffffffffffffULL;
+         }
+     }
+ 
+@@ -417,7 +417,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
+ 
+     int minIdx = TABLE_LOOKUP_BITS;
+ 
+-    while (minIdx > 0 && _ljBase[minIdx] == 0xffffffffffffffffL)
++    while (minIdx > 0 && _ljBase[minIdx] == 0xffffffffffffffffULL)
+         minIdx--;
+ 
+     if (minIdx < 0)
+@@ -427,7 +427,7 @@ FastHufDecoder::buildTables (Int64 *base, Int64 *offset)
+         // Set the min value such that the table is never tested.
+         //
+ 
+-        _tableMin = 0xffffffffffffffffL;
++        _tableMin = 0xffffffffffffffffULL;
+     }
+     else
+     {

diff --git a/media-libs/openexr/openexr-2.2.0-r1.ebuild 
b/media-libs/openexr/openexr-2.2.0-r1.ebuild
new file mode 100644
index 00000000..8fd2d99
--- /dev/null
+++ b/media-libs/openexr/openexr-2.2.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools multilib-minimal
+
+DESCRIPTION="ILM's OpenEXR high dynamic-range image file format libraries"
+HOMEPAGE="http://openexr.com/";
+SRC_URI="http://download.savannah.gnu.org/releases/openexr/${P}.tar.gz";
+
+LICENSE="BSD"
+SLOT="0/22" # based on SONAME
+KEYWORDS="~amd64 -arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd 
~x86-fbsd ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="cpu_flags_x86_avx examples static-libs"
+
+RDEPEND="
+       sys-libs/zlib[${MULTILIB_USEDEP}]
+       >=media-libs/ilmbase-${PV}:=[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}
+       virtual/pkgconfig
+       >=sys-devel/autoconf-archive-2016.09.16"
+
+PATCHES=(
+       "${FILESDIR}/${P}-fix-cpuid-on-abi_x86_32.patch"
+       "${FILESDIR}/${P}-use-ull-for-64-bit-literals.patch"
+       "${FILESDIR}/${P}-fix-build-system.patch"
+       "${FILESDIR}/${P}-fix-config.h-collision.patch"
+)
+
+src_prepare() {
+       default
+       # Fix path for testsuite
+       sed -i -e "s:/var/tmp/:${T}:" IlmImfTest/tmpDir.h || die
+
+       # delete stray config files causing havoc
+       rm -f config*/OpenEXRConfig.h* || die
+
+       eautoreconf
+}
+
+multilib_src_configure() {
+       ECONF_SOURCE="${S}" econf \
+               --enable-threading \
+               $(use_enable cpu_flags_x86_avx avx) \
+               $(use_enable static-libs static) \
+               $(use_enable examples imfexamples)
+}
+
+multilib_src_install_all() {
+       einstalldocs
+
+       docompress -x /usr/share/doc/${PF}/examples
+       if ! use examples; then
+               rm -rf "${ED%/}"/usr/share/doc/${PF}/examples || die
+       fi
+
+       # package provides .pc files
+       find "${D}" -name '*.la' -delete || die
+}

Reply via email to