Open bensheldon opened 12 years ago
Looking into this further, it appears to only fail on the new node-canvas version 0.13.x which replaces node-waf with gyp. I need to look further into how gyp loads libraries, but you can see the changes that were made between the 0.12.x and 0.13.x node-canvas versions
It looks like you forked this and tried to fix it? How did that go?
Didn't have much luck. I have it working with node-canvas v0.12.x. I think the problem is with the gyp configuration in node-canvas v0.13.x. It looks like others are having trouble in different environments; for example, this issue could be related.
But I do have the buildpack working beautifully on node-canvas v0.12.x and really appreciate the work you've done.
Cool, thanks. Appreciate the research. Let me know if it becomes a blocker for you I'd be happy to jump on IM/IRC and try to work it out.
Yep, I'm having the exact same error when trying to push to heroku https://gist.github.com/3832964 So +1 on this!
Am using 0.13.x, as I couldn't get 0.12.x to build on OSX.
Will try and help further on this too. Secretly I was hoping someone would have fixed it already :)
@davidjrice sigh, I'm now having that problem too. This is by no means a pretty solution, but I have my package.json
file set up like this:
"dependencies": {
"canvas": "0.12.x" // for heroku-buildpack
},
"devDependencies": {
"canvas": "0.13.x", // for local development where v0.12.x won't install argh!
}
I've worked around this issue by compiling my own version of pixman and cairo on a heroku instance, shipping the libraries back to my machine, checking them in to my repository, and then using a fork of the standard buildpack here: https://github.com/nik9000/heroku-buildpack-nodejs.
I'm not 100% sure but I think the compilation problem you are seeing is caused by the way node-canvas references most .h files (cairo/cairo.h) and the way the buildpack sets them up to be referenced (cairo.h). I don't think node-canvas is consistent with the way it references .h files - some of them don't use the directory, I believe. For that reason, I made my buildpack reference them in both ways.
Here is exactly what I did to build pixman and cairo
heroku run bash
cd /tmp
curl http://cairographics.org/releases/LATEST-pixman-0.28.2 > pixman-0.28.2.tar.gz
tar xf pixman-0.28.2.tar.gz
cd pixman-0.28.2
./configure --prefix=/app/vendor/pixman-0.28.2
make
make install
cd ..
curl http://cairographics.org/releases/LATEST-cairo-1.12.10 > cairo-1.12.10.tar.xz
unxz cairo-1.12.10.tar.xz
tar xf cairo-1.12.10.tar
cd cairo-1.12.10
export PKG_CONFIG_PATH=/app/vendor/pixman-0.28.2/lib/pkgconfig/
./configure --prefix=/app/vendor/cairo-1.12.10
make
make install
You can take the vendor library home with scp -r /app/vendor/ you@yourlaptop
I followed @nik9000's lead and updated my fork of the buildpack to use the changed include paths while updating the library versions.
Cairo libraries (but not headers) are present on dynos, so care must be taken to set LD_LIBRARY_PATH
to look for the vendored Cairo first, otherwise you may experience runtime errors as it attempts to call into missing functions. My fork of the buildpack writes $HOME/.profile.d/ld_library_path.sh
with vendored libraries to take this into account.
Have this working thanks to davidjrice/heroku-buildpack-cairo
You'll also need my changes to heroku-buildpack-nodejs
Sorry I don't have time to document this better at this point in time
On Sunday, 14 April 2013 at 06:03, Seth Fitzsimmons wrote:
I followed @nik9000 (https://github.com/nik9000)'s lead and updated my fork of the buildpack (https://github.com/mojodna/heroku-buildpack-nodejs) to use the changed include paths while updating the library versions. Cairo libraries (but not headers) are present on dynos, so care must be taken to set LD_LIBRARY_PATH to look for the vendored Cairo first, otherwise you may experience runtime errors as it attempts to call into missing functions. My fork of the buildpack writes $HOME/.profile.d/ld_library_path.sh with vendored libraries to take this into account.
— Reply to this email directly or view it on GitHub (https://github.com/bloomtime/heroku-buildpack-nodejs/issues/1#issuecomment-16346085).
(@davidjrice - to be clear, my buildpack is successfully working with node-canvas-1.0.2 having more or less followed the same road as you.)
I'm having trouble installing
node-canvas
using this buildpack. Below is the section of npm install log when it starts trying to build canvas and then barfs.I'm not entirely sure what the problem is: if it's looking for the Cairo sourcefiles (and not finding them) or if it has something to do with the environment variables not being set. This is my environment on Heroku:
And my package.json in case it's a version compatibility issue
Thanks for the help!