Opened 12 years ago

Closed 12 years ago

#36053 closed defect (fixed)

libharu build fails with libpng 1.5

Reported by: jwhowse4 Owned by: anddam (Andrea D'Amore)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: haspatch Cc:
Port: libharu

Description

I am running Lion 10.7.4 with XCode 4.4.1. After upgrading to libpng 1.5, libharu fails with the following error message.

libtool: compile:  /usr/bin/clang -DHAVE_CONFIG_H -I. -I../include -I../include -I/opt/macports/include -pipe -O2 -arch x86_64 -I/opt/macports/include -I/opt/macports/include -fexceptions -MT hpdf_image.lo -MD -MP -MF .deps/hpdf_image.Tpo -c hpdf_image.c -o hpdf_image.o >/dev/null 2>&1
hpdf_image_png.c:113:25: error: incomplete definition of type 'struct png_info_def'
                info_ptr->height * sizeof (png_bytep));
                ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:118:47: error: incomplete definition of type 'struct png_info_def'
        HPDF_MemSet (row_pointers, 0, info_ptr->height * sizeof (png_bytep));
                                      ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:119:44: error: incomplete definition of type 'struct png_info_def'
        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                   ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:129:52: error: incomplete definition of type 'struct png_info_def'
                for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                           ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:138:44: error: incomplete definition of type 'struct png_info_def'
        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                   ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:159:44: error: incomplete definition of type 'struct png_info_def'
        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                   ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:186:46: error: incomplete definition of type 'struct png_info_def'
        row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * sizeof(png_bytep));
                                            ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:192:38: error: incomplete definition of type 'struct png_info_def'
                for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                           ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:195:14: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
                                for (; i >= 0; i--) {
                                       ~ ^  ~
hpdf_image_png.c:210:26: error: incomplete definition of type 'struct png_info_def'
        for (j = 0; j < info_ptr->height; j++) {
                        ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:211:27: error: incomplete definition of type 'struct png_info_def'
                for (i = 0; i < info_ptr->width; i++) {
                                ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:212:23: error: incomplete definition of type 'struct png_info_def'
                        smask_data[info_ptr->width * j + i] = (row_ptr[j][i] < num_trans) ? trans[row_ptr[j][i]] : 0xFF;
                                   ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:215:61: error: incomplete definition of type 'struct png_info_def'
                if (HPDF_Stream_Write (image->stream, row_ptr[j], info_ptr->width) != HPDF_OK) {
                                                                  ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:222:37: error: incomplete definition of type 'struct png_info_def'
        for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                   ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:248:46: error: incomplete definition of type 'struct png_info_def'
        row_ptr = HPDF_GetMem (image->mmgr, info_ptr->height * sizeof(png_bytep));
                                            ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:254:38: error: incomplete definition of type 'struct png_info_def'
                for (i = 0; i < (HPDF_UINT)info_ptr->height; i++) {
                                           ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:257:14: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
                                for (; i >= 0; i--) {
                                       ~ ^  ~
hpdf_image_png.c:274:26: error: incomplete definition of type 'struct png_info_def'
                        row_len = 3 * info_ptr->width * sizeof(png_byte);
                                      ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:275:28: error: incomplete definition of type 'struct png_info_def'
                        for (j = 0; j < info_ptr->height; j++) {
                                        ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:276:29: error: incomplete definition of type 'struct png_info_def'
                                for (i = 0; i < info_ptr->width; i++) {
                                                ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
hpdf_image_png.c:279:25: error: incomplete definition of type 'struct png_info_def'
                                        smask_data[info_ptr->width * j + i] = row[4 * i + 3];
                                                   ~~~~~~~~^
/opt/macports/include/png.h:727:16: note: forward declaration of 'struct png_info_def'
typedef struct png_info_def png_info;
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

I found a patch at http://pkgbuild.com/~ioni/libpng-1.5/libharu-2.2.1-libpng-1.5.patch. The attached Portfile and patch fix the problem for me.

Attachments (2)

Portfile (1.6 KB) - added by jwhowse4 12 years ago.
Revised Portfile
patch-src-hpdf_image_png.c.diff (13.0 KB) - added by jwhowse4 12 years ago.
Patch file

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by jwhowse4

Attachment: Portfile added

Revised Portfile

Changed 12 years ago by jwhowse4

Patch file

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: and.damore@… removed
Keywords: haspatch added
Owner: changed from macports-tickets@… to and.damore@…
Port: libharu added

comment:2 Changed 12 years ago by anddam (Andrea D'Amore)

Status: newassigned

comment:3 Changed 12 years ago by anddam (Andrea D'Amore)

Resolution: fixed
Status: assignedclosed

Thanks for the patch, I was waiting for libharu's RC, that already builds with libpng 1.5, to become stable before upgrading.

Committed r97671, ticket closed.

Note: See TracTickets for help on using tickets.