andrewrk / node-groove

bindings to libgroove - music player backend library
MIT License
157 stars 16 forks source link

OSX install fails after homebrew installation of libgroove [node-gyp rebuild failure] #20

Closed CodeGit closed 9 years ago

CodeGit commented 9 years ago

Hi, This seems linked to issue #15 but I've tried the advice listed there with no luck.

I've installed libgroove and all the listed dependencies (pkg-config, texi2html, yasm, x264, lame, libvo-aacenc, xvid, libogg, libvorbis, ffmpeg, chromaprint, speex, libebur128, sdl2) via homebrew. When I try running:

npm install groove

I get the following error:

../src/file.h:6:10: fatal error: 'groove/groove.h' file not found

include <groove/groove.h>

    ^

1 error generated. make: *\ [Release/obj.target/groove/src/groove.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-> gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Darwin 14.3.0 gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/maq/source/workspace/JukeboxServer/node_modules/groove gyp ERR! node -v v0.12.4 gyp ERR! node-gyp -v v1.0.3 gyp ERR! not ok npm ERR! Darwin 14.3.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "groove" npm ERR! node v0.12.4 npm ERR! npm v2.10.1 npm ERR! code ELIFECYCLE

I've also tried building from source which installs into /usr/local/ - but still no luck running npm install:

-- Installing: /usr/local/lib/libgroove.a -- Installing: /usr/local/include/groove/groove.h -- Installing: /usr/local/include/groove/queue.h -- Installing: /usr/local/include/groove/encoder.h -- Installing: /usr/local/lib/libgroove.4.3.0.dylib -- Installing: /usr/local/lib/libgroove.4.dylib -- Installing: /usr/local/lib/libgroove.dylib -- Installing: /usr/local/include/grooveplayer/player.h -- Installing: /usr/local/lib/libgrooveplayer.4.3.0.dylib -- Installing: /usr/local/lib/libgrooveplayer.4.dylib -- Installing: /usr/local/lib/libgrooveplayer.dylib -- Installing: /usr/local/lib/libgrooveplayer.a -- Installing: /usr/local/include/grooveloudness/loudness.h -- Installing: /usr/local/lib/libgrooveloudness.4.3.0.dylib -- Installing: /usr/local/lib/libgrooveloudness.4.dylib -- Installing: /usr/local/lib/libgrooveloudness.dylib -- Installing: /usr/local/lib/libgrooveloudness.a -- Installing: /usr/local/include/groovefingerprinter/fingerprinter.h -- Installing: /usr/local/lib/libgroovefingerprinter.4.3.0.dylib -- Installing: /usr/local/lib/libgroovefingerprinter.4.dylib -- Installing: /usr/local/lib/libgroovefingerprinter.dylib -- Installing: /usr/local/lib/libgroovefingerprinter.a

It's been a long time since I've done anything much with C - Do you have any advice about what I need to do. Should I be setting an environment variable like LD_LIBRARY_PATH?

andrewrk commented 9 years ago

Installing libgroove via homebrew and then node-groove via npm should work out of the box. If it doesn't then there's something about OSX that I don't understand (which is not surprising since it's not my main OS). I don't know how to fix this, but when I get some time I'll fiddle around with my mac to try to find out.

DonSinDRom commented 9 years ago

Got same error in Ubuntu 15.04.

andrewrk commented 9 years ago

@DonSinDRom Ubuntu 15.04 comes with libgroove. Just use sudo apt-get install libgroove-dev libgrooveplayer-dev libgrooveloudness-dev libgroovefingerprinter-dev.

CodeGit commented 9 years ago

Thanks for offering to look into this when you have time. I've downloaded and un-tarred the npm package. After adding /usr/local/include to the "include_dirs" sectiion of binding.gyp, I now get the following error:

npm install node-groove-2.4.0
\
> groove@2.4.0 install temp/node_modules/groove
> node-gyp rebuild

  CXX(target) Release/obj.target/groove/src/groove.o
  CXX(target) Release/obj.target/groove/src/file.o
  CXX(target) Release/obj.target/groove/src/playlist.o
  CXX(target) Release/obj.target/groove/src/player.o
  CXX(target) Release/obj.target/groove/src/playlist_item.o
  CXX(target) Release/obj.target/groove/src/loudness_detector.o
  CXX(target) Release/obj.target/groove/src/fingerprinter.o
  CXX(target) Release/obj.target/groove/src/encoder.o
  SOLINK_MODULE(target) Release/groove.node
ld: library not found for -lgroove
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/groove.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/.node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "node" "/.node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd temp/node_modules/groove
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/.node/bin/npm" "install" "node-groove-2.4.0"
npm ERR! node v0.12.7
npm ERR! npm  v2.13.0
npm ERR! code ELIFECYCLE
CodeGit commented 9 years ago

Looks like the problem was caused by me forgetting to install x-code command line tools. Sorry for wasting your time.

andrewrk commented 9 years ago

Thanks for telling me what it was. Now if someone else reports this issue on any of my projects I can offer this troubleshooting tip.

DonSinDRom commented 9 years ago

@andrewrk donsindrom@0xn:~$ npm install groove -g \

groove@2.4.0 install /usr/lib/node_modules/groove node-gyp rebuild

make: Entering directory '/usr/lib/node_modules/groove/build' CXX(target) Release/obj.target/groove/src/groove.o ../src/groove.cc: In function ‘void Initialize(v8::Handlev8::Object)’: ../src/groove.cc:86:51: error: ‘GROOVE_EVENT_DEVICEREOPENED’ was not declared in this scope SetProperty(exports, "_EVENT_DEVICEREOPENED", GROOVE_EVENT_DEVICEREOPENED); ^ groove.target.mk:94: recipe for target 'Release/obj.target/groove/src/groove.o' failed make: *\ [Release/obj.target/groove/src/groove.o] Error 1 make: Leaving directory '/usr/lib/node_modules/groove/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Linux 3.19.0-21-generic gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/lib/node_modules/groove gyp ERR! node -v v0.12.6 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok npm ERR! Linux 3.19.0-21-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "groove" "-g" npm ERR! node v0.12.6 npm ERR! npm v2.11.2 npm ERR! code ELIFECYCLE

npm ERR! groove@2.4.0 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the groove@2.4.0 install script 'node-gyp rebuild'. npm ERR! This is most likely a problem with the groove package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls groove npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/donsindrom/npm-debug.log

andrewrk commented 9 years ago

See #18

DonSinDRom commented 9 years ago

@andrewrk It works. Thanks.