From 659d32819fac4f55860a71cbeaaae4857cfe165c Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Dec 13 2018 14:19:55 +0000 Subject: Add patch for OIIO 2.0 and mesa glext.h header changes. --- diff --git a/OpenColorIO.spec b/OpenColorIO.spec index 8d89e29..f2de0f0 100644 --- a/OpenColorIO.spec +++ b/OpenColorIO.spec @@ -5,7 +5,7 @@ Name: OpenColorIO Version: 1.1.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Enables color transforms and image display across graphics apps License: BSD @@ -21,6 +21,8 @@ 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 +Patch4: ocio-oiio2.patch +Patch5: ocio-glext_h.patch # Utilities BuildRequires: cmake gcc-c++ @@ -204,6 +206,9 @@ find %{buildroot} -name "*.cmake" -exec mv {} %{buildroot}%{_datadir}/cmake/Modu %changelog +* Thu Dec 13 2018 Richard Shaw - 1.1.0-10 +- Add patch for OIIO 2.0 and mesa glext.h header changes. + * Mon Sep 24 2018 Richard Shaw - 1.1.0-9 - Obsolete Python2 library and build Python3 library. diff --git a/ocio-glext_h.patch b/ocio-glext_h.patch new file mode 100644 index 0000000..28a921d --- /dev/null +++ b/ocio-glext_h.patch @@ -0,0 +1,10 @@ +--- a/src/apps/ociodisplay/main.cpp ++++ b/src/apps/ociodisplay/main.cpp +@@ -52,7 +52,6 @@ namespace OCIO = OCIO_NAMESPACE; + #else + #include + #include +-#include + #include + #endif + diff --git a/ocio-oiio2.patch b/ocio-oiio2.patch new file mode 100644 index 0000000..3d53bae --- /dev/null +++ b/ocio-oiio2.patch @@ -0,0 +1,137 @@ +From d025c2c3e1856f2d8fc15bc10be8a913ea6f1bb6 Mon Sep 17 00:00:00 2001 +From: Larry Gritz +Date: Wed, 3 Oct 2018 14:54:48 -0700 +Subject: [PATCH] Compatibility with OIIO 1.9+, minor ImageInput/ImageOutput + API changes + +--- + src/apps/ocioconvert/main.cpp | 12 ++++++++---- + src/apps/ociodisplay/main.cpp | 7 +++---- + src/apps/ociolutimage/main.cpp | 15 ++++++++------- + 3 files changed, 19 insertions(+), 15 deletions(-) + +--- a/src/apps/ocioconvert/main.cpp ++++ b/src/apps/ocioconvert/main.cpp +@@ -119,7 +119,7 @@ int main(int argc, const char **argv) + std::cerr << "Loading " << inputimage << std::endl; + try + { +- OIIO::ImageInput* f = OIIO::ImageInput::create(inputimage); ++ auto f = OIIO::ImageInput::create(inputimage); + if(!f) + { + std::cerr << "Could not create image input." << std::endl; +@@ -143,7 +143,9 @@ int main(int argc, const char **argv) + memset(&img[0], 0, imgwidth*imgheight*components*sizeof(float)); + + f->read_image(OIIO::TypeDesc::TypeFloat, &img[0]); +- delete f; ++#if OIIO_VERSION < 10903 ++ OIIO::ImageInput::destroy(f); ++#endif + + std::vector kchannels; + //parse --ch argument +@@ -308,7 +310,7 @@ int main(int argc, const char **argv) + // Write out the result + try + { +- OIIO::ImageOutput* f = OIIO::ImageOutput::create(outputimage); ++ auto f = OIIO::ImageOutput::create(outputimage); + if(!f) + { + std::cerr << "Could not create output input." << std::endl; +@@ -318,7 +320,9 @@ int main(int argc, const char **argv) + f->open(outputimage, spec); + f->write_image(OIIO::TypeDesc::FLOAT, &img[0]); + f->close(); +- delete f; ++#if OIIO_VERSION < 10903 ++ OIIO::ImageInput::destroy(f); ++#endif + } + catch(...) + { +--- a/src/apps/ociodisplay/main.cpp ++++ b/src/apps/ociodisplay/main.cpp +@@ -41,9 +41,6 @@ namespace OCIO = OCIO_NAMESPACE; + + #include + #include +-#if (OIIO_VERSION < 10100) +-namespace OIIO = OIIO_NAMESPACE; +-#endif + + #ifdef __APPLE__ + #include +@@ -106,7 +103,7 @@ static void InitImageTexture(const char + std::cout << "loading: " << filename << std::endl; + try + { +- OIIO::ImageInput* f = OIIO::ImageInput::create(filename); ++ auto f = OIIO::ImageInput::create(filename); + if(!f) + { + std::cerr << "Could not create image input." << std::endl; +@@ -137,7 +134,9 @@ static void InitImageTexture(const char + OIIO::TypeDesc::TypeFloat, + #endif + &img[0]); ++#if OIIO_VERSION < 10903 + OIIO::ImageInput::destroy(f); ++#endif + } + catch(...) + { +--- a/src/apps/ociolutimage/main.cpp ++++ b/src/apps/ociolutimage/main.cpp +@@ -32,9 +32,6 @@ OCIO_NAMESPACE_USING; + + #include + #include +-#if (OIIO_VERSION < 10100) +-namespace OIIO = OIIO_NAMESPACE; +-#endif + + #include "argparse.h" + +@@ -116,7 +113,7 @@ void Generate(int cubesize, int maxwidth + processor->apply(imgdesc); + } + +- OIIO::ImageOutput* f = OIIO::ImageOutput::create(outputfile); ++ auto f = OIIO::ImageOutput::create(outputfile); + if(!f) + { + throw Exception( "Could not create output image."); +@@ -128,7 +125,9 @@ void Generate(int cubesize, int maxwidth + f->open(outputfile, spec); + f->write_image(OIIO::TypeDesc::FLOAT, &img[0]); + f->close(); +- delete f; ++#if OIIO_VERSION < 10903 ++ OIIO::ImageInput::destroy(f); ++#endif + } + + +@@ -137,7 +136,7 @@ void Extract(int cubesize, int maxwidth, + const std::string & outputfile) + { + // Read the image +- OIIO::ImageInput* f = OIIO::ImageInput::create(inputfile); ++ auto f = OIIO::ImageInput::create(inputfile); + if(!f) + { + throw Exception("Could not create input image."); +@@ -183,7 +182,9 @@ void Extract(int cubesize, int maxwidth, + std::vector img; + img.resize(spec.width*spec.height*spec.nchannels, 0); + f->read_image(OIIO::TypeDesc::TypeFloat, &img[0]); +- delete f; ++#if OIIO_VERSION < 10903 ++ OIIO::ImageInput::destroy(f); ++#endif + + // Repack into rgb + // Convert the RGB[...] image to an RGB image, in place.