Skip Menu |

This queue is for tickets about the GSAPI CPAN distribution.

Report information
The Basics
Id: 52528
Status: open
Priority: 0/
Queue: GSAPI

People
Owner: Nobody in particular
Requestors: daxim [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.5
Fixed in: (no value)



Subject: [PATCH] build fix
The make step fails because the Ghostscript API underwent some changes, but the XS did not keep up. Show quoted text
> make
cc -c -I. -I/usr/include/ghostscript -D_REENTRANT -D_GNU_SOURCE -fPIC - DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/ include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION= \"0.5\" -DXS_VERSION=\"0.5\" -fPIC "-I.../lib/perl5/5.10.1/x86_64-linux- thread-multi-ld/CORE" GSAPI.c GSAPI.xs:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token The attached patch fixes that. It applies cleanly against 0.5 with the command git apply *.patch It compiles now, however there are test failures concerning stdin/ stdout macros.
Subject: 0001-build-fix.patch
From f49bdc3ae33121eb680e00097179f05be2ba77d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20D=C9=AA=E1=B4=87=E1=B4=84=E1=B4=8B=E1=B4=8F=E1=B4=A1=20=E8=BF=AA=E6=8B=89=E6=96=AF?= <daxim@cpan.org> Date: Mon, 7 Dec 2009 13:54:35 +0100 Subject: [PATCH] build fix --- GSAPI.xs | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/GSAPI.xs b/GSAPI.xs index d62a7f7..3ded95b 100644 --- a/GSAPI.xs +++ b/GSAPI.xs @@ -10,7 +10,7 @@ #include "const-c.inc" -typedef gs_main_instance *GSAPI__instance; +typedef void *GSAPI__instance; #ifndef DEBUG #define DEBUG 0 @@ -68,7 +68,7 @@ image_new(void *handle, void *device ) return img; } -static void +static void image_free( void *handle, void *device ) { IMAGE *img, *prev=NULL; @@ -108,7 +108,7 @@ run_cb( int idx, const char *msg, int msglen) if(cnt != 1) croak("run_cb: function should return one argument"); - rc = POPi; + rc = POPi; PUTBACK; FREETMPS; LEAVE; return rc; @@ -135,7 +135,7 @@ run_stdin( void *caller_handle, char *buf, int msglen) SPAGAIN; if(cnt != 1) croak("run_stdin: function should return one argument"); - + sv = POPs; p = SvPV(sv, len); if(len > msglen) @@ -193,12 +193,12 @@ static int display_update(void *handle, void *device, int x, int y, #define CB_SUFFIX PUTBACK; FREETMPS; LEAVE; /* Call the display callback w/o any params beyond the "normal" 2 */ -static int +static int display_0( const char *name, void *handle, void *device) { CB_PREFIX; - if(DEBUG) + if(DEBUG) warn( "name=%s", name ); XPUSHs(sv_2mortal(newSVpvn( name, strlen( name ) ))); XPUSHs(sv_2mortal(newSVuv((unsigned int)handle))); @@ -223,7 +223,7 @@ display_open(void *handle, void *device) /* Device is about to be closed. */ /* Device will not be closed until this function returns. */ -static int +static int display_preclose(void *handle, void *device) { IMAGE *image = image_find( handle, device ); @@ -233,7 +233,7 @@ display_preclose(void *handle, void *device) /* Device has been closed. */ /* This is the last event from this device. */ -static int +static int display_close(void *handle, void *device) { int rv = display_0( "display_close", handle, device ); @@ -244,7 +244,7 @@ display_close(void *handle, void *device) /* Device is about to be resized. */ /* Resize will only occur if this function returns 0. */ /* raster is byte count of a row. */ -static int +static int display_presize(void *handle, void *device, int width, int height, int raster, unsigned int format) { @@ -269,9 +269,9 @@ display_presize(void *handle, void *device, /* Device has been resized. */ /* New pointer to raster returned in pimage */ -static int +static int display_size(void *handle, void *device, - int width, int height, int raster, unsigned int format, + int width, int height, int raster, unsigned int format, unsigned char *pimage) { const char *name = "display_size"; @@ -302,7 +302,7 @@ display_size(void *handle, void *device, /* showpage */ /* If you want to pause on showpage, then don't return immediately */ -static int +static int display_page(void *handle, void *device, int copies, int flush) { const char *name = "display_page"; @@ -325,7 +325,7 @@ display_page(void *handle, void *device, int copies, int flush) } /* flushpage */ -static int +static int display_sync(void *handle, void *device) { return display_0( "display_sync", handle, device ); @@ -338,7 +338,7 @@ display_sync(void *handle, void *device) * progressive update of the display. * This function pointer may be set to NULL if not required. */ -static int +static int display_update(void *handle, void *device, int x, int y, int w, int h) { @@ -369,8 +369,8 @@ display_update(void *handle, void *device, } /* Allocate memory for bitmap */ -static void *display_memalloc(void *handle, void *device, - unsigned long size) +static void *display_memalloc(void *handle, void *device, + unsigned long size) { void *mem; if(DEBUG) warn( "memalloc %i", size ); @@ -380,7 +380,7 @@ static void *display_memalloc(void *handle, void *device, } /* Free memory for bitmap */ -static int +static int display_memfree(void *handle, void *device, void *mem ) { if(DEBUG) warn( "memfree %x", mem ); @@ -410,7 +410,7 @@ display_callback display_cb = { -MODULE = GSAPI PACKAGE = GSAPI +MODULE = GSAPI PACKAGE = GSAPI INCLUDE: const-xs.inc @@ -432,7 +432,7 @@ GSAPI::instance new_instance() PROTOTYPE: PREINIT: - gs_main_instance *inst = 0; + void *inst = 0; CODE: gsapi_new_instance(&inst, 0); // we don't need to check rc. RETVAL = inst; @@ -445,7 +445,7 @@ delete_instance(inst) PROTOTYPE: $ CODE: gsapi_delete_instance(inst); - + IV set_stdio(inst, Fstdin, Fstdout, Fstderr) @@ -467,7 +467,7 @@ set_stdio(inst, Fstdin, Fstdout, Fstderr) RETVAL = gsapi_set_stdio(inst, run_stdin, run_stdout, run_stderr); OUTPUT: RETVAL - + IV set_display_callback(inst, Fdisplay) GSAPI::instance inst @@ -481,7 +481,7 @@ set_display_callback(inst, Fdisplay) RETVAL - + IV init_with_args(inst, ...) GSAPI::instance inst @@ -500,7 +500,7 @@ init_with_args(inst, ...) Safefree( argv ); OUTPUT: RETVAL - + IV exit(inst) GSAPI::instance inst -- 1.6.4.2
From: marcoep [...] gmail.com
Hi there, I confirm the patch is effective on my Gentoo system, test failures included: -------------------------------------------------------------------- flexzo GSAPI-0.5 # make test PERL_DL_NONLAZY=1 /usr/bin/perl5.12.3 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01.t ........... ok t/02.t ........... ok t/03.t ........... ok t/04.t ........... ok t/05.t ........... ok t/06.t ........... ok t/07.t ........... ok t/08.t ........... ok t/10_constant.t .. 1/2 # fail: Your vendor has not defined GSAPI macro e_NeedStderr, used at (eval 39) line 1 # fail: Your vendor has not defined GSAPI macro e_NeedStdin, used at (eval 40) line 1 # fail: Your vendor has not defined GSAPI macro e_NeedStdout, used at (eval 41) line 1 # fail: Your vendor has not defined GSAPI macro gs_error_interrupt, used at (eval 75) line 1 # Failed test 'Constants' # at t/10_constant.t line 41. # Looks like you failed 1 test of 2. t/10_constant.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/2 subtests t/20_display.t ... Failed 33/39 subtests Test Summary Report ------------------- t/10_constant.t (Wstat: 256 Tests: 2 Failed: 1) Failed test: 2 Non-zero exit status: 1 t/20_display.t (Wstat: 11 Tests: 6 Failed: 0) Non-zero wait status: 11 Parse errors: Bad plan. You planned 39 tests but ran 6. Files=10, Tests=23, 2 wallclock secs ( 0.08 usr 0.02 sys + 1.38 cusr 0.16 csys = 1.64 CPU) Result: FAIL Failed 2/10 test programs. 1/23 subtests failed. make: *** [test_dynamic] Error 255 -------------------------------------------------------------------- It'd be nice if the author could review and possibly integrate it. Cheers, ^m'e On Mon Dec 07 08:03:59 2009, DAXIM wrote: Show quoted text
> The make step fails because the Ghostscript API underwent some changes, > but the XS did not keep up. >
> > make
> cc -c -I. -I/usr/include/ghostscript -D_REENTRANT -D_GNU_SOURCE -fPIC - > DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/ > include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION= > \"0.5\" -DXS_VERSION=\"0.5\" -fPIC "-I.../lib/perl5/5.10.1/x86_64-linux- > thread-multi-ld/CORE" GSAPI.c > GSAPI.xs:13: error: expected '=', ',', ';', 'asm' or '__attribute__' > before '*' token > > The attached patch fixes that. It applies cleanly against 0.5 with the > command > git apply *.patch > > It compiles now, however there are test failures concerning stdin/ > stdout macros.