diff --git a/tools/MacPorts/graphics/openimageio/Portfile b/tools/MacPorts/graphics/openimageio/Portfile index 16fa2a074a..492e0f693f 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile +++ b/tools/MacPorts/graphics/openimageio/Portfile @@ -19,6 +19,7 @@ github.setup OpenImageIO oiio 1.7.17 tags/Release- #github.tarball_from downloads name openimageio +conflicts openimageio16 revision 2 categories graphics platforms darwin @@ -52,22 +53,29 @@ depends_skip_archcheck txt2man # macports-clang < 3.3 untested # clang < 300 doesn't work # see also https://github.com/OpenImageIO/oiio/issues/1363 +compiler.blacklist-append {*gcc-3*} {*gcc-4.[0-1]} {macports-gcc-4.[2-7]} {gcc-4.[2-7]} {apple-gcc-4.[2-7]} cc {clang < 300} + # for some reason, if we compile oiio with gcc 4.9 and boost with gcc 4.2, idiff a.png b.png crashes -#compiler.fallback-append macports-clang-3.4 macports-gcc-4.8 macports-gcc-4.9 macports-clang-3.3 macports-clang-3.4 macports-clang-3.5 if {${configure.cxx_stdlib} eq "libstdc++"} { - if {[vercmp $xcodeversion 3.0] >= 0} { - compiler.fallback-append macports-clang-3.4 - } else { - compiler.fallback-append macports-clang-3.3 - } + # disable C++11 if not required (OIIO 1.8 requires C++11) + configure.args-append -DUSE_CPP11:BOOL=FALSE + if {[vercmp $xcodeversion 3.0] >= 0} { + compiler.fallback-append macports-clang-3.4 + } else { + compiler.fallback-append macports-clang-3.3 + } } -compiler.blacklist apple-gcc-4.0 apple-gcc-4.2 gcc-3.3 gcc-4.0 gcc-4.2 macports-gcc-4.0 macports-gcc-4.2 llvm-gcc-4.2 {clang < 300} -# The PowerPC build requires GCC >= 4.8, which doesn't recognize the -arch flag, and requires libatomic +# GCC < 4.9 does not have proper GCC intrinsics support +compiler.blacklist-append {*gcc-4.8} +compiler.fallback-append macports-clang-5 macports-clang-4 macports-clang-3.[5-9] +compiler.fallback-append {*gcc-[5-9]} {*gcc-4.9} + +# The PowerPC build requires GCC >= 4.9, which doesn't recognize the -arch flag, and requires libatomic # Unfortunately, the resulting binaries don't work (at least on PPC), so we build without threads if {${configure.build_arch} eq "ppc" || ${configure.build_arch} eq "ppc64"} { - compiler.blacklist-append macports-clang-3.3 macports-clang-3.4 macports-clang-3.5 -# compiler.blacklist-append macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 macports-gcc-4.7 + # there is no known working clang compiler for ppc + compiler.blacklist-append {macports-clang*} # # the following removes the flag "-arch ppc" put by cmake-1.0 portgroup in the pre-configure phase # pre-configure { # configure.args-delete -DCMAKE_OSX_ARCHITECTURES="${configure.build_arch}" @@ -125,10 +133,6 @@ default_variants +opencolorio +openjpeg +qt4 +freetype variant natron conflicts ffmpeg requires opencolorio openjpeg qt4 freetype description {Natron version} { if {${configure.cxx_stdlib} eq "libstdc++"} { - # configure with GCC 4.9 for proper GCC intrinsics support - #configure.compiler macports-gcc-4.9 - # but disable C++11 if not required (OIIO 1.8 requires C++11) - configure.args-append -DUSE_CPP11:BOOL=FALSE } } diff --git a/tools/MacPorts/graphics/openimageio/Portfile~1.6.11 b/tools/MacPorts/graphics/openimageio/Portfile~1.6.11 deleted file mode 100644 index 71f62c29de..0000000000 --- a/tools/MacPorts/graphics/openimageio/Portfile~1.6.11 +++ /dev/null @@ -1,183 +0,0 @@ -# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -# $Id$ - -PortSystem 1.0 -PortGroup github 1.0 -PortGroup cmake 1.0 -PortGroup conflicts_build 1.0 -PortGroup qt4 1.0 -PortGroup compiler_blacklist_versions 1.0 -# gcc-4.8 cannot compile universal -# The internal yaml-cpp is not compiled with multiple archs in universal mode -#PortGroup muniversal 1.0 - -epoch 1 - -fetch.type git -github.setup OpenImageIO oiio 1.6.11 tags/Release- -#github.version ${version}-dist -#github.tarball_from downloads - -name openimageio -#version 1.4.5.91 -#revision 1 -categories graphics -platforms darwin -license BSD -maintainers openmaintainer -description OpenImageIO is a library for reading and writing images -long_description ${description} -homepage http://sites.google.com/site/openimageio/ - - -#master_sites debian:o/openimageio/ -#worksrcdir ${name}-${version}~dfsg0.orig -#distfiles ${name}_${version}~dfsg0.orig${extract.suffix} -#checksums rmd160 94c6e2274be01e82cfe8bc4bf11677593d33f299 \ -# sha256 4cf3b373e56694ce9e3896a356b68a2ed92978e76be653a5b5e45b17937faae8 - -depends_lib port:boost path:lib/libjpeg.dylib:jpeg port:tiff port:libpng port:openexr port:glew port:ilmbase port:libraw port:giflib port:webp - -# can't compile openimageio when another version is installed, because the include path is wrong -conflicts_build ${name} - -depends_build port:txt2man -depends_skip_archcheck txt2man -# port:opencolorio - -# we need gcc atomics (clang >= 3.5 maybe?, gcc >= 4.8 works) -# tested with openimageio 1.4.6rc1: -# macports-clang-3.3 and later work -# gcc-4.2 doesn't work -# llvm-gcc-4.2 works -# macports-clang < 3.3 untested -# clang < 300 doesn't work -#compiler.fallback-append macports-gcc-4.8 macports-gcc-4.9 macports-clang-3.3 macports-clang-3.4 macports-clang-3.5 -compiler.blacklist apple-gcc-4.0 apple-gcc-4.2 gcc-3.3 gcc-4.0 gcc-4.2 macports-gcc-4.0 macports-gcc-4.2 {clang < 300} - -# The PowerPC build requires GCC >= 4.8, which doesn't recognize the -arch flag, and requires libatomic -# Unfortunately, the resulting binaries don't work (at least on PPC), so we build without threads -if {${configure.build_arch} eq "ppc" || ${configure.build_arch} eq "ppc64"} { - compiler.blacklist-append macports-clang-3.3 macports-clang-3.4 macports-clang-3.5 -# compiler.blacklist-append macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 macports-gcc-4.7 -# # the following removes the flag "-arch ppc" put by cmake-1.0 portgroup in the pre-configure phase -# pre-configure { -# configure.args-delete -DCMAKE_OSX_ARCHITECTURES="${configure.build_arch}" -# } -# ## -latomic is necessary on ppc for __atomic_fetch_add_8 and __atomic_exchange_8 -# configure.args-append -DCMAKE_SHARED_LINKER_FLAGS=-latomic -DCMAKE_EXE_LINKER_FLAGS=-latomic - # env PATH=/opt/local/libexec/qt4/bin:$PATH cmake .. -DNOTHREADS=ON -DCMAKE_BUILD_TYPE=Debug -DSTOP_ON_WARNING=OFF - configure.args-append -DNOTHREADS=ON -DSTOP_ON_WARNING=OFF - ## uncomment the following to compile with buggy thread support - # env PATH=/opt/local/libexec/qt4/bin:$PATH cmake .. -DCMAKE_C_COMPILER=gcc-mp-4.9 -DCMAKE_CXX_COMPILER=g++-mp-4.9 -DCMAKE_SHARED_LINKER_FLAGS=-latomic -DCMAKE_EXE_LINKER_FLAGS=-latomic -DCMAKE_BUILD_TYPE=Debug -DSTOP_ON_WARNING=OFF - ## -latomic is necessary on ppc for __atomic_fetch_add_8 and __atomic_exchange_8 - #configure.args-append -DCMAKE_SHARED_LINKER_FLAGS=-latomic -DCMAKE_EXE_LINKER_FLAGS=-latomic -} - -#post-extract { -# system "touch ${worksrcpath}/LICENSE ${workpath}/${worksrcdir}/LICENSE" -#} - -# Those are Debian patches, which require -p1 -#patch.pre_args -p1 -#patchfiles \ -# build_in_sources.patch -# 0001-Fix_docs_generation.patch \ -# 0002-Fix_IlmBase_issue.patch \ -# 0003-Fix_multiarch_paths.patch \ -# 0004-Fix_FTBFS_on_atomic_operations.patch \ - -patch.pre_args -p1 -patchfiles \ - oiio-1.5.23-checkmaxmem.patch \ - oiio-1.5.23-invalidatespec.patch \ - oiio-nothreads.patch \ - oiio-1.6.11-fix_exr_threads.patch - -cmake.out_of_source yes - -configure.args-append \ - -DOIIO_BUILD_TESTS:BOOL=FALSE \ - -DBOOST_ROOT=${prefix} \ - -DUSE_QT:BOOL=FALSE \ - -DUSE_TBB:BOOL=FALSE \ - -DUSE_PYTHON:BOOL=FALSE \ - -DUSE_PYTHON3:BOOL=FALSE \ - -DUSE_FIELD3D:BOOL=FALSE \ - -DUSE_FFMPEG:BOOL=FALSE \ - -DUSE_OPENJPEG:BOOL=FALSE \ - -DUSE_OCIO:BOOL=FALSE \ - -DUSE_OPENCV:BOOL=FALSE \ - -DUSE_OPENSSL:BOOL=FALSE \ - -DUSE_FREETYPE:BOOL=FALSE \ - -DUSE_GIF:BOOL=TRUE \ - -DUSE_PTEX:BOOL=FALSE \ - -DUSE_LIBRAW:BOOL=TRUE \ - -DUSE_NUKE:BOOL=FALSE \ - -DSTOP_ON_WARNING:BOOL=FALSE - -default_variants +opencolorio +openjpeg +qt4 +freetype - -variant opencolorio description {Add OpenColorIO support.} { - depends_lib-append port:opencolorio - configure.args-delete -DUSE_OCIO:BOOL=FALSE - configure.args-append -DUSE_OCIO:BOOL=TRUE -} - -variant ffmpeg description {Add FFmpeg support.} { - depends_lib-append port:ffmpeg - configure.args-delete -DUSE_FFMPEG:BOOL=FALSE - configure.args-append -DUSE_FFMPEG:BOOL=TRUE -} - -variant openjpeg description {Add OpenJPEG support.} { - depends_lib-append port:openjpeg15 - configure.args-delete -DUSE_OPENJPEG:BOOL=FALSE - configure.args-append -DUSE_OPENJPEG:BOOL=TRUE -DOPENJPEG_INCLUDE_DIR=${prefix}/include/openjpeg-1.5 -} - -variant python26 conflicts python27 description {Add Python 2.6 bindings.} { - depends_lib-append port:python26 - configure.args-delete -DUSE_PYTHON:BOOL=FALSE - configure.args-append -DUSE_PYTHON:BOOL=TRUE \ - -DPYTHON_VERSION=2.6 \ - -DPYTHON_EXECUTABLE=${prefix}/bin/python2.6 \ - -DPYTHON_LIBRARY=${prefix}/lib/libpython2.6.dylib \ - -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.6/Headers \ - -DPYTHON_PACKAGES_PATH=${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/site-packages -} - -variant python27 conflicts python26 description {Add Python 2.7 bindings.} { - depends_lib-append port:python27 - configure.args-delete -DUSE_PYTHON:BOOL=FALSE - configure.args-append -DUSE_PYTHON:BOOL=TRUE \ - -DPYTHON_VERSION=2.7 \ - -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \ - -DPYTHON_LIBRARY=${prefix}/lib/libpython2.7.dylib \ - -DPYTHON_INCLUDE_DIR=${frameworks_dir}/Python.framework/Versions/2.7/Headers \ - -DPYTHON_PACKAGES_PATH=${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages -} - -variant qt4 description {Build the Qt-based image viewer.} { - configure.args-delete -DUSE_QT:BOOL=FALSE - configure.args-append -DUSE_QT:BOOL=TRUE - depends_lib-append port:qt4-mac -} - -variant field3d description {Use Field3D.} { - configure.args-delete -DUSE_FIELD3D:BOOL=FALSE - configure.args-append -DUSE_FIELD3D:BOOL=TRUE - depends_lib-append port:field3d -} - -variant freetype description {Use FreeType.} { - configure.args-delete -DUSE_FREETYPE:BOOL=FALSE - configure.args-append -DUSE_FREETYPE:BOOL=TRUE -DFREETYPE_INCLUDE_DIRS=${prefix}/include/freetype2 - depends_lib-append port:freetype -} - -variant natron require field3d description {Compile a version to be included in Natron} { -} -#configure.args --enable-bsdtar=shared --enable-bsdcpio=shared \ -# --without-lzmadec --without-lzma -#use_autoreconf yes diff --git a/tools/MacPorts/graphics/openimageio/Portfile~1.6.18 b/tools/MacPorts/graphics/openimageio16/Portfile similarity index 89% rename from tools/MacPorts/graphics/openimageio/Portfile~1.6.18 rename to tools/MacPorts/graphics/openimageio16/Portfile index 31a08a01fb..77f22381c5 100644 --- a/tools/MacPorts/graphics/openimageio/Portfile~1.6.18 +++ b/tools/MacPorts/graphics/openimageio16/Portfile @@ -18,9 +18,10 @@ github.setup OpenImageIO oiio 1.6.18 tags/Release- #github.version ${version}-dist #github.tarball_from downloads -name openimageio +name openimageio16 +conflicts openimageio #version 1.4.5.91 -revision 2 +#revision 1 categories graphics platforms darwin license BSD @@ -52,13 +53,14 @@ depends_skip_archcheck txt2man # llvm-gcc-4.2 works # macports-clang < 3.3 untested # clang < 300 doesn't work -#compiler.fallback-append macports-gcc-4.8 macports-gcc-4.9 macports-clang-3.3 macports-clang-3.4 macports-clang-3.5 -compiler.blacklist apple-gcc-4.0 apple-gcc-4.2 gcc-3.3 gcc-4.0 gcc-4.2 macports-gcc-4.0 macports-gcc-4.2 {clang < 300} +# see also https://github.com/OpenImageIO/oiio/issues/1363 +#compiler.blacklist-append {*gcc-3*} {*gcc-4.[0-1]} {macports-gcc-4.[2-7]} {gcc-4.[2-7]} {apple-gcc-4.[2-7]} cc {clang < 300} # The PowerPC build requires GCC >= 4.8, which doesn't recognize the -arch flag, and requires libatomic # Unfortunately, the resulting binaries don't work (at least on PPC), so we build without threads if {${configure.build_arch} eq "ppc" || ${configure.build_arch} eq "ppc64"} { - compiler.blacklist-append macports-clang-3.3 macports-clang-3.4 macports-clang-3.5 + # there is no known working clang compiler for ppc + compiler.blacklist-append {macports-clang*} # compiler.blacklist-append macports-gcc-4.3 macports-gcc-4.4 macports-gcc-4.5 macports-gcc-4.6 macports-gcc-4.7 # # the following removes the flag "-arch ppc" put by cmake-1.0 portgroup in the pre-configure phase # pre-configure { @@ -67,7 +69,7 @@ if {${configure.build_arch} eq "ppc" || ${configure.build_arch} eq "ppc64"} { # ## -latomic is necessary on ppc for __atomic_fetch_add_8 and __atomic_exchange_8 # configure.args-append -DCMAKE_SHARED_LINKER_FLAGS=-latomic -DCMAKE_EXE_LINKER_FLAGS=-latomic # env PATH=/opt/local/libexec/qt4/bin:$PATH cmake .. -DNOTHREADS=ON -DCMAKE_BUILD_TYPE=Debug -DSTOP_ON_WARNING=OFF - configure.args-append -DNOTHREADS=ON -DSTOP_ON_WARNING=OFF + #configure.args-append -DNOTHREADS=ON -DSTOP_ON_WARNING=OFF ## uncomment the following to compile with buggy thread support # env PATH=/opt/local/libexec/qt4/bin:$PATH cmake .. -DCMAKE_C_COMPILER=gcc-mp-4.9 -DCMAKE_CXX_COMPILER=g++-mp-4.9 -DCMAKE_SHARED_LINKER_FLAGS=-latomic -DCMAKE_EXE_LINKER_FLAGS=-latomic -DCMAKE_BUILD_TYPE=Debug -DSTOP_ON_WARNING=OFF ## -latomic is necessary on ppc for __atomic_fetch_add_8 and __atomic_exchange_8 @@ -91,8 +93,12 @@ patch.pre_args -p1 patchfiles \ oiio-1.5.23-checkmaxmem.patch \ oiio-1.5.23-invalidatespec.patch \ - oiio-1.6.18-fix_read_tiles_prefix_bytes.patch \ + oiio-1.6.11-fix_exr_threads.patch \ oiio-1.6.18-fix-safe_tiffgetfield.patch \ + oiio-1.6.18-fix_read_tiles_prefix_bytes.patch \ + oiio-1.6.18-libraw.patch \ + oiio-1.6.18-tiffposition.patch \ + oiio-1.6.18-ppcatomics.patch \ oiio-nothreads.patch cmake.out_of_source yes @@ -120,10 +126,10 @@ configure.args-append \ default_variants +opencolorio +openjpeg +qt4 +freetype variant natron conflicts ffmpeg requires opencolorio openjpeg qt4 freetype description {Natron version} { - if {${configure.cxx_stdlib} eq "libstdc++"} { - # configure with GCC 4.9 for proper GCC intrinsics support - configure.compiler macports-gcc-4.9 - } + #if {${configure.cxx_stdlib} eq "libstdc++"} { + # # configure with GCC 4.9 for proper GCC intrinsics support + # configure.compiler macports-gcc-4.9 + #} } variant opencolorio description {Add OpenColorIO support.} { @@ -141,7 +147,7 @@ variant ffmpeg description {Add FFmpeg support.} { variant openjpeg description {Add OpenJPEG support.} { depends_lib-append port:openjpeg configure.args-delete -DUSE_OPENJPEG:BOOL=FALSE - configure.args-append -DUSE_OPENJPEG:BOOL=TRUE -DOPENJPEG_INCLUDE_DIR=${prefix}/include/openjpeg-1.5 + configure.args-append -DUSE_OPENJPEG:BOOL=TRUE -DOPENJPEG_HOME=${prefix} -DOPENJPEG_INCLUDE_DIR=`pkg-config --variable=includedir libopenjp2` } variant python26 conflicts python27 description {Add Python 2.6 bindings.} { diff --git a/tools/MacPorts/graphics/openimageio/README b/tools/MacPorts/graphics/openimageio16/README similarity index 53% rename from tools/MacPorts/graphics/openimageio/README rename to tools/MacPorts/graphics/openimageio16/README index bb26b6df77..a7ff31886d 100644 --- a/tools/MacPorts/graphics/openimageio/README +++ b/tools/MacPorts/graphics/openimageio16/README @@ -1,14 +1,21 @@ # building OIIO 1.6.10 os OSX 10.6 with macports: NATRON=../Natron -tar zxvf oiio-Release-1.6.10.tar.gz -cd oiio-Release-1.6.10 -patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-pnm16.patch +tar zxvf oiio-Release-1.6.18.tar.gz +cd oiio-Release-1.6.18 patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.5.23-checkmaxmem.patch patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.5.23-invalidatespec.patch patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.10-simd.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.11-fix_exr_threads.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.18-fix-safe_tiffgetfield.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.18-fix_read_tiles_prefix_bytes.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.18-libraw.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.18-tiffposition.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-1.6.18-ppcatomics.patch +patch -p1 < ${NATRON}/tools/MacOSX/ports/graphics/openimageio/files/oiio-nothreads.patch + prefix=/opt/local mkdir build cd build -env PATH=${prefix}/libexec/qt4/bin:$PATH CPPFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib cmake .. -DOIIO_BUILD_TESTS:BOOL=FALSE -DBOOST_ROOT=${prefix} -DUSE_QT:BOOL=TRUE -DUSE_TBB:BOOL=FALSE -DUSE_PYTHON:BOOL=FALSE -DUSE_PYTHON3:BOOL=FALSE -DUSE_FIELD3D:BOOL=FALSE -DUSE_FFMPEG:BOOL=FALSE -DUSE_OPENJPEG:BOOL=TRUE -DUSE_OCIO:BOOL=TRUE -DUSE_OPENCV:BOOL=FALSE -DUSE_OPENSSL:BOOL=FALSE -DUSE_FREETYPE:BOOL=TRUE -DUSE_GIF:BOOL=TRUE -DUSE_PTEX:BOOL=FALSE -DUSE_LIBRAW:BOOL=TRUE -DUSE_NUKE:BOOL=FALSE -DSTOP_ON_WARNING:BOOL=FALSE -DOPENJPEG_INCLUDE_DIR=${prefix}/include/openjpeg-1.5 -DFREETYPE_INCLUDE_PATH=${prefix}/include/freetype2 +env PATH=${prefix}/libexec/qt4/bin:$PATH CPPFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib cmake .. -DOIIO_BUILD_TESTS:BOOL=FALSE -DBOOST_ROOT=${prefix} -DUSE_QT:BOOL=TRUE -DUSE_TBB:BOOL=FALSE -DUSE_PYTHON:BOOL=FALSE -DUSE_PYTHON3:BOOL=FALSE -DUSE_FIELD3D:BOOL=FALSE -DUSE_FFMPEG:BOOL=FALSE -DUSE_OPENJPEG:BOOL=TRUE -DUSE_OCIO:BOOL=TRUE -DUSE_OPENCV:BOOL=FALSE -DUSE_OPENSSL:BOOL=FALSE -DUSE_FREETYPE:BOOL=TRUE -DUSE_GIF:BOOL=TRUE -DUSE_PTEX:BOOL=FALSE -DUSE_LIBRAW:BOOL=TRUE -DUSE_NUKE:BOOL=FALSE -DSTOP_ON_WARNING:BOOL=FALSE -DOPENJPEG_INCLUDE_DIR=`pkg-config --variable=includedir libopenjp2` -DFREETYPE_INCLUDE_PATH=${prefix}/include/freetype2 \ No newline at end of file diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.5.23-checkmaxmem.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.5.23-checkmaxmem.patch new file mode 100644 index 0000000000..942a431ac9 --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.5.23-checkmaxmem.patch @@ -0,0 +1,18 @@ +diff --git a/src/libtexture/imagecache.cpp b/src/libtexture/imagecache.cpp +index f750b5c..ddc0678 100644 +--- a/src/libtexture/imagecache.cpp ++++ b/src/libtexture/imagecache.cpp +@@ -2093,6 +2093,13 @@ ImageCacheImpl::check_max_mem (ImageCachePerThreadInfo *thread_info) + // looking up the first entry in the tile cache. + if (m_tile_sweep_id.empty()) { + TileCache::iterator sweep = m_tilecache.begin(); ++ if (sweep == m_tilecache.end()) { ++ // Maybe we do not own on the cache because ++ // add_tile_to_cache did not find the cache entry, and ++ // holds no lock (see comment in add_tile_to_cache). ++ // In this case just return. ++ return; ++ } + DASSERT (sweep != m_tilecache.end() && + "no way m_tilecache can be empty and use too much memory"); + m_tile_sweep_id = (*sweep).first; diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.5.23-invalidatespec.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.5.23-invalidatespec.patch new file mode 100644 index 0000000000..12695bfe58 --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.5.23-invalidatespec.patch @@ -0,0 +1,14 @@ +diff --git a/src/libtexture/imagecache_pvt.h b/src/libtexture/imagecache_pvt.h +index dec3504..788c7bc 100644 +--- a/src/libtexture/imagecache_pvt.h ++++ b/src/libtexture/imagecache_pvt.h +@@ -280,7 +280,8 @@ public: + /// Forget the specs we know + void invalidate_spec () { + m_validspec = false; +- m_subimages.clear (); ++ //Do not clear the subimages here because another thread might be using it ++ //m_subimages.clear (); + } + + private: diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.11-fix_exr_threads.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.11-fix_exr_threads.patch new file mode 100644 index 0000000000..f8c364a284 --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.11-fix_exr_threads.patch @@ -0,0 +1,27 @@ +diff --git a/src/openexr.imageio/exrinput.cpp b/src/openexr.imageio/exrinput.cpp +index de5dfc3..fa2bdd8 100644 +--- a/src/openexr.imageio/exrinput.cpp ++++ b/src/openexr.imageio/exrinput.cpp +@@ -84,6 +84,7 @@ + #include "OpenImageIO/fmath.h" + #include "OpenImageIO/filesystem.h" + #include "OpenImageIO/imagebufalgo_util.h" ++#include "OpenImageIO/sysutil.h" + + #include + +@@ -318,7 +319,13 @@ void set_exr_threads () + + int oiio_threads = 1; + OIIO::getattribute ("exr_threads", oiio_threads); +- ++ // 0 means all threads in OIIO, but single-threaded in OpenEXR ++ // -1 means single-threaded in OIIO ++ if (oiio_threads == 0) { ++ oiio_threads = Sysutil::hardware_concurrency(); ++ } else if (oiio_threads == -1) { ++ oiio_threads = 0; ++ } + spin_lock lock (exr_threads_mutex); + if (exr_threads != oiio_threads) { + exr_threads = oiio_threads; diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-fix-safe_tiffgetfield.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-fix-safe_tiffgetfield.patch new file mode 100644 index 0000000000..b75776535b --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-fix-safe_tiffgetfield.patch @@ -0,0 +1,120 @@ +diff --git a/src/tiff.imageio/tiffinput.cpp b/src/tiff.imageio/tiffinput.cpp +index 3ac97ca..253302f 100644 +--- a/src/tiff.imageio/tiffinput.cpp ++++ b/src/tiff.imageio/tiffinput.cpp +@@ -213,7 +213,7 @@ private: + std::cerr << "Error safe_tiffgetfield : did not expect ptr set on " + << name << " " << (void *)ptr << "\n"; + #endif +-// return false; ++ return false; + } + return ok; + } +@@ -221,9 +221,19 @@ private: + // Get a string tiff tag field and put it into extra_params + void get_string_attribute (const std::string &name, int tag) { + char *s = NULL; +- if (safe_tiffgetfield (name, tag, &s)) +- if (s && *s) +- m_spec.attribute (name, s); ++ void *ptr = NULL; // dummy -- expect it to stay NULL ++ bool ok = TIFFGetField (m_tif, tag, &s, &ptr); ++ if (ok && ptr) { ++ // Oy, some tags need 2 args, which are count, then ptr. ++ // There's no way to know ahead of time which ones, so we send ++ // a second pointer. If it gets overwritten, then we understand ++ // and try it again with 2 args, first one is count. ++ unsigned short count; ++ ok = TIFFGetField (m_tif, tag, &count, &s); ++ m_spec.attribute (name, string_view(s,count)); ++ } ++ else if (ok && s && *s) ++ m_spec.attribute (name, s); + } + + // Get a matrix tiff tag field and put it into extra_params +diff --git a/testsuite/misnamed-file/ref/out.txt b/testsuite/misnamed-file/ref/out.txt +index 69e836a..11c11e5 100644 +--- a/testsuite/misnamed-file/ref/out.txt ++++ b/testsuite/misnamed-file/ref/out.txt +@@ -9,7 +9,6 @@ misnamed.exr : 1000 x 1000, 4 channel, uint8 tiff + ResolutionUnit: "in" + Software: "GraphicsMagick 1.3.6 2009-07-25 Q8 http://www.GraphicsMagick.org/" + DocumentName: "g.tif" +- tiff:PageNumber: 0 + tiff:PhotometricInterpretation: 2 + tiff:PlanarConfiguration: 1 + planarconfig: "contig" +diff --git a/testsuite/tiff-suite/ref/out-alt.txt b/testsuite/tiff-suite/ref/out-alt.txt +index 61c14d1..8815b8f 100644 +--- a/testsuite/tiff-suite/ref/out-alt.txt ++++ b/testsuite/tiff-suite/ref/out-alt.txt +@@ -57,7 +57,6 @@ Reading ../../../../../libtiffpic/dscf0013.tif + PixelAspectRatio: 1 + FNumber: 3.4 + Exif:ExposureProgram: 2 (normal program) +- Exif:ISOSpeedRatings: 1 + Exif:DateTimeOriginal: "2004:11:10 00:00:31" + Exif:DateTimeDigitized: "2004:11:10 00:00:31" + Exif:ShutterSpeedValue: 6.5 (1/90 s) +@@ -102,7 +101,6 @@ Reading ../../../../../libtiffpic/fax2d.tif + YResolution: 98 + ResolutionUnit: "in" + Software: "fax2tiff" +- tiff:PageNumber: 1 + tiff:PhotometricInterpretation: 0 + tiff:PlanarConfiguration: 1 + planarconfig: "contig" +@@ -121,7 +119,6 @@ Reading ../../../../../libtiffpic/g3test.tif + YResolution: 98 + ResolutionUnit: "in" + Software: "fax2tiff" +- tiff:PageNumber: 1 + tiff:PhotometricInterpretation: 0 + tiff:PlanarConfiguration: 1 + planarconfig: "contig" +@@ -226,7 +223,6 @@ Reading ../../../../../libtiffpic/pc260001.tif + ExposureTime: 0.0125 + FNumber: 5.6 + Exif:ExposureProgram: 2 (normal program) +- Exif:ISOSpeedRatings: 1 + Exif:DateTimeOriginal: "2005:12:26 17:09:35" + Exif:DateTimeDigitized: "2005:12:26 17:09:35" + Exif:ExposureBiasValue: 0 +diff --git a/testsuite/tiff-suite/ref/out.txt b/testsuite/tiff-suite/ref/out.txt +index 5469a24..9549fda 100644 +--- a/testsuite/tiff-suite/ref/out.txt ++++ b/testsuite/tiff-suite/ref/out.txt +@@ -57,7 +57,6 @@ Reading ../../../../../libtiffpic/dscf0013.tif + PixelAspectRatio: 1 + FNumber: 3.4 + Exif:ExposureProgram: 2 (normal program) +- Exif:ISOSpeedRatings: 1 + Exif:DateTimeOriginal: "2004:11:10 00:00:31" + Exif:DateTimeDigitized: "2004:11:10 00:00:31" + Exif:ShutterSpeedValue: 6.5 (1/90 s) +@@ -102,7 +101,6 @@ Reading ../../../../../libtiffpic/fax2d.tif + YResolution: 98 + ResolutionUnit: "in" + Software: "fax2tiff" +- tiff:PageNumber: 1 + tiff:PhotometricInterpretation: 0 + tiff:PlanarConfiguration: 1 + planarconfig: "contig" +@@ -121,7 +119,6 @@ Reading ../../../../../libtiffpic/g3test.tif + YResolution: 98 + ResolutionUnit: "in" + Software: "fax2tiff" +- tiff:PageNumber: 1 + tiff:PhotometricInterpretation: 0 + tiff:PlanarConfiguration: 1 + planarconfig: "contig" +@@ -226,7 +223,6 @@ Reading ../../../../../libtiffpic/pc260001.tif + ExposureTime: 0.0125 + FNumber: 5.6 + Exif:ExposureProgram: 2 (normal program) +- Exif:ISOSpeedRatings: 1 + Exif:DateTimeOriginal: "2005:12:26 17:09:35" + Exif:DateTimeDigitized: "2005:12:26 17:09:35" + Exif:ExposureBiasValue: 0 diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-fix_read_tiles_prefix_bytes.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-fix_read_tiles_prefix_bytes.patch new file mode 100644 index 0000000000..0fc4b180ff --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-fix_read_tiles_prefix_bytes.patch @@ -0,0 +1,14 @@ +diff --git a/src/libOpenImageIO/imageinput.cpp b/src/libOpenImageIO/imageinput.cpp +index 8f05420..c87156c 100644 +--- a/src/libOpenImageIO/imageinput.cpp ++++ b/src/libOpenImageIO/imageinput.cpp +@@ -455,7 +455,8 @@ ImageInput::read_tiles (int xbegin, int xend, int ybegin, int yend, + stride_t full_tilewidthbytes = full_pixelsize * m_spec.tile_width; + stride_t full_tilewhbytes = full_tilewidthbytes * m_spec.tile_height; + stride_t full_tilebytes = full_tilewhbytes * m_spec.tile_depth; +- size_t prefix_bytes = m_spec.pixel_bytes (0,chbegin,true); ++ size_t prefix_bytes = native_data ? m_spec.pixel_bytes (0,chbegin,true) ++ : chbegin * format.size(); + std::vector buf; + for (int z = zbegin; z < zend; z += std::max(1,m_spec.tile_depth)) { + int zd = std::min (zend-z, m_spec.tile_depth); diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-libraw.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-libraw.patch new file mode 100644 index 0000000000..e5647655c5 --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-libraw.patch @@ -0,0 +1,89 @@ +--- oiio-Release-1.6.18/src/raw.imageio/rawinput.cpp.orig 2017-12-02 10:40:18.000000000 +0100 ++++ oiio-Release-1.6.18/src/raw.imageio/rawinput.cpp 2017-12-02 10:45:01.000000000 +0100 +@@ -30,9 +30,11 @@ + + #include "OpenImageIO/imageio.h" + #include "OpenImageIO/fmath.h" ++#include "OpenImageIO/strutil.h" + #include + #include /* time_t, struct tm, gmtime */ + #include ++#include + + + // This plugin utilises LibRaw: +@@ -132,6 +134,15 @@ + m_processor.imgdata.params.gamm[0] = 1.0; + m_processor.imgdata.params.gamm[1] = 1.0; + ++ // Use embedded color profile. Values mean: ++ // 0: do not use embedded color profile ++ // 1 (default): use embedded color profile (if present) for DNG files ++ // (always), for other files only if use_camera_wb is set. ++ // 3: use embedded color data (if present) regardless of white ++ // balance setting. ++ m_processor.imgdata.params.use_camera_matrix = ++ config.get_int_attribute("raw:use_camera_matrix", 1); ++ + // Check to see if the user has explicitly set the output colorspace primaries + std::string cs = config.get_string_attribute ("raw:ColorSpace", "sRGB"); + if (cs.size()) { +@@ -175,9 +186,10 @@ + } + + // Interpolation quality +- // note: LibRaw must be compiled with demosaic pack GPL2 to use +- // demosaic algorithms 5-9. It must be compiled with demosaic pack GPL3 for +- // algorithm 10. If either of these packs are not includeded, it will silently use option 3 - AHD ++ // note: LibRaw must be compiled with demosaic pack GPL2 to use demosaic ++ // algorithms 5-9. It must be compiled with demosaic pack GPL3 for ++ // algorithm 10 (AMAzE). If either of these packs are not included, it ++ // will silently use option 3 - AHD. + std::string demosaic = config.get_string_attribute ("raw:Demosaic"); + if (demosaic.size()) { + static const char *demosaic_algs[] = { "linear", +@@ -185,22 +197,26 @@ + "PPG", + "AHD", + "DCB", +- "Modified AHD", ++ "AHD-Mod", + "AFD", + "VCD", + "Mixed", + "LMMSE", + "AMaZE", ++#if LIBRAW_VERSION >= LIBRAW_MAKE_VERSION(0,16,0) ++ "DHT", ++ "AAHD", ++#endif + // Future demosaicing algorithms should go here + NULL + }; + size_t d; +- for (d=0; d < sizeof(demosaic_algs) / sizeof(demosaic_algs[0]); d++) +- if (demosaic == demosaic_algs[d]) ++ for (d=0; demosaic_algs[d] != NULL; d++) ++ if (Strutil::iequals (demosaic, demosaic_algs[d])) + break; +- if (demosaic == demosaic_algs[d]) ++ if (demosaic_algs[d] != NULL && demosaic == demosaic_algs[d]) + m_processor.imgdata.params.user_qual = d; +- else if (demosaic == "none") { ++ else if (Strutil::iequals (demosaic, "none")) { + #ifdef LIBRAW_DECODER_FLATFIELD + // See if we can access the Bayer patterned data for this raw file + libraw_decoder_info_t decoder_info; +@@ -223,9 +239,9 @@ + m_spec.channelnames.push_back("R"); + + // Also, any previously set demosaicing options are void, so remove them +- m_spec.erase_attribute("oiio:Colorspace", TypeDesc::STRING); +- m_spec.erase_attribute("raw:Colorspace", TypeDesc::STRING); +- m_spec.erase_attribute("raw:Exposure", TypeDesc::STRING); ++ m_spec.erase_attribute("oiio:Colorspace"); ++ m_spec.erase_attribute("raw:Colorspace"); ++ m_spec.erase_attribute("raw:Exposure"); + + } + else { diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-tiffposition.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-tiffposition.patch new file mode 100644 index 0000000000..18cee441f8 --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-1.6.18-tiffposition.patch @@ -0,0 +1,58 @@ +--- oiio-Release-1.6.18/src/tiff.imageio/tiffinput.cpp.orig 2016-11-01 08:32:47.000000000 +0100 ++++ oiio-Release-1.6.18/src/tiff.imageio/tiffinput.cpp 2017-12-02 10:47:13.000000000 +0100 +@@ -655,12 +655,13 @@ + float x = 0, y = 0; + TIFFGetField (m_tif, TIFFTAG_XPOSITION, &x); + TIFFGetField (m_tif, TIFFTAG_YPOSITION, &y); +- m_spec.x = (int)x; +- m_spec.y = (int)y; ++ float xdensity = 1, ydensity = 1; ++ TIFFGetField (m_tif, TIFFTAG_XRESOLUTION, &xdensity); ++ TIFFGetField (m_tif, TIFFTAG_YRESOLUTION, &ydensity); ++ ++ m_spec.x = (int)(x * xdensity + 0.5); ++ m_spec.y = (int)(y * ydensity + 0.5); + m_spec.z = 0; +- // FIXME? - TIFF spec describes the positions as in resolutionunit. +- // What happens if this is not unitless pixels? Are we interpreting +- // it all wrong? + + // Start by assuming the "full" (aka display) window is the same as the + // data window. That's what we'll stick to if there is no further +@@ -911,8 +912,6 @@ + case RESUNIT_INCH : m_spec.attribute ("ResolutionUnit", "in"); break; + case RESUNIT_CENTIMETER : m_spec.attribute ("ResolutionUnit", "cm"); break; + } +- float xdensity = m_spec.get_float_attribute ("XResolution", 0.0f); +- float ydensity = m_spec.get_float_attribute ("YResolution", 0.0f); + if (xdensity && ydensity) + m_spec.attribute ("PixelAspectRatio", ydensity/xdensity); + +--- oiio-Release-1.6.18/src/tiff.imageio/tiffoutput.cpp.orig 2016-11-01 08:32:47.000000000 +0100 ++++ oiio-Release-1.6.18/src/tiff.imageio/tiffoutput.cpp 2017-12-02 10:47:13.000000000 +0100 +@@ -288,8 +288,14 @@ + + // N.B. Clamp position at 0... TIFF is internally incapable of having + // negative origin. +- TIFFSetField (m_tif, TIFFTAG_XPOSITION, (float)std::max (0, m_spec.x)); +- TIFFSetField (m_tif, TIFFTAG_YPOSITION, (float)std::max (0, m_spec.y)); ++ float X_density = m_spec.get_float_attribute ("XResolution", 1.0f); ++ float Y_density = m_spec.get_float_attribute ("YResolution", 1.0f); ++ if (X_density <= 0.) ++ X_density = 1; ++ if (Y_density <= 0.) ++ Y_density = 1; ++ TIFFSetField (m_tif, TIFFTAG_XPOSITION, std::max (0.f, m_spec.x / X_density)); ++ TIFFSetField (m_tif, TIFFTAG_YPOSITION, std::max (0.f, m_spec.y / Y_density)); + + TIFFSetField (m_tif, TIFFTAG_IMAGEWIDTH, m_spec.width); + TIFFSetField (m_tif, TIFFTAG_IMAGELENGTH, m_spec.height); +@@ -497,8 +503,6 @@ + + // Deal with missing XResolution or YResolution, or a PixelAspectRatio + // that contradicts them. +- float X_density = m_spec.get_float_attribute ("XResolution", 1.0f); +- float Y_density = m_spec.get_float_attribute ("YResolution", 1.0f); + float aspect = m_spec.get_float_attribute ("PixelAspectRatio", 1.0f); + if (X_density < 1.0f || Y_density < 1.0f || aspect*X_density != Y_density) { + if (X_density < 1.0f || Y_density < 1.0f) { diff --git a/tools/MacPorts/graphics/openimageio16/files/oiio-nothreads.patch b/tools/MacPorts/graphics/openimageio16/files/oiio-nothreads.patch new file mode 100644 index 0000000000..9ebe46e798 --- /dev/null +++ b/tools/MacPorts/graphics/openimageio16/files/oiio-nothreads.patch @@ -0,0 +1,115 @@ +diff --git a/src/include/OpenImageIO/imagebufalgo_util.h b/src/include/OpenImageIO/imagebufalgo_util.h +index b92a7bb..30539af 100644 +--- a/src/include/OpenImageIO/imagebufalgo_util.h ++++ b/src/include/OpenImageIO/imagebufalgo_util.h +@@ -85,6 +85,9 @@ template + void + parallel_image (Func f, ROI roi, int nthreads=0) + { ++#ifdef NOTHREADS ++ f (roi); ++#else // !NOTHREADS + // Special case: threads <= 0 means to use the "threads" attribute + if (nthreads <= 0) + OIIO::getattribute ("threads", nthreads); +@@ -107,6 +110,7 @@ parallel_image (Func f, ROI roi, int nthreads=0) + } + threads.join_all (); + } ++#endif // !NOTHREADS + } + + +diff --git a/src/include/OpenImageIO/thread.h b/src/include/OpenImageIO/thread.h +index 3d0737c..d4ca7df 100644 +--- a/src/include/OpenImageIO/thread.h ++++ b/src/include/OpenImageIO/thread.h +@@ -834,6 +834,7 @@ typedef spin_rw_mutex::write_lock_guard spin_rw_write_lock; + + + ++#ifndef NOTHREADS + /// Simple thread group class. This is just as good as boost::thread_group, + /// for the limited functionality that we use. + class thread_group { +@@ -871,6 +872,7 @@ private: + mutex m_mutex; + std::vector m_threads; + }; ++#endif // NOTHREADS + + + OIIO_NAMESPACE_END +diff --git a/src/libOpenImageIO/imagebufalgo_compare.cpp b/src/libOpenImageIO/imagebufalgo_compare.cpp +index e536952..2cb8aa5 100644 +--- a/src/libOpenImageIO/imagebufalgo_compare.cpp ++++ b/src/libOpenImageIO/imagebufalgo_compare.cpp +@@ -832,6 +832,11 @@ ImageBufAlgo::computePixelHashSHA1 (const ImageBuf &src, + if (blocksize <= 0 || blocksize >= roi.height()) + return simplePixelHashSHA1 (src, extrainfo, roi); + ++#ifdef NOTHREADS ++ int nblocks = 1; ++ std::vector results (1); ++ sha1_hasher (&src, roi, blocksize, &results[0], 0); ++#else // !NOTHREADS + // Request for 0 threads means "use the OIIO global thread count" + if (nthreads <= 0) + OIIO::getattribute ("threads", nthreads); +@@ -856,6 +861,7 @@ ImageBufAlgo::computePixelHashSHA1 (const ImageBuf &src, + } + threads.join_all (); + } ++#endif // !NOTHREADS + + #ifdef USE_OPENSSL + // If OpenSSL was available at build time, use its SHA-1 +diff --git a/src/testtex/testtex.cpp b/src/testtex/testtex.cpp +index 8cff8a9..11ac603 100644 +--- a/src/testtex/testtex.cpp ++++ b/src/testtex/testtex.cpp +@@ -180,7 +180,9 @@ getargs (int argc, const char *argv[]) + "--derivs", &test_derivs, "Test returning derivatives of texture lookups", + "--resetstats", &resetstats, "Print and reset statistics on each iteration", + "--testhash", &testhash, "Test the tile hashing function", ++#ifndef NOTHREADS + "--threadtimes %d", &threadtimes, "Do thread timings (arg = workload profile)", ++#endif // NOTHREADS + "--trials %d", &ntrials, "Number of trials for timings", + "--wedge", &wedge, "Wedge test", + "--testicwrite %d", &testicwrite, "Test ImageCache write ability (1=seeded, 2=generated)", +@@ -825,6 +827,7 @@ test_hash () + + + ++#ifndef NOTHREADS + static const char *workload_names[] = { + /*0*/ "None", + /*1*/ "Everybody accesses the same spot in one file (handles)", +@@ -961,6 +964,7 @@ launch_tex_threads (int numthreads, int iterations) + ASSERT ((int)threads.size() == numthreads); + threads.join_all (); + } ++#endif // NOTHREADS + + + +@@ -1140,6 +1144,7 @@ main (int argc, const char *argv[]) + xform = persp * rot * trans * scale; + xform.invert(); + ++#ifndef NOTHREADS + if (threadtimes) { + // If the --iters flag was used, do that number of iterations total + // (divided among the threads). If not supplied (iters will be 1), +@@ -1172,7 +1177,9 @@ main (int argc, const char *argv[]) + } + std::cout << "\n"; + +- } else if (iters > 0 && filenames.size()) { ++ } else ++#endif // NOTHREADS ++ if (iters > 0 && filenames.size()) { + ustring filename (filenames[0]); + test_gettextureinfo (filenames[0]); + const char *texturetype = "Plain Texture";