Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make CAIRO_FORMAT_INVALID optional to support outdated versions of Cairo #342

Closed
terebentina opened this Issue · 11 comments

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

/cc @kkoopa

@kkoopa

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

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

-1 to pandering to CentOS.

@rcoup rcoup referenced this issue from a commit in koordinates/node-canvas
@rcoup rcoup Add CAIRO_FORMAT_INVALID c1180d1
@ehartford

any update? how can I make this work?

@rvagg
Collaborator

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

@rcoup

@rvagg mine was Ubuntu Lucid which is still in LTS support for a bit longer :smile:

@ericstob add the patch / use the fork from koordinates@c1180d1 ala npm install git://github.com/koordinates/node-canvas.git#c1180d1f3d0c13704ed4406cbc341fe1f90b280f ?

@rvagg
Collaborator

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

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

@rvagg
Collaborator

@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
@vvo vvo referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.