From a817aad49f6407ace4179b35c915c74952194be3 Mon Sep 17 00:00:00 2001 From: Robert Clausecker Date: Wed, 14 Jul 2021 14:10:23 +0200 Subject: [PATCH] graphics/jpgtn: unbreak build Also remove the archaic pre-everything target from the Makefile, simplify the Makefile, add SF as another master site and set LICENSE. Take over maintainership of this unmaintained port. --- graphics/jpgtn/Makefile | 31 +++++--------------------- graphics/jpgtn/files/patch-src_jpgtn.c | 16 +++++++++++++ graphics/jpgtn/files/patch-src_jpgtn.h | 23 +++++++++++++++++++ 3 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 graphics/jpgtn/files/patch-src_jpgtn.c create mode 100644 graphics/jpgtn/files/patch-src_jpgtn.h diff --git a/graphics/jpgtn/Makefile b/graphics/jpgtn/Makefile index 8ed1ce7d43bf..717ff173975f 100644 --- a/graphics/jpgtn/Makefile +++ b/graphics/jpgtn/Makefile @@ -2,15 +2,15 @@ PORTNAME= jpgtn PORTVERSION= 2.06 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= graphics -MASTER_SITES= SUNSITE/apps/graphics/misc +MASTER_SITES= SF SUNSITE/apps/graphics/misc -MAINTAINER= ports@FreeBSD.org +MAINTAINER= fuz@fuz.su COMMENT= Creates thumbnails of JPEG images -BROKEN_FreeBSD_13= ld: error: duplicate symbol: background -BROKEN_FreeBSD_14= ld: error: duplicate symbol: background +LICENSE= GPLv2+ +LICENSE_FILE= ${WRKSRC}/COPYING USES= jpeg GNU_CONFIGURE= yes @@ -23,34 +23,13 @@ WITH_MAXSIZE?= 2048 WITH_MINSIZE?= 1 WITH_DEFSIZE?= 128 -pre-everything:: - @${ECHO_MSG} "===>" - @${ECHO_MSG} "===> You can control program functionality by defining the following variables:" - @${ECHO_MSG} "===>" -.if !defined(WITH_MAXSIZE) - @${ECHO_MSG} "===> Define WITH_MAXSIZE to set the maximum allowable thumbnail size" -.endif -.if !defined(WITH_MINSIZE) - @${ECHO_MSG} "===> Define WITH_MINSIZE to set the minimum allowable thumbnail size" -.endif -.if !defined(WITH_DEFSIZE) - @${ECHO_MSG} "===> Define WITH_DEFSIZE to set the default thumbnail size" -.endif - @${ECHO_MSG} "===>" - post-patch: -.if defined(WITH_MAXSIZE) @${ECHO_MSG} "Setting MAXSIZE to ${WITH_MAXSIZE}" @${REINPLACE_CMD} "s/define MAXSIZE[[:blank:]]*2048/define MAXSIZE ${WITH_MAXSIZE}/" ${WRKSRC}/src/jpgtn.h -.endif -.if defined(WITH_MINSIZE) @${ECHO_MSG} "Setting MINSIZE to ${WITH_MINSIZE}" @${REINPLACE_CMD} "s/define MINSIZE[[:blank:]]*1/define MINSIZE ${WITH_MINSIZE}/" ${WRKSRC}/src/jpgtn.h -.endif -.if defined(WITH_DEFSIZE) @${ECHO_MSG} "Setting DEFAULTSIZE to ${WITH_DEFSIZE}" @${REINPLACE_CMD} "s/define DEFAULTSIZE[[:blank:]]*128/define DEFAULTSIZE ${WITH_DEFSIZE}/" ${WRKSRC}/src/jpgtn.h -.endif @${REINPLACE_CMD} "s/(2-2048) the size defaults to 128/(${WITH_MINSIZE}-${WITH_MAXSIZE}) the size defaults to ${WITH_DEFSIZE}/" \ ${WRKSRC}/doc/jpgtn.1 diff --git a/graphics/jpgtn/files/patch-src_jpgtn.c b/graphics/jpgtn/files/patch-src_jpgtn.c new file mode 100644 index 000000000000..eece8b6980c9 --- /dev/null +++ b/graphics/jpgtn/files/patch-src_jpgtn.c @@ -0,0 +1,16 @@ +--- src/jpgtn.c.orig 2021-07-14 12:00:52 UTC ++++ src/jpgtn.c +@@ -30,6 +30,13 @@ + #include "common.h" + #include "jpgtn.h" + ++unsigned char *outimage; /* The current thumbnail image */ ++unsigned char *palette; /* Global palette pointer */ ++int width; /* Original image width */ ++int height; /* Original image height */ ++int background; /* Index's background color */ ++long out_wide; /* Width of thumbnail image */ ++long out_high; /* Height of thumbnail image */ + + /* Private */ + static void print_version(void); diff --git a/graphics/jpgtn/files/patch-src_jpgtn.h b/graphics/jpgtn/files/patch-src_jpgtn.h new file mode 100644 index 000000000000..ed1850edb63f --- /dev/null +++ b/graphics/jpgtn/files/patch-src_jpgtn.h @@ -0,0 +1,23 @@ +--- src/jpgtn.h.orig 2021-07-14 12:00:47 UTC ++++ src/jpgtn.h +@@ -36,13 +36,13 @@ + #define RSZ_WIDTH 1 + #define RSZ_HEIGHT 2 + +-unsigned char *outimage; /* The current thumbnail image */ +-unsigned char *palette; /* Global palette pointer */ +-int width; /* Original image width */ +-int height; /* Original image height */ +-int background; /* Index's background color */ +-long out_wide; /* Width of thumbnail image */ +-long out_high; /* Height of thumbnail image */ ++extern unsigned char *outimage; /* The current thumbnail image */ ++extern unsigned char *palette; /* Global palette pointer */ ++extern int width; /* Original image width */ ++extern int height; /* Original image height */ ++extern int background; /* Index's background color */ ++extern long out_wide; /* Width of thumbnail image */ ++extern long out_high; /* Height of thumbnail image */ + + + /* resizepic.c */ -- 2.32.0