Skip to content

Loading…

New formula: opencolorio #10669

Closed
wants to merge 1 commit into from

5 participants

@2bits

OpenColorIO (OCIO) is a complete color management solution geared
towards motion picture production with an emphasis on visual effects
and computer animation. See: http://opencolorio.org

OCIO is at version 1.0.6 and has been in development since 2003. It
is one of several open source projects actively sponsored by Sony
Imageworks.

OCIO is a new dep for OpenImageIO (OIIO), adding functionality.

OCIO has a built-in test suite that is passes. There are stable
and head methods available. It builds using the system OpenGL,
and little-cms2, along with pkg-config and cmake. An Alias is
added for this formula to ocio. It has python bindings enabled
with a user option, following the example of vtk.

OCIO head and stable build and run very well on Lion and SL using
all five compilers from XCode-4.3.1, 4.0.2, and CLT-4.3.1, thanks to
patches the devs merged upstream for us.

EDIT: code cleanup
EDIT: bump to 1.0.6, remove rescue clause. All tests pass.

@2bits

@jacknagel Hello. This is a new formula. Their website is worth a look.

@jacknagel jacknagel commented on the diff
Library/Formula/opencolorio.rb
((26 lines not shown))
+ args << "-DOCIO_BUILD_TESTS=ON" if ARGV.include? '--with-tests'
+ args << "-DOCIO_BUILD_DOCS=ON" if ARGV.include? '--with-docs'
+ args << "-DCMAKE_VERBOSE_MAKEFILE=OFF"
+
+ # CMake-2.8.7 + CLT + llvm + Lion => CMAKE_CXX_HAS_ISYSROOT "1"
+ # CMake-2.8.7 + CLT + clang + Lion => CMAKE_CXX_HAS_ISYSROOT ""
+ # CMake puts a malformed sysroot into CXX_FLAGS in flags.make with llvm
+ # Syntax like this gets added:
+ # -isysroot /Some/Wrong/SDKs/path
+ # which causes c++ includes not found when compiling with llvm.
+ # https://github.com/imageworks/OpenColorIO/issues/224
+ # The current workaround is that the SDK directory structure is mirrored
+ # in the root directory, e.g.
+ # Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include
+ # /usr/include
+ # So we just set the sysroot to /

Some upstream patches went into the cmake formula recently, do they help with the issues here?

@2bits
2bits added a note

@jacknagel The cmake patches don't help at all. I tested with those patches against XCode-4.3.1.
Because CMake won't deal with the case where xcode-select -print-path only returns errors (CLT only)
we get a malformed:

CMAKE_OSX_SYSROOT = /SDKs/MacOSX10.7.sdk in CMakeCache.txt.

When you combine that with CMAKE_CXX_HAS_ISYSROOT "1" being defined because llvm
supports that flag, then you have a recipe for problems.

The question has always been, does a bad -isysroot leak into CXX_FLAGS all the time.
Obviously not or all my brews would fail.

Then I have to find why this software gets that included into CXX_FLAGS
I have looked at the code till I'm blue, and it is not added explicitly.
I can trace the origin of every flag in CXX_FLAGS except these two:

-arch x86_64 -isysroot /SDKs/MacOSX10.7.sdk

I hypothesize that the devs set the arch, which I missed happening and that
the arch variable triggers CMake to also add the sysroot variable.

I've asked this question on the cmake mailing list, what can trigger the inclusion
of -isysroot into flags.make in the CXX_FLAGS variable if the devs do not
explicitly code it to be in those flags, but I get no reply. I'm now at the point
where I just run full xcode. I gave up on the CLT only because it's unsupported
by CMake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jacknagel jacknagel commented on an outdated diff
Library/Formula/opencolorio.rb
((37 lines not shown))
+ # The current workaround is that the SDK directory structure is mirrored
+ # in the root directory, e.g.
+ # Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include
+ # /usr/include
+ # So we just set the sysroot to /
+
+ args << "-DCMAKE_OSX_SYSROOT=/" if ENV.compiler == :llvm and MacOS.lion?
+
+
+
+ # Python note:
+ # OCIO's PyOpenColorIO.so doubles as a shared library. So it lives in lib, rather
+ # than the usual HOMEBREW_PREFIX/lib/python2.7/site-packages per developer choice.
+
+ if ARGV.include? '--with-python'
+ if `which python-config` == '' then # bail out if no python.

We have a which helper method now (in utils.rb) that returns either nil or a pathname.

@adamv
adamv added a note

There will always be a Python on OS X, the system Python ships with python-config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@2bits

Okay. I'll trust you on that, and I'll remove the check for python-config.

@2bits

They might bump to 1.0.6 in a few days. Thanks for helping me find the defects. I made those changes.

@2bits

@jacknagel upgraded the formula to version 1.0.6. All tests pass on all compilers. How do we code the python section to enforce using python-2.7.x ? The developer mentioned to me that the bindings don't work with python3.

@jacknagel

I believe all of the python3 binaries have the -3 suffix (i.e. python3-config) so it shouldn't be a problem.

@mistydemeo

@jacknagel Are you ready to pull this?

@jacknagel

Haven't looked at it for a few days, if someone else can/wants to give it a proper review that would be fine.

@mistydemeo

OK, I'll give a look over.

@2bits

I just remembered the ocio devs are close to moving that python library into site-packages.
Because they correctly determine our /usr/local/lib/python2.7/site-packages, I think they will
get the install correct, but if you want to hold off, I don't blame you. See also

imageworks/OpenColorIO#236 (comment)

@mistydemeo

Aside from the Python lib business, this looks good to me.

If you think it's best to wait on the python library changes, I'll wait until that's done - otherwise I'm ready to pull.

@2bits

Sounds good. They haven't moved forward on it, but they sounded like they would.

@dbr

Good work 2bits - thanks for working on this!

@2bits

You're welcome. It's a pleasure to build well written code. The above commit baa992a modifies the caveats for accuracy. Thanks for the suggestions.

@2bits 2bits New Formula: opencolorio
OpenColorIO (OCIO) is a complete color management solution geared
towards motion picture production with an emphasis on visual effects
and computer animation.  See:  http://opencolorio.org

OCIO is at version 1.0.6 and has been in development since 2003. It
is one of several open source projects actively sponsored by Sony
Imageworks.

OCIO is a new dep for OpenImageIO (OIIO), adding functionality.

OCIO has a built-in test suite that is passes.  There are stable
and head methods available.  It builds using the system OpenGL,
and little-cms2, along with pkg-config and cmake.  An Alias is
added for this formula to ocio.  It has python bindings enabled
with a user option, following the example of vtk.

OCIO head and stable build and run very well on Lion and SL using
all five compilers from XCode-4.3.2, 4.0.2, and CLT-4.3.2, thanks
to patches the devs merged upstream for us.

EDIT: code fix redacted args.
EDIT: shrink formula comments.
EDIT: test against XCode-4.3.1.
EDIT: remove the unnecessary which python-config
EDIT: change to version 1.0.6.  Remove rescue clause.  Tests work.
EDIT: tests pass against XCode-4.3.2.
EDIT: modify the caveats for accuracy using the dev's suggestions.
EDIT: remove the `\n` after the caveat url
9fc8c9b
@2bits

The above commit 9fc8c9b removes the \n per request from the caveat url.

@2bits

Upstream has merged in a change that installs PyOpenColorIO.so into site-packages. I tested it, and it works well. I'm now waiting on a bump to 1.0.7 to get that fix into stable.

@mistydemeo mistydemeo added a commit that closed this pull request
@2bits 2bits New Formula: opencolorio
OpenColorIO (OCIO) is a complete color management solution geared
towards motion picture production with an emphasis on visual effects
and computer animation.  See:  http://opencolorio.org

OCIO is at version 1.0.6 and has been in development since 2003. It
is one of several open source projects actively sponsored by Sony
Imageworks.

OCIO is a new dep for OpenImageIO (OIIO), adding functionality.

OCIO has a built-in test suite that is passes.  There are stable
and head methods available.  It builds using the system OpenGL,
and little-cms2, along with pkg-config and cmake.  An Alias is
added for this formula to ocio.  It has python bindings enabled
with a user option, following the example of vtk.

OCIO head and stable build and run very well on Lion and SL using
all five compilers from XCode-4.3.2, 4.0.2, and CLT-4.3.2, thanks
to patches the devs merged upstream for us.

EDIT: code fix redacted args.
EDIT: shrink formula comments.
EDIT: test against XCode-4.3.1.
EDIT: remove the unnecessary which python-config
EDIT: change to version 1.0.6.  Remove rescue clause.  Tests work.
EDIT: tests pass against XCode-4.3.2.
EDIT: modify the caveats for accuracy using the dev's suggestions.
EDIT: remove the `\n` after the caveat url

Closes #10669.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
b57cbe1
@mistydemeo mistydemeo closed this in b57cbe1
@mistydemeo

Pulled with patches for the PyOpenColorIO.so location sourced from the ocio tree.

Thanks again for your hard work on this.

@peterhellberg peterhellberg referenced this pull request
Commit has since been removed from the repository and is no longer available.
@mgrimes mgrimes referenced this pull request
Commit has since been removed from the repository and is no longer available.
@julienXX julienXX referenced this pull request
Commit has since been removed from the repository and is no longer available.
@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this pull request
@2bits 2bits New Formula: opencolorio
OpenColorIO (OCIO) is a complete color management solution geared
towards motion picture production with an emphasis on visual effects
and computer animation.  See:  http://opencolorio.org

OCIO is at version 1.0.6 and has been in development since 2003. It
is one of several open source projects actively sponsored by Sony
Imageworks.

OCIO is a new dep for OpenImageIO (OIIO), adding functionality.

OCIO has a built-in test suite that is passes.  There are stable
and head methods available.  It builds using the system OpenGL,
and little-cms2, along with pkg-config and cmake.  An Alias is
added for this formula to ocio.  It has python bindings enabled
with a user option, following the example of vtk.

OCIO head and stable build and run very well on Lion and SL using
all five compilers from XCode-4.3.2, 4.0.2, and CLT-4.3.2, thanks
to patches the devs merged upstream for us.

EDIT: code fix redacted args.
EDIT: shrink formula comments.
EDIT: test against XCode-4.3.1.
EDIT: remove the unnecessary which python-config
EDIT: change to version 1.0.6.  Remove rescue clause.  Tests work.
EDIT: tests pass against XCode-4.3.2.
EDIT: modify the caveats for accuracy using the dev's suggestions.
EDIT: remove the `\n` after the caveat url

Closes #10669.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
06292ad
@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request
@2bits 2bits New Formula: opencolorio
OpenColorIO (OCIO) is a complete color management solution geared
towards motion picture production with an emphasis on visual effects
and computer animation.  See:  http://opencolorio.org

OCIO is at version 1.0.6 and has been in development since 2003. It
is one of several open source projects actively sponsored by Sony
Imageworks.

OCIO is a new dep for OpenImageIO (OIIO), adding functionality.

OCIO has a built-in test suite that is passes.  There are stable
and head methods available.  It builds using the system OpenGL,
and little-cms2, along with pkg-config and cmake.  An Alias is
added for this formula to ocio.  It has python bindings enabled
with a user option, following the example of vtk.

OCIO head and stable build and run very well on Lion and SL using
all five compilers from XCode-4.3.2, 4.0.2, and CLT-4.3.2, thanks
to patches the devs merged upstream for us.

EDIT: code fix redacted args.
EDIT: shrink formula comments.
EDIT: test against XCode-4.3.1.
EDIT: remove the unnecessary which python-config
EDIT: change to version 1.0.6.  Remove rescue clause.  Tests work.
EDIT: tests pass against XCode-4.3.2.
EDIT: modify the caveats for accuracy using the dev's suggestions.
EDIT: remove the `\n` after the caveat url

Closes #10669.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
550fc63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 27, 2012
  1. @2bits

    New Formula: opencolorio

    2bits committed
    OpenColorIO (OCIO) is a complete color management solution geared
    towards motion picture production with an emphasis on visual effects
    and computer animation.  See:  http://opencolorio.org
    
    OCIO is at version 1.0.6 and has been in development since 2003. It
    is one of several open source projects actively sponsored by Sony
    Imageworks.
    
    OCIO is a new dep for OpenImageIO (OIIO), adding functionality.
    
    OCIO has a built-in test suite that is passes.  There are stable
    and head methods available.  It builds using the system OpenGL,
    and little-cms2, along with pkg-config and cmake.  An Alias is
    added for this formula to ocio.  It has python bindings enabled
    with a user option, following the example of vtk.
    
    OCIO head and stable build and run very well on Lion and SL using
    all five compilers from XCode-4.3.2, 4.0.2, and CLT-4.3.2, thanks
    to patches the devs merged upstream for us.
    
    EDIT: code fix redacted args.
    EDIT: shrink formula comments.
    EDIT: test against XCode-4.3.1.
    EDIT: remove the unnecessary which python-config
    EDIT: change to version 1.0.6.  Remove rescue clause.  Tests work.
    EDIT: tests pass against XCode-4.3.2.
    EDIT: modify the caveats for accuracy using the dev's suggestions.
    EDIT: remove the `\n` after the caveat url
This page is out of date. Refresh to see the latest.
Showing with 95 additions and 0 deletions.
  1. +1 −0 Library/Aliases/ocio
  2. +94 −0 Library/Formula/opencolorio.rb
View
1 Library/Aliases/ocio
View
94 Library/Formula/opencolorio.rb
@@ -0,0 +1,94 @@
+require 'formula'
+
+class Opencolorio < Formula
+ homepage 'http://opencolorio.org/'
+ url 'https://github.com/imageworks/OpenColorIO/tarball/v1.0.6'
+ sha1 '1d7a195b684fbd0687a661aa532c5cc447215420'
+
+ head 'https://github.com/imageworks/OpenColorIO.git'
+
+ depends_on 'cmake' => :build
+ depends_on 'pkg-config' => :build
+ depends_on 'little-cms2'
+
+ def options
+ [
+ ['--with-tests', 'Verify the build with its unit tests (~1min)'],
+ ['--with-python', 'Build ocio with python2.7 bindings'],
+ ['--with-java', 'Build ocio with java bindings'],
+ ['--with-docs', 'Build the documentation.']
+ ]
+ end
+
+ def install
+ args = std_cmake_parameters.split
+ args << "-DOCIO_BUILD_JNIGLUE=ON" if ARGV.include? '--with-java'
+ args << "-DOCIO_BUILD_TESTS=ON" if ARGV.include? '--with-tests'
+ args << "-DOCIO_BUILD_DOCS=ON" if ARGV.include? '--with-docs'
+ args << "-DCMAKE_VERBOSE_MAKEFILE=OFF"
+
+ # CMake-2.8.7 + CLT + llvm + Lion => CMAKE_CXX_HAS_ISYSROOT "1"
+ # CMake-2.8.7 + CLT + clang + Lion => CMAKE_CXX_HAS_ISYSROOT ""
+ # CMake puts a malformed sysroot into CXX_FLAGS in flags.make with llvm.
+ # Syntax like this gets added:
+ # -isysroot /Some/Wrong/SDKs/path
+ # which causes c++ includes not found when compiling with llvm.
+ # https://github.com/imageworks/OpenColorIO/issues/224
+ # The current workaround is that the SDK directory structure is mirrored
+ # in the root directory, e.g.
+ # Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include
+ # /usr/include
+ # So we just set the sysroot to /

Some upstream patches went into the cmake formula recently, do they help with the issues here?

@2bits
2bits added a note

@jacknagel The cmake patches don't help at all. I tested with those patches against XCode-4.3.1.
Because CMake won't deal with the case where xcode-select -print-path only returns errors (CLT only)
we get a malformed:

CMAKE_OSX_SYSROOT = /SDKs/MacOSX10.7.sdk in CMakeCache.txt.

When you combine that with CMAKE_CXX_HAS_ISYSROOT "1" being defined because llvm
supports that flag, then you have a recipe for problems.

The question has always been, does a bad -isysroot leak into CXX_FLAGS all the time.
Obviously not or all my brews would fail.

Then I have to find why this software gets that included into CXX_FLAGS
I have looked at the code till I'm blue, and it is not added explicitly.
I can trace the origin of every flag in CXX_FLAGS except these two:

-arch x86_64 -isysroot /SDKs/MacOSX10.7.sdk

I hypothesize that the devs set the arch, which I missed happening and that
the arch variable triggers CMake to also add the sysroot variable.

I've asked this question on the cmake mailing list, what can trigger the inclusion
of -isysroot into flags.make in the CXX_FLAGS variable if the devs do not
explicitly code it to be in those flags, but I get no reply. I'm now at the point
where I just run full xcode. I gave up on the CLT only because it's unsupported
by CMake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
+ args << "-DCMAKE_OSX_SYSROOT=/" if ENV.compiler == :llvm and MacOS.lion?
+
+
+
+ # Python note:
+ # OCIO's PyOpenColorIO.so doubles as a shared library. So it lives in lib, rather
+ # than the usual HOMEBREW_PREFIX/lib/python2.7/site-packages per developer choice.
+
+ if ARGV.include? '--with-python'
+ python_prefix = `python-config --prefix`.strip
+ if File.exist? "#{python_prefix}/Python"
+ # Python was compiled with --framework:
+ args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
+ args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'"
+ else
+ python_version = `python-config --libs`.match('-lpython(\d+\.\d+)').captures.at(0)
+ python_lib = "#{python_prefix}/lib/libpython#{python_version}"
+ args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/include/python#{python_version}'"
+ if File.exists? "#{python_lib}.a"
+ args << "-DPYTHON_LIBRARY='#{python_lib}.a'"
+ else
+ args << "-DPYTHON_LIBRARY='#{python_lib}.dylib'"
+ end
+ end
+ else
+ args << "-DOCIO_BUILD_PYGLUE=OFF"
+ end
+
+ args << '..'
+
+ mkdir 'macbuild' do
+ system "cmake", *args
+ system "make"
+ system "make test" if ARGV.include? '--with-tests'
+ system "make install"
+ end
+ end
+
+ def caveats
+ <<-EOS.undent
+ OpenColorIO requires several environment variables to be set.
+ You can source the following script in your shell-startup to do that:
+ #{HOMEBREW_PREFIX}/share/ocio/setup_ocio.sh
+ Alternatively the documentation describes what env-variables need set:
+ http://opencolorio.org/installation.html#environment-variables
+ You will require a config for OCIO to be useful. Sample configuration files
+ and reference images can be found at:
+ http://opencolorio.org/downloads.html
+
+ EOS
+ end
+end
Something went wrong with that request. Please try again.