Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find png.h with custom Homebrew root because Boxen #45

Open
ghost opened this issue Feb 18, 2015 · 1 comment
Open

Cannot find png.h with custom Homebrew root because Boxen #45

ghost opened this issue Feb 18, 2015 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 18, 2015

I have a non-standard, but not-uncommon Homebrew config which causes this module to fail to build on OS X. Specifically, Homebrew is installed by Boxen under /opt/boxen instead of /usr/local:

$ brew --env
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j4
CMAKE_PREFIX_PATH: /opt/boxen/homebrew
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/boxen/homebrew/Library/ENV/pkgconfig/10.10
ACLOCAL_PATH: /opt/boxen/homebrew/share/aclocal
PATH: /opt/boxen/homebrew/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin

I confess to being fairly ignorant how node extensions are built with gyp, but I would expect to see something like -I/opt/boxen/homebrew/include here:

$ npm install --loglevel verbose png
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  c++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/toolbear/.node-gyp/0.10.31/src -I/Users/toolbear/.node-gyp/0.10.31/deps/uv/include -I/Users/toolbear/.node-gyp/0.10.31/deps/v8/include  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/png/src/common.o.d.raw  -c -o Release/obj.target/png/src/common.o ../src/common.cpp
  c++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/toolbear/.node-gyp/0.10.31/src -I/Users/toolbear/.node-gyp/0.10.31/deps/uv/include -I/Users/toolbear/.node-gyp/0.10.31/deps/v8/include  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/png/src/png_encoder.o.d.raw  -c -o Release/obj.target/png/src/png_encoder.o ../src/png_encoder.cpp
In file included from ../src/png_encoder.cpp:3:

I can work around this issue with:

$ cd /usr/local
$ sudo ln -s /opt/boxen/homebrew/include include

And then everything builds.

With some pointers on what I should change, I'm happy to submit a pull request that incorporates brew --env values into the build config. The failure is trivial for me to reproduce and currently not blocking as png is an optional dependency ATM.

@ghost ghost changed the title Cannot find png.h with custom Homebrew root via Boxen Cannot find png.h with custom Homebrew root because Boxen Feb 18, 2015
@LinusU
Copy link

LinusU commented Aug 7, 2015

What does pkg-config libpng output for you? Maybe you need to set your PKG_CONFIG_PATH to something under /opt/boxen...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant