Any chance you could do with CAIRO_FORMAT_INVALID what you did for CAIRO_FORMAT_RGB30 in this PR: #315 ?
From reading around, it seems it's the same problem.
This is what I get when trying to install canvas 1.1.1 with cairo 1.8.8-3.1.el6:
In file included from ../src/Canvas.cc:8:
../src/PNG.h: In function ‘cairo_status_t canvas_write_png(cairo_surface_t*, void (*)(png_struct*, png_byte*, png_size_t), void*)’:
../src/PNG.h:161: error: ‘CAIRO_FORMAT_INVALID’ was not declared in this scope
make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1
Apparently, Cairo 1.8.8 was released in 2009 and CAIRO_FORMAT_INVALID officially appeared in 2010. The value is supposed to be -1. I don't know if anything will break by messing around with it, but at the same time I don't see if it is worth doing for a 4-year old version of a library that has received several updates since. Why can't you use a version of Cairo from this decade?
Either way, adding
#define CAIRO_FORMAT_INVALID -1
somewhere before png.h:161 should probably work.
The reason is a CentOS 6.3 production server and not being allowed to install packages outside of yum repos.
I'll try your suggestion, thanks.
CentOS ... it's always CentOS causing problems for Node.
-1 to pandering to CentOS.
any update? how can I make this work?
@ericstob what's your specific use-case for this? CentOS too?
@rvagg mine was Ubuntu Lucid which is still in LTS support for a bit longer 😄
@ericstob add the patch / use the fork from koordinates@c1180d1 ala npm install git://github.com/koordinates/node-canvas.git#c1180d1f3d0c13704ed4406cbc341fe1f90b280f ?
npm install git://github.com/koordinates/node-canvas.git#c1180d1f3d0c13704ed4406cbc341fe1f90b280f
Yeah, that patch is simple enough. If everything else works properly then +1 to getting this solved. Someone want to submit a PR to get koordinates@c1180d1 in? I don't see an existing PR for it.
@rvagg see #370 - I didn't bother originally since it seemed like your comments earlier were a #wontfix
@rcoup I'm not maintainer, just a noisy voice! However it does seem like a fairly easy fix to support Ubuntu LTS (I curse at CentOS) if you're experience is that everything else works fine.
I ended up moving to latest fedora so maybe you should keep this bug open :)