Skip to content

Commit

Permalink
graphics/a2png: Fix build with C99 inline semantics
Browse files Browse the repository at this point in the history
- This fixes the build on arm and i386.

PR:		262267
  • Loading branch information
clausecker authored and yzgyyang committed Mar 5, 2022
1 parent ae8a681 commit 06dfcbd
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
13 changes: 3 additions & 10 deletions graphics/a2png/Makefile
Expand Up @@ -2,7 +2,7 @@

PORTNAME= a2png
PORTVERSION= 0.1.5
PORTREVISION= 10
PORTREVISION= 11
CATEGORIES= graphics
MASTER_SITES= SF

Expand All @@ -12,24 +12,17 @@ COMMENT= Converts plain ASCII text into PNG bitmap images
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING

BROKEN_armv6= fails to build: parse.c:(.text+0x174): undefined reference to 'fgettok'
BROKEN_armv7= fails to build: parse.c:(.text+0x174): undefined reference to 'fgettok'
BROKEN_i386= fails to build: parse.c:(.text+0x135): undefined reference to 'fgettok'

LIB_DEPENDS= libgd.so:graphics/gd

USES= tar:bzip2 localbase
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-gd --with-gdlib-config-path=${WRKDIR}
CONFIGURE_ARGS= --enable-gd
CFLAGS+= -DDEFAULT_FONTPATH='\"${FONTROOTDIR}/TTF:${FONTROOTDIR}/Type1:${FONTROOTDIR}\"'
BINARY_ALIAS= gdlib-config=true
PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz

FONTROOTDIR?= ${LOCALBASE}/share/fonts

pre-configure:
${ECHO_CMD} "#!/bin/sh" > ${WRKDIR}/gdlib-config
${CHMOD} +x ${WRKDIR}/gdlib-config

do-install:
${INSTALL_PROGRAM} ${WRKSRC}/src/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/man/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
Expand Down
26 changes: 26 additions & 0 deletions graphics/a2png/files/patch-src_image.c
@@ -0,0 +1,26 @@
--- src/image.c.orig 2006-10-05 13:36:26 UTC
+++ src/image.c
@@ -148,7 +148,6 @@ void image_resize_crop(engine_t *e, const int width_px
#endif
}

-inline
void image_set_foreground(engine_t *p, const rgb_t* color) {
#ifdef ENABLE_CAIRO
static const double alpha = 1.0;
@@ -286,7 +285,6 @@ image_points_t image_get_font_max_metrics(engine_t *p,
return r;
}

-inline
void image_move_to(engine_t *en, const image_point_t x, const image_point_t y) {
en->pos.x = x;
en->pos.y = y;
@@ -296,7 +294,6 @@ void image_move_to(engine_t *en, const image_point_t x
#endif
}

-inline
image_points_t image_get_position(engine_t *en) {
#ifdef ENABLE_CAIRO
static image_points_t r;
9 changes: 9 additions & 0 deletions graphics/a2png/files/patch-src_image.h
@@ -0,0 +1,9 @@
--- src/image.h.orig 2021-12-03 16:02:51 UTC
+++ src/image.h
@@ -22,5 +22,6 @@ void image_putc(engine_t *en, const char c);
void image_set_foreground(engine_t *p, const rgb_t* color);
void image_fill_rect(engine_t *en, const image_point_t x1, const image_point_t y1, const image_point_t x2, const image_point_t y2);
void image_move_to(engine_t *en, const image_point_t x, const image_point_t y);
+void image_show_text(engine_t *en, const char* text);

#endif
13 changes: 13 additions & 0 deletions graphics/a2png/files/patch-src_parse.c
@@ -0,0 +1,13 @@
--- src/parse.c.orig 2006-10-05 13:36:26 UTC
+++ src/parse.c
@@ -22,9 +22,8 @@ void scan_rgb(const char* s, rgb_t* color) {

// returns 1 if not EOF, 0 if EOF
// see note in parse_html for a rationale of this rather odd tokenizer function
-inline
int fgettok(FILE *f, char* buf, size_t buflen) {
- char c;
+ int c;

// read until we get start of a token
do {

0 comments on commit 06dfcbd

Please sign in to comment.