Make CAIRO_FORMAT_INVALID optional to support outdated versions of Cairo #342

Closed
terebentina opened this Issue Oct 12, 2013 · 11 comments

Projects

None yet

6 participants

@terebentina

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:

  CXX(target) Release/obj.target/canvas/src/Canvas.o
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
@kangax
Collaborator
kangax commented Oct 12, 2013

/cc @kkoopa

@kkoopa
Contributor
kkoopa commented Oct 13, 2013

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

#ifndef CAIRO_FORMAT_INVALID
#define CAIRO_FORMAT_INVALID -1
#endif

somewhere before png.h:161 should probably work.

@terebentina

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.

@rvagg
Collaborator
rvagg commented Oct 13, 2013

CentOS ... it's always CentOS causing problems for Node.

-1 to pandering to CentOS.

@rcoup rcoup added a commit to koordinates/node-canvas that referenced this issue Nov 27, 2013
@rcoup rcoup Add CAIRO_FORMAT_INVALID c1180d1
@ehartford

any update? how can I make this work?

@rvagg
Collaborator
rvagg commented Dec 23, 2013

@ericstob what's your specific use-case for this? CentOS too?

@rcoup
Contributor
rcoup commented Dec 23, 2013

@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 ?

@rvagg
Collaborator
rvagg commented Dec 23, 2013

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.

@rcoup
Contributor
rcoup commented Dec 24, 2013

@rvagg see #370 - I didn't bother originally since it seemed like your comments earlier were a #wontfix

@rvagg
Collaborator
rvagg commented Dec 24, 2013

@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.

@terebentina

I ended up moving to latest fedora so maybe you should keep this bug open :)

@kangax kangax closed this in #370 Dec 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment