Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

open-scene-graph: fix location of collada-dom includes #46380

Closed
wants to merge 1 commit into from
Closed

open-scene-graph: fix location of collada-dom includes #46380

wants to merge 1 commit into from

Conversation

apjanke
Copy link
Contributor

@apjanke apjanke commented Nov 26, 2015

Fixes #43536

@@ -62,7 +62,9 @@ def install
end

if build.with? "collada-dom"
args << "-DCOLLADA_INCLUDE_DIR=#{Formula["collada-dom"].opt_include}/collada-dom"
# https://github.com/Homebrew/homebrew/issues/43536
collada_include_dir = `ls -d #{Formula["collada-dom"].opt_include}/collada-dom*`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to use Ruby logic here instead e.g. the Dir class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it to use Ruby's Dir.

@apjanke
Copy link
Contributor Author

apjanke commented Nov 26, 2015

Closing this because it still fails with other issues. Upstream build script can't locate the 1.4 dom directory under the includes, even when COLLADA_INCLUDE_DIR is supplied. See openscenegraph/OpenSceneGraph#48.

@apjanke apjanke closed this Nov 26, 2015
@apjanke
Copy link
Contributor Author

apjanke commented Nov 26, 2015

Reopening; got it fixed by explicitly setting COLLADA_DOM_DIR based on COLLADA_INCLUDE_DIR.

@apjanke apjanke reopened this Nov 26, 2015
@MikeMcQuaid
Copy link
Member

👍 once 🍏

# https://github.com/Homebrew/homebrew/issues/43536
collada_include_candidates = Dir.glob("#{Formula["collada-dom"].opt_include}/collada-dom*")
if collada_include_candidates.empty?
odie "Could not locate collada-dom include directory"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the discussion in one of my PRs, I learned it's better to use raise instead of odie.

@apjanke
Copy link
Contributor Author

apjanke commented Nov 26, 2015

Test is failing on 10.11 due to #46372.
Test also failed on 10.10 with other complaints about headers from Security.framework.

[ 14%] Building CXX object src/osgDB/CMakeFiles/osgDB.dir/ImageOptions.cpp.o
cd /tmp/open-scene-graph20151126-42048-1enlyrc/OpenSceneGraph-3.4.0/build/src/osgDB && /usr/local/Library/ENV/4.3/clang++   -DDARWIN_IMAGEIO -DOSGDB_LIBRARY -DOSG_DEFAULT_LIBRARY_PATH=\"/usr/local/Cellar/open-scene-graph/3.4.0/lib/osgPlugins-3.4.0\" -DOSG_PLUGIN_EXTENSION=.so -DUSE_AV_FOUNDATION -DUSE_ZLIB -DosgDB_EXPORTS -I/tmp/open-scene-graph20151126-42048-1enlyrc/OpenSceneGraph-3.4.0/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks -I/tmp/open-scene-graph20151126-42048-1enlyrc/OpenSceneGraph-3.4.0/build/include  -std=c++11 -stdlib=libc++  -Wno-conversion -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.10 -fPIC   -o CMakeFiles/osgDB.dir/ImageOptions.cpp.o -c /tmp/open-scene-graph20151126-42048-1enlyrc/OpenSceneGraph-3.4.0/src/osgDB/ImageOptions.cpp
In file included from /tmp/open-scene-graph20151126-42048-1enlyrc/OpenSceneGraph-3.4.0/src/osgDB/FileUtils.cpp:888:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:80:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLCredential.h:9:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:60:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h:985:49: error: expected ';' after top level declarator
extern const CFStringRef kSecUseAuthenticationUI
                                                ^
                                                ;
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h:987:54: error: expected ';' after top level declarator
extern const CFStringRef kSecUseAuthenticationContext
                                                     ^
                                                     ;
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h:1005:54: error: expected ';' after top level declarator
extern const CFStringRef kSecUseAuthenticationUIAllow
                                                     ^
                                                     ;

if collada_include_candidates.empty?
odie "Could not locate collada-dom include directory"
end
collada_include_dir = collada_include_candidates[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My impression was that using .first in these instances is more common than array indexing with [0]. You could also move the preceding check after this statement, making the code a bit more compact:

collada_include_dir = Dir.glob("#{Formula["collada-dom"].opt_include}/collada-dom*").first
raise "Could not locate collada-dom include directory" unless collada_include_dir

(But maybe the code is too wide to warrant using unless as a statement modifier.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks more readable. I switched it to use this form, and raise instead of odie.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@apjanke
Copy link
Contributor Author

apjanke commented Dec 7, 2015

Closing this to avoid spurious test jobs. I'll resubmit this and the other open-scene-graph PRs as a combined PR that can pass the tests.

@apjanke apjanke closed this Dec 7, 2015
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants