Turns out just merging the yaml-cpp commit from upstream wasn't enough, it

depended on other changes.  This led to blender segfaults at startup.  Update
to a full snapshot of upstream's master branch to fix the issue.

Distfile mirrored by abieber@, thanks!
This commit is contained in:
pascal 2014-11-21 17:25:49 +00:00
parent ad5defa998
commit 872182301d
11 changed files with 15 additions and 3771 deletions

View File

@ -1,15 +1,12 @@
# $OpenBSD: Makefile,v 1.3 2014/09/03 11:17:59 pascal Exp $
# $OpenBSD: Makefile,v 1.4 2014/11/21 17:25:49 pascal Exp $
COMMENT = color management library
GH_ACCOUNT = imageworks
GH_PROJECT = OpenColorIO
GH_TAGNAME = v1.0.9
GH_COMMIT = 2b12063e22dbdbff927b5a59d04fe1e30e90c1fe
DISTNAME = opencolorio-${GH_TAGNAME:S/v//}
REVISION = 0
V = 20140911
DISTNAME = OpenColorIO-$V
PKGNAME = opencolorio-$V
SHARED_LIBS += OpenColorIO 0.0 # 1.0
SHARED_LIBS += OpenColorIO 1.0 # 1.0
CATEGORIES = graphics
@ -22,6 +19,8 @@ PERMIT_PACKAGE_CDROM = Yes
WANTLIB += m pthread stdc++ tinyxml yaml-cpp
MASTER_SITES = http://deftly.net/
MODULES = devel/cmake \
lang/python
LIB_DEPENDS = textproc/tinyxml \
@ -39,6 +38,8 @@ CONFIGURE_ARGS += -DPYTHON="${MODPY_BIN}" \
NO_TEST = Yes
WRKDIST = ${WRKDIR}/OpenColorIO-master
CFLAGS = -pthread
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (opencolorio-1.0.9.tar.gz) = J8geaRwVdTzStWDCykvVZ5pgwjUO7dQ8mdRMol1l6n8=
SIZE (opencolorio-1.0.9.tar.gz) = 13620332
SHA256 (OpenColorIO-20140911.tar.gz) = d1Y6L8peE+SuqhBv/lA5Km70hjRlyszFOuVFmNzlnpQ=
SIZE (OpenColorIO-20140911.tar.gz) = 13742525

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-CMakeLists_txt,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- CMakeLists.txt.orig Wed Oct 9 00:59:34 2013
+++ CMakeLists.txt Wed Aug 27 13:51:26 2014
@@ -225,13 +225,15 @@ else(USE_EXTERNAL_YAML)
endif()
endif(USE_EXTERNAL_YAML)
+if(YAML_CPP_VERSION VERSION_LESS "0.5.0")
+ set(YAML_CPP_COMPILE_FLAGS "-DOLDYAML")
+endif()
-
###############################################################################
### Externals ###
set(EXTERNAL_INCLUDE_DIRS ${EXTERNAL_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/ext/dist/include)
-set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL")
+set(EXTERNAL_COMPILE_FLAGS "-DTIXML_USE_STL ${YAML_CPP_COMPILE_FLAGS}")
if(CMAKE_COMPILER_IS_GNUCXX)

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-export_OpenColorIO_OpenColorABI_h_in,v 1.1.1.1 2014/03/25 10:33:33 pascal Exp $
--- export/OpenColorIO/OpenColorABI.h.in.orig Wed Oct 9 00:59:34 2013
+++ export/OpenColorIO/OpenColorABI.h.in Mon Mar 24 22:57:22 2014
@@ -65,7 +65,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
$OpenBSD: patch-export_OpenColorIO_OpenColorABI_h_in,v 1.2 2014/11/21 17:25:49 pascal Exp $
--- export/OpenColorIO/OpenColorABI.h.in.orig Thu Sep 11 21:08:18 2014
+++ export/OpenColorIO/OpenColorABI.h.in Fri Nov 21 13:29:20 2014
@@ -69,7 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
// If supported, define OCIOEXPORT, OCIOHIDDEN
// (used to choose which symbols to export from OpenColorIO)

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-export_OpenColorIO_OpenColorIO_h,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- export/OpenColorIO/OpenColorIO.h.orig Wed Oct 9 00:59:34 2013
+++ export/OpenColorIO/OpenColorIO.h Wed Aug 27 13:51:26 2014
@@ -279,6 +279,12 @@ OCIO_NAMESPACE_ENTER
const char * getEnvironmentVarDefault(const char * name) const;
//!cpp:function::
void clearEnvironmentVars();
+ //!cpp:function::
+ void setEnvironmentMode(EnvironmentMode mode);
+ //!cpp:function::
+ EnvironmentMode getEnvironmentMode() const;
+ //!cpp:function::
+ void loadEnvironment();
//!cpp:function::
const char * getSearchPath() const;

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-ext_yaml-cpp-0_5_1_patch,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- ext/yaml-cpp-0.5.1.patch.orig Wed Aug 27 13:51:26 2014
+++ ext/yaml-cpp-0.5.1.patch Wed Aug 27 13:51:26 2014
@@ -0,0 +1,12 @@
+diff -Naur yaml-cpp-0.5.1.orig/CMakeLists.txt yaml-cpp-0.5.1/CMakeLists.txt
+--- yaml-cpp-0.5.1.orig/CMakeLists.txt 2014-01-30 09:45:54.000000000 +0000
++++ yaml-cpp-0.5.1/CMakeLists.txt 2014-01-30 09:51:04.000000000 +0000
+@@ -140,7 +140,7 @@
+ set(GCC_EXTRA_OPTIONS "${GCC_EXTRA_OPTIONS} ${FLAG_TESTED}")
+ endif()
+ #
+- set(CMAKE_CXX_FLAGS "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS}")
++ set(CMAKE_CXX_FLAGS "-Wall ${GCC_EXTRA_OPTIONS} -pedantic -Wno-long-long -fPIC -fvisibility-inlines-hidden -fvisibility=hidden ${CMAKE_CXX_FLAGS}")
+ #
+ add_custom_target(debuggable $(MAKE) clean
+ COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Debug ${CMAKE_SOURCE_DIR}

View File

@ -1,633 +0,0 @@
$OpenBSD: patch-src_core_Config_cpp,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- src/core/Config.cpp.orig Wed Oct 9 00:59:34 2013
+++ src/core/Config.cpp Wed Aug 27 13:51:26 2014
@@ -40,6 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
#include "HashUtils.h"
#include "Logging.h"
#include "LookParse.h"
+#include "Display.h"
#include "MathUtils.h"
#include "Mutex.h"
#include "OpBuilders.h"
@@ -208,7 +209,6 @@ OCIO_NAMESPACE_ENTER
if(csname.empty()) return false;
std::string csnamelower = pystring::lower(csname);
-
for(unsigned int i = 0; i < colorspaces.size(); ++i)
{
if(csnamelower == pystring::lower(colorspaces[i]->getName()))
@@ -220,184 +220,7 @@ OCIO_NAMESPACE_ENTER
return false;
}
-
-
- // Displays
- struct View
- {
- std::string name;
- std::string colorspace;
- std::string looks;
- View() { }
-
- View(const std::string & name_,
- const std::string & colorspace_,
- const std::string & looksList_) :
- name(name_),
- colorspace(colorspace_),
- looks(looksList_)
- { }
- };
-
- typedef std::vector<View> ViewVec;
- typedef std::map<std::string, ViewVec> DisplayMap; // (display name : ViewVec)
-
- void operator >> (const YAML::Node& node, View& v)
- {
- if(node.Tag() != "View")
- return;
-
- std::string key, stringval;
-
- for (YAML::Iterator iter = node.begin();
- iter != node.end();
- ++iter)
- {
- iter.first() >> key;
-
- if(key == "name")
- {
- if (iter.second().Type() != YAML::NodeType::Null &&
- iter.second().Read<std::string>(stringval))
- v.name = stringval;
- }
- else if(key == "colorspace")
- {
- if (iter.second().Type() != YAML::NodeType::Null &&
- iter.second().Read<std::string>(stringval))
- v.colorspace = stringval;
- }
- else if(key == "looks" || key == "look")
- {
- if (iter.second().Type() != YAML::NodeType::Null &&
- iter.second().Read<std::string>(stringval))
- v.looks = stringval;
- }
- else
- {
- LogUnknownKeyWarning(node.Tag(), iter.first());
- }
- }
-
- if(v.name.empty())
- {
- throw Exception("View does not specify 'name'.");
- }
- if(v.colorspace.empty())
- {
- std::ostringstream os;
- os << "View '" << v.name << "' ";
- os << "does not specify colorspace.";
- throw Exception(os.str().c_str());
- }
- }
-
- YAML::Emitter& operator << (YAML::Emitter& out, View view)
- {
- out << YAML::VerbatimTag("View");
- out << YAML::Flow;
- out << YAML::BeginMap;
- out << YAML::Key << "name" << YAML::Value << view.name;
- out << YAML::Key << "colorspace" << YAML::Value << view.colorspace;
- if(!view.looks.empty()) out << YAML::Key << "looks" << YAML::Value << view.looks;
- out << YAML::EndMap;
- return out;
- }
-
- DisplayMap::iterator find_display(DisplayMap & displays, const std::string & display)
- {
- for(DisplayMap::iterator iter = displays.begin();
- iter != displays.end();
- ++iter)
- {
- if(StrEqualsCaseIgnore(display, iter->first)) return iter;
- }
- return displays.end();
- }
-
- DisplayMap::const_iterator find_display_const(const DisplayMap & displays, const std::string & display)
- {
- for(DisplayMap::const_iterator iter = displays.begin();
- iter != displays.end();
- ++iter)
- {
- if(StrEqualsCaseIgnore(display, iter->first)) return iter;
- }
- return displays.end();
- }
-
- int find_view(const ViewVec & vec, const std::string & name)
- {
- for(unsigned int i=0; i<vec.size(); ++i)
- {
- if(StrEqualsCaseIgnore(name, vec[i].name)) return i;
- }
- return -1;
- }
-
- void AddDisplay(DisplayMap & displays,
- const std::string & display,
- const std::string & view,
- const std::string & colorspace,
- const std::string & looks)
- {
- DisplayMap::iterator iter = find_display(displays, display);
- if(iter == displays.end())
- {
- ViewVec views;
- views.push_back( View(view, colorspace, looks) );
- displays[display] = views;
- }
- else
- {
- ViewVec & views = iter->second;
- int index = find_view(views, view);
- if(index<0)
- {
- views.push_back( View(view, colorspace, looks) );
- }
- else
- {
- views[index].colorspace = colorspace;
- views[index].looks = looks;
- }
- }
- }
-
- void ComputeDisplays(StringVec & displayCache,
- const DisplayMap & displays,
- const StringVec & activeDisplays,
- const StringVec & activeDisplaysEnvOverride)
- {
- displayCache.clear();
-
- StringVec displayMasterList;
- for(DisplayMap::const_iterator iter = displays.begin();
- iter != displays.end();
- ++iter)
- {
- displayMasterList.push_back(iter->first);
- }
-
- // Apply the env override if it's not empty.
- if(!activeDisplaysEnvOverride.empty())
- {
- displayCache = IntersectStringVecsCaseIgnore(displayMasterList, activeDisplaysEnvOverride);
- if(!displayCache.empty()) return;
- }
- // Otherwise, aApply the active displays if it's not empty.
- else if(!activeDisplays.empty())
- {
- displayCache = IntersectStringVecsCaseIgnore(displayMasterList, activeDisplays);
- if(!displayCache.empty()) return;
- }
-
- displayCache = displayMasterList;
- }
-
-
-
} // namespace
class Config::Impl
@@ -431,6 +254,8 @@ OCIO_NAMESPACE_ENTER
mutable StringMap cacheids_;
mutable std::string cacheidnocontext_;
+ OCIOYaml io_;
+
Impl() :
context_(Context::Create()),
strictParsing_(true),
@@ -497,8 +322,6 @@ OCIO_NAMESPACE_ENTER
return *this;
}
- void load(std::istream & istream, const char * name);
-
// Any time you modify the state of the config, you must call this
// to reset internal cache states. You also should do this in a
// thread safe manner by acquiring the cacheidMutex_;
@@ -536,7 +359,7 @@ OCIO_NAMESPACE_ENTER
istream.str(INTERNAL_RAW_PROFILE);
ConfigRcPtr config = Config::Create();
- config->getImpl()->load(istream, "");
+ config->getImpl()->io_.open(istream, config);
return config;
}
@@ -551,14 +374,14 @@ OCIO_NAMESPACE_ENTER
}
ConfigRcPtr config = Config::Create();
- config->getImpl()->load(istream, filename);
+ config->getImpl()->io_.open(istream, config, filename);
return config;
}
ConstConfigRcPtr Config::CreateFromStream(std::istream & istream)
{
ConfigRcPtr config = Config::Create();
- config->getImpl()->load(istream, "");
+ config->getImpl()->io_.open(istream, config);
return config;
}
@@ -893,6 +716,27 @@ OCIO_NAMESPACE_ENTER
getImpl()->resetCacheIDs();
}
+ void Config::setEnvironmentMode(EnvironmentMode mode)
+ {
+ getImpl()->context_->setEnvironmentMode(mode);
+
+ AutoMutex lock(getImpl()->cacheidMutex_);
+ getImpl()->resetCacheIDs();
+ }
+
+ EnvironmentMode Config::getEnvironmentMode() const
+ {
+ return getImpl()->context_->getEnvironmentMode();
+ }
+
+ void Config::loadEnvironment()
+ {
+ getImpl()->context_->loadEnvironment();
+
+ AutoMutex lock(getImpl()->cacheidMutex_);
+ getImpl()->resetCacheIDs();
+ }
+
const char * Config::getSearchPath() const
{
return getImpl()->context_->getSearchPath();
@@ -1647,60 +1491,7 @@ OCIO_NAMESPACE_ENTER
{
try
{
- YAML::Emitter out;
- out << YAML::Block;
- out << YAML::BeginMap;
- out << YAML::Key << "ocio_profile_version" << YAML::Value << 1;
- out << YAML::Newline;
- if(getImpl()->env_.size() > 0) {
- out << YAML::Key << "environment";
- out << YAML::Value << getImpl()->env_;
- out << YAML::Newline;
- }
- out << YAML::Key << "search_path" << YAML::Value << getImpl()->context_->getSearchPath();
- out << YAML::Key << "strictparsing" << YAML::Value << getImpl()->strictParsing_;
- out << YAML::Key << "luma" << YAML::Value << YAML::Flow << getImpl()->defaultLumaCoefs_;
-
- if(getImpl()->description_ != "")
- {
- out << YAML::Newline;
- out << YAML::Key << "description";
- out << YAML::Value << getImpl()->description_;
- }
-
- // Roles
- out << YAML::Newline;
- out << YAML::Key << "roles";
- out << YAML::Value << getImpl()->roles_;
-
- // Displays
- out << YAML::Newline;
- out << YAML::Key << "displays";
- out << YAML::Value << getImpl()->displays_;
- out << YAML::Newline;
- out << YAML::Key << "active_displays";
- out << YAML::Value << YAML::Flow << getImpl()->activeDisplays_;
- out << YAML::Key << "active_views";
- out << YAML::Value << YAML::Flow << getImpl()->activeViews_;
-
- // Looks
- if(!getImpl()->looksList_.empty())
- {
- out << YAML::Newline;
- out << YAML::Key << "looks";
- out << YAML::Value << getImpl()->looksList_;
- }
-
- // ColorSpaces
- {
- out << YAML::Newline;
- out << YAML::Key << "colorspaces";
- out << YAML::Value << getImpl()->colorspaces_;
- }
-
- out << YAML::EndMap;
-
- os << out.c_str();
+ getImpl()->io_.write(os, this);
}
catch( const std::exception & e)
{
@@ -1710,246 +1501,6 @@ OCIO_NAMESPACE_ENTER
}
}
- void Config::Impl::load(std::istream & istream, const char * filename)
- {
- try
- {
- YAML::Parser parser(istream);
- YAML::Node node;
- parser.GetNextDocument(node);
-
- // check profile version
- int profile_version = 0;
- if(node.FindValue("ocio_profile_version") == NULL)
- {
- std::ostringstream os;
- os << "The specified file ";
- os << "does not appear to be an OCIO configuration.";
- throw Exception (os.str().c_str());
- }
-
- node["ocio_profile_version"] >> profile_version;
- if(profile_version > 1)
- {
- std::ostringstream os;
- os << "This .ocio config ";
- if(filename && *filename)
- {
- os << " '" << filename << "' ";
- }
- os << "is version " << profile_version << ". ";
- os << "This version of the OpenColorIO library (" << OCIO_VERSION ") ";
- os << "is not known to be able to load this profile. ";
- os << "An attempt will be made, but there are no guarantees that the ";
- os << "results will be accurate. Continue at your own risk.";
- LogWarning(os.str());
- }
-
-
- std::string key, stringval;
- bool boolval = false;
- EnvironmentMode mode = ENV_ENVIRONMENT_LOAD_ALL;
-
- for (YAML::Iterator iter = node.begin();
- iter != node.end();
- ++iter)
- {
- iter.first() >> key;
-
- if(key == "ocio_profile_version") { } // Already handled above.
- else if(key == "environment")
- {
- mode = ENV_ENVIRONMENT_LOAD_PREDEFINED;
- const YAML::Node& environment = iter.second();
- if(environment.Type() != YAML::NodeType::Map)
- {
- std::ostringstream os;
- os << "'environment' field needs to be a (name: key) map.";
- throw Exception(os.str().c_str());
- }
- for (YAML::Iterator it = environment.begin();
- it != environment.end(); ++it)
- {
- std::string k, v;
- it.first() >> k;
- it.second() >> v;
- env_[k] = v;
- context_->setStringVar(k.c_str(), v.c_str());
- }
- }
- else if(key == "search_path" || key == "resource_path")
- {
- if (iter.second().Type() != YAML::NodeType::Null &&
- iter.second().Read<std::string>(stringval))
- context_->setSearchPath(stringval.c_str());
- }
- else if(key == "strictparsing")
- {
- if (iter.second().Type() != YAML::NodeType::Null &&
- iter.second().Read<bool>(boolval))
- strictParsing_ = boolval;
- }
- else if(key == "description")
- {
- if (iter.second().Type() != YAML::NodeType::Null &&
- iter.second().Read<std::string>(stringval))
- description_ = stringval;
- }
- else if(key == "luma")
- {
- std::vector<float> val;
- if (iter.second().Type() != YAML::NodeType::Null)
- {
- iter.second() >> val;
- if(val.size() != 3)
- {
- std::ostringstream os;
- os << "'luma' field must be 3 ";
- os << "floats. Found '" << val.size() << "'.";
- throw Exception(os.str().c_str());
- }
- defaultLumaCoefs_ = val;
- }
- }
- else if(key == "roles")
- {
- const YAML::Node& roles = iter.second();
- if(roles.Type() != YAML::NodeType::Map)
- {
- std::ostringstream os;
- os << "'roles' field needs to be a (name: key) map.";
- throw Exception(os.str().c_str());
- }
- for (YAML::Iterator it = roles.begin();
- it != roles.end(); ++it)
- {
- std::string k, v;
- it.first() >> k;
- it.second() >> v;
- roles_[pystring::lower(k)] = v;
- }
- }
- else if(key == "displays")
- {
- if (iter.second().Type() != YAML::NodeType::Null)
- {
- iter.second() >> displays_;
- }
- }
- else if(key == "active_displays")
- {
- if (iter.second().Type() != YAML::NodeType::Null)
- {
- iter.second() >> activeDisplays_;
- }
- }
- else if(key == "active_views")
- {
- if (iter.second().Type() != YAML::NodeType::Null)
- {
- iter.second() >> activeViews_;
- }
- }
- else if(key == "colorspaces")
- {
- const YAML::Node& colorspaces = iter.second();
-
- if(colorspaces.Type() != YAML::NodeType::Sequence)
- {
- std::ostringstream os;
- os << "'colorspaces' field needs to be a (- !<ColorSpace>) list.";
- throw Exception(os.str().c_str());
- }
-
- for(unsigned i = 0; i < colorspaces.size(); ++i)
- {
- if(colorspaces[i].Tag() == "ColorSpace")
- {
- ColorSpaceRcPtr cs = ColorSpace::Create();
- colorspaces[i] >> cs;
- colorspaces_.push_back( cs );
- }
- else
- {
- std::ostringstream os;
- os << "Unknown element found in colorspaces:";
- os << colorspaces[i].Tag() << ". Only ColorSpace(s)";
- os << " currently handled.";
- LogWarning(os.str());
- }
- }
- }
- else if(key == "looks")
- {
- const YAML::Node& looks = iter.second();
-
- if(looks.Type() != YAML::NodeType::Sequence)
- {
- std::ostringstream os;
- os << "'looks' field needs to be a (- !<Look>) list.";
- throw Exception(os.str().c_str());
- }
-
- for(unsigned i = 0; i < looks.size(); ++i)
- {
- if(looks[i].Tag() == "Look")
- {
- LookRcPtr look = Look::Create();
- looks[i] >> look;
- looksList_.push_back( look );
- }
- else
- {
- std::ostringstream os;
- os << "Unknown element found in looks:";
- os << looks[i].Tag() << ". Only Look(s)";
- os << " currently handled.";
- LogWarning(os.str());
- }
- }
- }
- else
- {
- LogUnknownKeyWarning("profile", iter.first());
- }
- }
-
- if(filename)
- {
- std::string realfilename = pystring::os::path::abspath(filename);
- std::string configrootdir = pystring::os::path::dirname(realfilename);
- context_->setWorkingDir(configrootdir.c_str());
- }
-
- context_->setEnvironmentMode(mode);
- context_->loadEnvironment();
-
- if(mode == ENV_ENVIRONMENT_LOAD_ALL)
- {
- std::ostringstream os;
- os << "This .ocio config ";
- if(filename && *filename)
- {
- os << " '" << filename << "' ";
- }
- os << "has no environment section defined. The default behaviour is to ";
- os << "load all environment variables (" << context_->getNumStringVars() << ")";
- os << ", which reduces the efficiency of OCIO's caching. Considering ";
- os << "predefining the environment variables used.";
- LogDebug(os.str());
- }
-
- }
- catch( const std::exception & e)
- {
- std::ostringstream os;
- os << "Error: Loading the OCIO profile ";
- if(filename) os << "'" << filename << "' ";
- os << "failed. " << e.what();
- throw Exception(os.str().c_str());
- }
- }
-
void Config::Impl::resetCacheIDs()
{
cacheids_.clear();
@@ -2287,9 +1838,7 @@ OIIO_ADD_TEST(Config, SanityCheck)
std::istringstream is;
is.str(SIMPLE_PROFILE);
OCIO::ConstConfigRcPtr config;
- OIIO_CHECK_NO_THOW(config = OCIO::Config::CreateFromStream(is));
-
- OIIO_CHECK_THOW(config->sanityCheck(), OCIO::Exception);
+ OIIO_CHECK_THOW(config = OCIO::Config::CreateFromStream(is), OCIO::Exception);
}
{
@@ -2330,8 +1879,6 @@ OIIO_ADD_TEST(Config, EnvCheck)
"colorspaces:\n"
" - !<ColorSpace>\n"
" name: raw\n"
- " - !<ColorSpace>\n"
- " name: raw\n"
"strictparsing: false\n"
"roles:\n"
" default: raw\n"
@@ -2345,8 +1892,6 @@ OIIO_ADD_TEST(Config, EnvCheck)
"colorspaces:\n"
" - !<ColorSpace>\n"
" name: raw\n"
- " - !<ColorSpace>\n"
- " name: raw\n"
"strictparsing: false\n"
"roles:\n"
" default: raw\n"
@@ -2370,7 +1915,6 @@ OIIO_ADD_TEST(Config, EnvCheck)
"testbarchedder") == 0);
OIIO_CHECK_ASSERT(strcmp(config->getCurrentContext()->resolveStringVar("${SHOW}"),
"bar") == 0);
- OIIO_CHECK_THOW(config->sanityCheck(), OCIO::Exception);
OIIO_CHECK_ASSERT(strcmp(config->getEnvironmentVarDefault("SHOW"), "super") == 0);
OCIO::ConfigRcPtr edit = config->createEditableCopy();
@@ -2402,6 +1946,10 @@ OIIO_ADD_TEST(Config, EnvCheck)
OIIO_CHECK_ASSERT(strcmp(noenv->getCurrentContext()->resolveStringVar("${TASK}"),
"lighting") == 0);
OCIO::SetLoggingLevel(loglevel);
+
+ OIIO_CHECK_EQUAL(edit->getEnvironmentMode(), OCIO::ENV_ENVIRONMENT_LOAD_PREDEFINED);
+ edit->setEnvironmentMode(OCIO::ENV_ENVIRONMENT_LOAD_ALL);
+ OIIO_CHECK_EQUAL(edit->getEnvironmentMode(), OCIO::ENV_ENVIRONMENT_LOAD_ALL);
}
}

View File

@ -1,150 +0,0 @@
$OpenBSD: patch-src_core_Display_cpp,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- src/core/Display.cpp.orig Wed Aug 27 13:51:26 2014
+++ src/core/Display.cpp Wed Aug 27 13:51:26 2014
@@ -0,0 +1,145 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include <string>
+
+#include <OpenColorIO/OpenColorIO.h>
+
+#include "Display.h"
+#include "ParseUtils.h"
+
+OCIO_NAMESPACE_ENTER
+{
+
+ DisplayMap::iterator find_display(DisplayMap & displays, const std::string & display)
+ {
+ for(DisplayMap::iterator iter = displays.begin();
+ iter != displays.end();
+ ++iter)
+ {
+ if(StrEqualsCaseIgnore(display, iter->first)) return iter;
+ }
+ return displays.end();
+ }
+
+ DisplayMap::const_iterator find_display_const(const DisplayMap & displays, const std::string & display)
+ {
+ for(DisplayMap::const_iterator iter = displays.begin();
+ iter != displays.end();
+ ++iter)
+ {
+ if(StrEqualsCaseIgnore(display, iter->first)) return iter;
+ }
+ return displays.end();
+ }
+
+ int find_view(const ViewVec & vec, const std::string & name)
+ {
+ for(unsigned int i=0; i<vec.size(); ++i)
+ {
+ if(StrEqualsCaseIgnore(name, vec[i].name)) return i;
+ }
+ return -1;
+ }
+
+ void AddDisplay(DisplayMap & displays,
+ const std::string & display,
+ const std::string & view,
+ const std::string & colorspace,
+ const std::string & looks)
+ {
+ DisplayMap::iterator iter = find_display(displays, display);
+ if(iter == displays.end())
+ {
+ ViewVec views;
+ views.push_back( View(view, colorspace, looks) );
+ displays[display] = views;
+ }
+ else
+ {
+ ViewVec & views = iter->second;
+ int index = find_view(views, view);
+ if(index<0)
+ {
+ views.push_back( View(view, colorspace, looks) );
+ }
+ else
+ {
+ views[index].colorspace = colorspace;
+ views[index].looks = looks;
+ }
+ }
+ }
+
+ void ComputeDisplays(StringVec & displayCache,
+ const DisplayMap & displays,
+ const StringVec & activeDisplays,
+ const StringVec & activeDisplaysEnvOverride)
+ {
+ displayCache.clear();
+
+ StringVec displayMasterList;
+ for(DisplayMap::const_iterator iter = displays.begin();
+ iter != displays.end();
+ ++iter)
+ {
+ displayMasterList.push_back(iter->first);
+ }
+
+ // Apply the env override if it's not empty.
+ if(!activeDisplaysEnvOverride.empty())
+ {
+ displayCache = IntersectStringVecsCaseIgnore(displayMasterList, activeDisplaysEnvOverride);
+ if(!displayCache.empty()) return;
+ }
+ // Otherwise, aApply the active displays if it's not empty.
+ else if(!activeDisplays.empty())
+ {
+ displayCache = IntersectStringVecsCaseIgnore(displayMasterList, activeDisplays);
+ if(!displayCache.empty()) return;
+ }
+
+ displayCache = displayMasterList;
+ }
+
+}
+OCIO_NAMESPACE_EXIT
+
+///////////////////////////////////////////////////////////////////////////////
+
+#ifdef OCIO_UNIT_TEST
+
+namespace OCIO = OCIO_NAMESPACE;
+#include "UnitTest.h"
+
+OIIO_ADD_TEST(Display, Basic)
+{
+
+}
+
+#endif // OCIO_UNIT_TEST
\ No newline at end of file

View File

@ -1,90 +0,0 @@
$OpenBSD: patch-src_core_Display_h,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- src/core/Display.h.orig Wed Aug 27 13:51:26 2014
+++ src/core/Display.h Wed Aug 27 13:51:26 2014
@@ -0,0 +1,85 @@
+/*
+Copyright (c) 2003-2010 Sony Pictures Imageworks Inc., et al.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+* Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+* Neither the name of Sony Pictures Imageworks nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef INCLUDED_OCIO_DISPLAY_H
+#define INCLUDED_OCIO_DISPLAY_H
+
+#include <OpenColorIO/OpenColorIO.h>
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "PrivateTypes.h"
+
+OCIO_NAMESPACE_ENTER
+{
+
+ // Displays
+ struct View
+ {
+ std::string name;
+ std::string colorspace;
+ std::string looks;
+
+ View() { }
+
+ View(const std::string & name_,
+ const std::string & colorspace_,
+ const std::string & looksList_) :
+ name(name_),
+ colorspace(colorspace_),
+ looks(looksList_)
+ { }
+ };
+
+ typedef std::vector<View> ViewVec;
+ typedef std::map<std::string, ViewVec> DisplayMap; // (display name : ViewVec)
+
+ DisplayMap::iterator find_display(DisplayMap & displays, const std::string & display);
+
+ DisplayMap::const_iterator find_display_const(const DisplayMap & displays, const std::string & display);
+
+ int find_view(const ViewVec & vec, const std::string & name);
+
+ void AddDisplay(DisplayMap & displays,
+ const std::string & display,
+ const std::string & view,
+ const std::string & colorspace,
+ const std::string & looks);
+
+ void ComputeDisplays(StringVec & displayCache,
+ const DisplayMap & displays,
+ const StringVec & activeDisplays,
+ const StringVec & activeDisplaysEnvOverride);
+
+}
+OCIO_NAMESPACE_EXIT
+
+#endif
\ No newline at end of file

File diff suppressed because it is too large Load Diff

View File

@ -1,107 +0,0 @@
$OpenBSD: patch-src_core_OCIOYaml_h,v 1.1 2014/09/03 11:17:59 pascal Exp $
--- src/core/OCIOYaml.h.orig Wed Oct 9 00:59:34 2013
+++ src/core/OCIOYaml.h Wed Aug 27 13:51:26 2014
@@ -28,97 +28,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O
#include <OpenColorIO/OpenColorIO.h>
-#include "Platform.h"
-
-#ifndef WINDOWS
-
-// 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
-
-#include <yaml-cpp/yaml.h>
-
#ifndef INCLUDED_OCIO_YAML_H
#define INCLUDED_OCIO_YAML_H
OCIO_NAMESPACE_ENTER
{
- // Core
- OCIOHIDDEN void operator >> (const YAML::Node& node, ColorSpaceRcPtr& cs);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ColorSpaceRcPtr cs);
- OCIOHIDDEN void operator >> (const YAML::Node& node, GroupTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstGroupTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, TransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, LookRcPtr& cs);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, LookRcPtr cs);
+ class OCIOYaml
+ {
+ public:
+ void open(std::istream& istream, ConfigRcPtr& c, const char* filename = NULL) const;
+ void write(std::ostream& ostream, const Config* c) const;
+ };
- // Transforms
- OCIOHIDDEN void operator >> (const YAML::Node& node, AllocationTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstAllocationTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, CDLTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstCDLTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, ColorSpaceTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstColorSpaceTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, ExponentTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstExponentTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, FileTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstFileTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, LogTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstLogTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, LookTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstLookTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, MatrixTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstMatrixTransformRcPtr t);
- OCIOHIDDEN void operator >> (const YAML::Node& node, TruelightTransformRcPtr& t);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ConstTruelightTransformRcPtr t);
-
- // Enums
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, BitDepth depth);
- OCIOHIDDEN void operator >> (const YAML::Node& node, BitDepth& depth);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, Allocation alloc);
- OCIOHIDDEN void operator >> (const YAML::Node& node, Allocation& alloc);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, ColorSpaceDirection dir);
- OCIOHIDDEN void operator >> (const YAML::Node& node, ColorSpaceDirection& dir);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, TransformDirection dir);
- OCIOHIDDEN void operator >> (const YAML::Node& node, TransformDirection& dir);
- OCIOHIDDEN YAML::Emitter& operator << (YAML::Emitter& out, Interpolation iterp);
- OCIOHIDDEN void operator >> (const YAML::Node& node, Interpolation& iterp);
-
- void LogUnknownKeyWarning(const std::string & name, const YAML::Node& tag);
}
OCIO_NAMESPACE_EXIT