Add patch for OIIO 2.0 and mesa glext.h header changes.

This commit is contained in:
Richard Shaw 2018-12-13 08:19:55 -06:00
parent 4426e12d59
commit 659d32819f
3 changed files with 153 additions and 1 deletions

View File

@ -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 <hobbes1069@gmail.com> - 1.1.0-10
- Add patch for OIIO 2.0 and mesa glext.h header changes.
* Mon Sep 24 2018 Richard Shaw <hobbes1069@gmail.com> - 1.1.0-9
- Obsolete Python2 library and build Python3 library.

10
ocio-glext_h.patch Normal file
View File

@ -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 <GL/glew.h>
#include <GL/gl.h>
-#include <GL/glext.h>
#include <GL/glut.h>
#endif

137
ocio-oiio2.patch Normal file
View File

@ -0,0 +1,137 @@
From d025c2c3e1856f2d8fc15bc10be8a913ea6f1bb6 Mon Sep 17 00:00:00 2001
From: Larry Gritz <lg@larrygritz.com>
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<int> 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 <OpenImageIO/imageio.h>
#include <OpenImageIO/typedesc.h>
-#if (OIIO_VERSION < 10100)
-namespace OIIO = OIIO_NAMESPACE;
-#endif
#ifdef __APPLE__
#include <OpenGL/gl.h>
@@ -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 <OpenImageIO/imageio.h>
#include <OpenImageIO/typedesc.h>
-#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<float> 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.