Update to latest upstream release.

- Fix ppc builds (BZ#1021977).
- Add conditionals to build requirements for EPEL 6.
This commit is contained in:
Richard M. Shaw 2013-11-06 10:56:34 -06:00
parent d70c6b36a2
commit ebab20c200
6 changed files with 128 additions and 19 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ clog
/oiio-Release-1.1.13.tar.gz
/oiio-Release-1.2.0.tar.gz
/oiio-Release-1.2.1.tar.gz
/oiio-Release-1.2.3.tar.gz

View File

@ -1,6 +1,10 @@
%if 0%{?rhel}
%global cmake %cmake28
%endif
Name: OpenImageIO
Version: 1.2.1
Release: 2%{?dist}
Version: 1.2.3
Release: 1%{?dist}
Summary: Library for reading and writing images
Group: Development/Libraries
@ -15,19 +19,29 @@ Source101: FindTBB.cmake
Patch0: oiio-arm.patch
Patch1: oiio-ppc.patch
Patch2: oiio-s390.patch
Patch3: oiio-hdf5.patch
Patch3: oiio-cmake.patch
Patch4: oiio-spin_mutex.patch
BuildRequires: cmake txt2man
%if 0%{?rhel}
BuildRequires: cmake28
%else
BuildRequires: cmake
%endif
BuildRequires: txt2man
BuildRequires: qt4-devel
BuildRequires: boost-devel
BuildRequires: glew-devel
BuildRequires: OpenEXR-devel ilmbase-devel
BuildRequires: python2-devel
BuildRequires: libpng-devel libtiff-devel openjpeg-devel libwebp-devel
BuildRequires: libpng-devel libtiff-devel openjpeg-devel
%if 0%{?!rhel}
BuildRequires: libwebp-devel
BuildRequires: Field3D-devel
%endif
BuildRequires: hdf5-devel
BuildRequires: zlib-devel
BuildRequires: jasper-devel
BuildRequires: pugixml-devel
BuildRequires: hdf5-devel Field3D-devel
BuildRequires: OpenColorIO-devel
# We don't want to provide private python extension libs
@ -81,7 +95,8 @@ Development files for package %{name}
%patch0 -p1 -b .arm
%patch1 -p1 -b .ppc
#patch2 -p1 -b .s390
%patch3 -p1 -b .hdf5
%patch3 -p1 -b .cmake
%patch4 -p1 -b .spin_mutex
# Install FindTBB.cmake
install %{SOURCE101} src/cmake/modules/
@ -159,6 +174,14 @@ cp -a doc/*.1 %{buildroot}%{_mandir}/man1
%changelog
* Wed Nov 6 2013 Richard Shaw <hobbes1069@gmail.com> - 1.2.3-1
- Update to latest upstream release.
- Fix ppc builds (BZ#1021977).
- Add conditionals to build requirements for EPEL 6.
* Wed Oct 2 2013 Richard Shaw <hobbes1069@gmail.com> - 1.2.2-1
- Update to latest upstream release.
* Sun Sep 08 2013 Rex Dieter <rdieter@fedoraproject.org> 1.2.1-2
- rebuild (ilmbase/openexr)

15
oiio-cmake.patch Normal file
View File

@ -0,0 +1,15 @@
diff -Naur oiio-Release-1.2.2.orig/src/CMakeLists.txt oiio-Release-1.2.2/src/CMakeLists.txt
--- oiio-Release-1.2.2.orig/src/CMakeLists.txt 2013-09-30 12:25:21.000000000 -0500
+++ oiio-Release-1.2.2/src/CMakeLists.txt 2013-10-02 08:04:11.217616340 -0500
@@ -396,9 +396,9 @@
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/doc/Description.txt")
set (CPACK_PACKAGE_FILE_NAME OpenImageIO-${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}.${OIIO_VERSION_PATCH}-${platform})
#SET (CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_SOURCE_DIR}/..)
-exec_program ("cmake -E copy ${PROJECT_SOURCE_DIR}/../LICENSE ${CMAKE_BINARY_DIR}/License.txt")
+exec_program ("${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/../LICENSE ${CMAKE_BINARY_DIR}/License.txt")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/License.txt")
-exec_program ("cmake -E copy ${PROJECT_SOURCE_DIR}/../README.rst ${CMAKE_BINARY_DIR}/Readme.rst")
+exec_program ("${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/../README.rst ${CMAKE_BINARY_DIR}/Readme.rst")
set (CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/Readme.rst")
set (CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/doc/Welcome.txt")
#SET (CPACK_STRIP_FILES Do we need this?)

View File

@ -1,11 +0,0 @@
diff -Naur oiio-Release-1.2.1.orig/src/cmake/externalpackages.cmake oiio-Release-1.2.1/src/cmake/externalpackages.cmake
--- oiio-Release-1.2.1.orig/src/cmake/externalpackages.cmake 2013-08-06 00:10:31.000000000 -0500
+++ oiio-Release-1.2.1/src/cmake/externalpackages.cmake 2013-08-29 09:12:03.303106159 -0500
@@ -285,6 +285,7 @@
# variables HDF5_INCLUDE_DIRS and HDF5_LIBRARIES.
else ()
find_package (HDF5 COMPONENTS CXX)
+ set(HDF5_LIBRARIES ${HDF5_LIBRARIES_RELEASE})
endif ()
if (VERBOSE)
message (STATUS "HDF5_FOUND=${HDF5_FOUND}")

81
oiio-spin_mutex.patch Normal file
View File

@ -0,0 +1,81 @@
From 77fd2276e12791dc17cb20526cd371d66140e416 Mon Sep 17 00:00:00 2001
From: Larry Gritz <lg@larrygritz.com>
Date: Tue, 5 Nov 2013 16:05:43 -0800
Subject: [PATCH] Make cleaner threads.h compile for the NOTHREADS case
---
src/include/thread.h | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/src/include/thread.h b/src/include/thread.h
index e389ebb..ecf3e66 100644
--- a/src/include/thread.h
+++ b/src/include/thread.h
@@ -128,6 +128,7 @@ class null_mutex {
void unlock () { }
void lock_shared () { }
void unlock_shared () { }
+ bool try_lock () { return true; }
};
/// Null lock that can be substituted for a real one to test how much
@@ -219,7 +220,9 @@ class thread_specific_ptr {
inline int
atomic_exchange_and_add (volatile int *at, int x)
{
-#ifdef USE_GCC_ATOMICS
+#ifdef NOTHREADS
+ int r = *at; *at += x; return r;
+#elif defined(USE_GCC_ATOMICS)
return __sync_fetch_and_add ((int *)at, x);
#elif USE_TBB
atomic<int> *a = (atomic<int> *)at;
@@ -237,7 +240,9 @@ class thread_specific_ptr {
inline long long
atomic_exchange_and_add (volatile long long *at, long long x)
{
-#ifdef USE_GCC_ATOMICS
+#ifdef NOTHREADS
+ long long r = *at; *at += x; return r;
+#elif defined(USE_GCC_ATOMICS)
return __sync_fetch_and_add (at, x);
#elif USE_TBB
atomic<long long> *a = (atomic<long long> *)at;
@@ -261,11 +266,17 @@ class thread_specific_ptr {
/// *at = newval; return true;
/// } else {
/// return false;
-///
+/// }
inline bool
atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
{
-#ifdef USE_GCC_ATOMICS
+#ifdef NOTHREADS
+ if (*at == compareval) {
+ *at = newval; return true;
+ } else {
+ return false;
+ }
+#elif defined(USE_GCC_ATOMICS)
return __sync_bool_compare_and_swap (at, compareval, newval);
#elif USE_TBB
atomic<int> *a = (atomic<int> *)at;
@@ -282,7 +293,13 @@ class thread_specific_ptr {
inline bool
atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
{
-#ifdef USE_GCC_ATOMICS
+#ifdef NOTHREADS
+ if (*at == compareval) {
+ *at = newval; return true;
+ } else {
+ return false;
+ }
+#elif defined(USE_GCC_ATOMICS)
return __sync_bool_compare_and_swap (at, compareval, newval);
#elif USE_TBB
atomic<long long> *a = (atomic<long long> *)at;
--
1.8.4

View File

@ -1 +1 @@
59d91de4774eec122a305a23435fc329 oiio-Release-1.2.1.tar.gz
abb6534f9b9b5540c0113e8cde95e427 oiio-Release-1.2.3.tar.gz