Fix build with GCC 8 and yaml-cpp 0.6 (thanks Kevin Kofler)

This adds patches that make the thing build with yaml-cpp 0.6
and GCC 8, the latter submitted upstream (the former is a bit
too hacky to go upstream as-is), and reverts the changes to try
and build with a bundled yaml-cpp. Thanks to Kevin Kofler for
helping to figure out both issues.
This commit is contained in:
Adam Williamson 2018-02-19 22:18:50 -08:00
parent 1777ff3701
commit c7a8ea7afd
3 changed files with 1876 additions and 8 deletions

View File

@ -14,6 +14,14 @@ URL: http://opencolorio.org/
Source0: https://github.com/imageworks/OpenColorIO/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: OpenColorIO-gcc.patch
Patch1: OpenColorIO-setuptools.patch
# Fix build against yaml-cpp 0.6.0+
# This patch is fine for our case (building against system yaml-cpp)
# but probably a bit too simple-minded to upstream as-is. See
# https://github.com/imageworks/OpenColorIO/issues/517
Patch2: ocio-1.1.0-yamlcpp060.patch
# Fix build of Python bindings with GCC 8
# https://github.com/imageworks/OpenColorIO/pull/518
Patch3: ocio-1.1.0-gcc8.patch
# Utilities
BuildRequires: cmake
@ -58,7 +66,7 @@ BuildRequires: zlib-devel
#######################
BuildRequires: tinyxml-devel
BuildRequires: lcms2-devel
#BuildRequires: yaml-cpp-devel >= 0.5.0
BuildRequires: yaml-cpp-devel >= 0.5.0
# The following bundled projects are only used for document generation.
#BuildRequires: python-docutils
@ -67,9 +75,6 @@ BuildRequires: lcms2-devel
#BuildRequires: python-setuptools
#BuildRequires: python-sphinx
# Workaround for https://github.com/imageworks/OpenColorIO/issues/517
Provides: bundled(yaml-cpp) = 0.3.0
%description
OCIO enables color transforms and image display to be handled in a consistent
@ -111,7 +116,7 @@ Development libraries and headers for %{name}.
# Remove what bundled libraries
rm -f ext/lcms*
rm -f ext/tinyxml*
#rm -f ext/yaml*
rm -f ext/yaml*
%build
@ -120,7 +125,7 @@ rm -rf build && mkdir build && pushd build
-DOCIO_BUILD_DOCS=ON \
-DOCIO_BUILD_TESTS=ON \
-DOCIO_PYGLUE_SONAME=OFF \
-DUSE_EXTERNAL_YAML=FALSE \
-DUSE_EXTERNAL_YAML=TRUE \
-DUSE_EXTERNAL_TINYXML=TRUE \
-DUSE_EXTERNAL_LCMS=TRUE \
-DUSE_EXTERNAL_SETUPTOOLS=TRUE \
@ -188,8 +193,10 @@ find %{buildroot} -name "*.cmake" -exec mv {} %{buildroot}%{_datadir}/cmake/Modu
%changelog
* Wed Feb 14 2018 Richard Shaw <hobbes1069@gmail.com> - 1.1.0-3
- Rebuild for yaml-cpp 0.6.0.
* Mon Feb 19 2018 Adam Williamson <awilliam@redhat.com> - 1.1.0-3
- Fix build with yaml-cpp 0.6+ (patch out bogus hidden visibility)
- Fix build with GCC 8 (issues in Python bindings, upstream PR #518)
- Rebuild for yaml-cpp 0.6.1
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1815
ocio-1.1.0-gcc8.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
--- OpenColorIO-1.1.0/src/core/OCIOYaml.cpp 2018-01-04 17:38:27.000000000 -0800
+++ OpenColorIO-1.1.0/src/core/OCIOYaml.cpp.new 2018-02-19 16:37:56.733948242 -0800
@@ -30,43 +30,6 @@
#include <OpenColorIO/OpenColorIO.h>
-#ifndef WIN32
-
-// fwd declare yaml-cpp visibility
-#pragma GCC visibility push(hidden)
-namespace YAML {
- class Exception;
- class BadDereference;
- class RepresentationException;
- class EmitterException;
- class ParserException;
- class InvalidScalar;
- class KeyNotFound;
- template <typename T> class TypedKeyNotFound;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::ColorSpace>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::Config>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::Exception>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::GpuShaderDesc>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::ImageDesc>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::Look>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::Processor>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::Transform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::AllocationTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::CDLTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::ColorSpaceTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::DisplayTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::ExponentTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::FileTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::GroupTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::LogTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::LookTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::MatrixTransform>;
- template <> class TypedKeyNotFound<OCIO_NAMESPACE::TruelightTransform>;
-}
-#pragma GCC visibility pop
-
-#endif
-
#ifdef WIN32
#pragma warning( push )
#pragma warning( disable: 4146 )