Skip to content

Commit

Permalink
graphics/gd: update to 2.3.3
Browse files Browse the repository at this point in the history
- remove perfomance patch
- fix tests
- new options HEIF AVIF
  • Loading branch information
Dirk Meyer authored and Dirk Meyer committed Feb 22, 2022
1 parent 88c3cb9 commit 34ab3be
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 159 deletions.
25 changes: 20 additions & 5 deletions graphics/gd/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Created by: jeff@cetlink.net

PORTNAME= libgd
PORTVERSION= 2.3.1
PORTVERSION= 2.3.3
PORTREVISION= 0
PORTEPOCH= 1
CATEGORIES+= graphics
Expand All @@ -13,17 +13,20 @@ COMMENT?= Graphics library for fast creation of images
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING

CONFLICTS_INSTALL= libgd ??-libgd mummer # bin/bdftogd bin/gd2copypal bin/gd2togif bin/gd2topng bin/gdcmpgif bin/gdlib-config bin/gdparttopng bin/gdtopng bin/giftogd2
CONFLICTS_INSTALL= libgd ??-libgd

USES= cpe tar:xz pkgconfig pathfix libtool:keepla shebangfix
SHEBANG_FILES= ${WRKSRC}/src/bdftogd
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-gd-formats
TMPDIR?= /tmp
MAKE_ENV= TMPDIR=${TMPDIR}
SUB_FILES= gdlib-config
USE_LDCONFIG= yes
TEST_TARGET= check

OPTIONS_DEFINE= PNG JPEG WEBP TIFF FREETYPE FONTCONFIG RAQM XPM ICONV
OPTIONS_DEFAULT=PNG JPEG WEBP TIFF FREETYPE FONTCONFIG ICONV
OPTIONS_DEFINE= PNG JPEG WEBP HEIF AVIF TIFF FREETYPE FONTCONFIG RAQM XPM ICONV
OPTIONS_DEFAULT=PNG JPEG WEBP HEIF AVIF TIFF FREETYPE FONTCONFIG ICONV
NO_OPTIONS_SORT=yes
OPTIONS_SUB= yes
PNG_LIB_DEPENDS= libpng.so:graphics/png
Expand All @@ -35,6 +38,13 @@ JPEG_CPPFLAGS= -I${LOCALBASE}/include
WEBP_LIB_DEPENDS= libwebp.so:graphics/webp
WEBP_CONFIGURE_OFF= --without-webp
WEBP_CPPFLAGS= -I${LOCALBASE}/include
HEIF_LIB_DEPENDS= libheif.so:graphics/libheif
HEIF_CONFIGURE_OFF= --without-heif
HEIF_CPPFLAGS= -I${LOCALBASE}/include
AVIF_LIB_DEPENDS= libavif.so:graphics/libavif
AVIF_CONFIGURE_OFF= --without-avif
AVIF_CPPFLAGS= -I${LOCALBASE}/include
AVIF_USES= autoreconf
TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff
TIFF_CONFIGURE_OFF= --without-tiff
TIFF_CPPFLAGS= -I${LOCALBASE}/include
Expand All @@ -57,6 +67,11 @@ ICONV_CONFIGURE_ON= ${ICONV_CONFIGURE_ARG}

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MFREETYPE}
# bin/annotate
CONFLICTS_INSTALL+= mummer
.endif

# force gdlib-config --ldflags
LDFLAGS+= -L${LOCALBASE}/lib

Expand Down Expand Up @@ -92,7 +107,7 @@ pre-configure:
# bump shlib version
${REINPLACE_CMD} \
-e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \
${WRKSRC}/configure
${WRKSRC}/configure ${WRKSRC}/config/getlib.sh

pre-configure-ICONV-off:
${REINPLACE_CMD} \
Expand Down
6 changes: 3 additions & 3 deletions graphics/gd/distinfo
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TIMESTAMP = 1613146049
SHA256 (libgd-2.3.1.tar.xz) = 9767917d9f818faec4ddd763fe4a4ad9f6322c3d25da290ab2ea3e2ce4b52a7b
SIZE (libgd-2.3.1.tar.xz) = 2632076
TIMESTAMP = 1644860754
SHA256 (libgd-2.3.3.tar.xz) = 3fe822ece20796060af63b7c60acb151e5844204d289da0ce08f8fdf131e5a61
SIZE (libgd-2.3.3.tar.xz) = 2809056
11 changes: 11 additions & 0 deletions graphics/gd/files/patch-Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/Makefile.am.orig 2022-02-14 17:43:45 UTC
+++ src/Makefile.am
@@ -52,7 +52,7 @@ EXTRA_DIST = \
msinttypes/inttypes.h \
msinttypes/stdint.h

-include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gd_color_map.h gd_errors.h gdpp.h
+include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gd_color_map.h gd_errors.h gdpp.h gd_io_stream.h

lib_LTLIBRARIES = libgd.la

11 changes: 11 additions & 0 deletions graphics/gd/files/patch-Makefile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- src/Makefile.in.orig 2021-09-11 05:12:11 UTC
+++ src/Makefile.in
@@ -561,7 +561,7 @@ EXTRA_DIST = \
msinttypes/inttypes.h \
msinttypes/stdint.h

-include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gd_color_map.h gd_errors.h gdpp.h
+include_HEADERS = gd.h gdfx.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gd_color_map.h gd_errors.h gdpp.h gd_io_stream.h
lib_LTLIBRARIES = libgd.la
libgd_la_SOURCES = \
bmp.h \
4 changes: 2 additions & 2 deletions graphics/gd/files/patch-bdftogd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- src/bdftogd.orig 2017-01-29 09:45:57 UTC
--- src/bdftogd.orig 2021-09-11 04:41:44 UTC
+++ src/bdftogd
@@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname
@@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname =~ /^gd/i;
my $filename = shift;
$filename = 'gd' . $filename unless $filename =~ /^gd/i;

Expand Down
136 changes: 0 additions & 136 deletions graphics/gd/files/patch-gd.c

This file was deleted.

14 changes: 14 additions & 0 deletions graphics/gd/files/patch-gd.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- src/gd.h.orig 2021-09-11 04:52:47 UTC
+++ src/gd.h
@@ -1604,6 +1604,11 @@ BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im)
BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im);
BGD_DECLARE(void) gdImageFlipBoth(gdImagePtr im);

+#define GD_FLIP_HORINZONTAL 1 /* typo, kept for BC */
+#define GD_FLIP_HORIZONTAL 1
+#define GD_FLIP_VERTICAL 2
+#define GD_FLIP_BOTH 3
+
/**
* Group: Crop
*
4 changes: 2 additions & 2 deletions graphics/gd/files/patch-gd_png.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- src/gd_png.c.orig 2016-10-12 08:13:44 UTC
--- src/gd_png.c.orig 2021-09-11 04:43:11 UTC
+++ src/gd_png.c
@@ -277,6 +277,14 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
@@ -276,6 +276,14 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromPngCtx (gdIOC
png_read_info (png_ptr, info_ptr); /* read all PNG info up to image data */

png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
Expand Down
19 changes: 10 additions & 9 deletions graphics/gd/files/patch-gdtest.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- src/gdtest.c.orig 2015-09-16 11:34:29 UTC
--- src/gdtest.c.orig 2021-09-11 04:43:11 UTC
+++ src/gdtest.c
@@ -35,6 +35,8 @@ main (int argc, char **argv)
@@ -34,6 +34,8 @@ main (int argc, char **argv)
gdSink imgsnk;
int foreground;
int i;
Expand All @@ -9,7 +9,7 @@
if (argc != 2) {
fprintf(stderr, "Usage: gdtest filename.png\n");
exit (1);
@@ -63,6 +65,35 @@ main (int argc, char **argv)
@@ -62,7 +64,36 @@ main (int argc, char **argv)

CompareImages ("Initial Versions", ref, im);

Expand All @@ -20,7 +20,7 @@
+ out = fopen(of, "wb");
+ gdImageGif(im, out);
+ fclose(out);
+
+ in = fopen(of, "rb");
+ if (!in) {
+ fprintf(stderr, "GIF Output file does not exist!\n");
Expand All @@ -42,17 +42,18 @@
+
+ gdImageDestroy(im2);
+ ctx->gd_free(ctx);
+
/* */
/* Send to PNG File then Ptr */
@@ -334,6 +365,10 @@ main (int argc, char **argv)
/* */
@@ -316,6 +347,10 @@ main (int argc, char **argv)
}
printf ("[Merged Image has %d colours]\n", im2->colorsTotal);
CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3);
+
+ out = fopen ("test/gdtest_merge_out.png", "wb");
+ gdImagePng(im2, out);
+ fclose(out);
+
gdImageDestroy (im2);
gdImageDestroy (im3);

4 changes: 2 additions & 2 deletions graphics/gd/pkg-plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ bin/giftogd2
%%PNG%%bin/pngtogd
%%PNG%%bin/pngtogd2
%%PNG%%bin/webpng
include/entities.h
include/gd.h
include/gd_color_map.h
include/gd_errors.h
include/gd_io.h
include/gd_io_stream.h
include/gdcache.h
include/gdfontg.h
include/gdfontl.h
Expand All @@ -29,5 +29,5 @@ lib/libgd.a
lib/libgd.la
lib/libgd.so
lib/libgd.so.6
lib/libgd.so.6.0.9
lib/libgd.so.6.0.11
libdata/pkgconfig/gdlib.pc

0 comments on commit 34ab3be

Please sign in to comment.