diff --git a/graphics/gd/Makefile b/graphics/gd/Makefile index 28722c59e71b..6d0676e4628a 100644 --- a/graphics/gd/Makefile +++ b/graphics/gd/Makefile @@ -1,11 +1,14 @@ # Created by: jeff@cetlink.net PORTNAME= libgd -PORTVERSION= 2.3.1 +DISTVERSION= 2.3.3 PORTREVISION= 0 PORTEPOCH= 1 CATEGORIES+= graphics -MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/gd-${PORTVERSION}/ +MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/gd-${DISTVERSION}/ +PATCH_SITES= https://github.com/${PORTNAME}/${PORTNAME}/commit/ +PATCHFILES= f4bc1f5c26925548662946ed7cfa473c190a104a.patch:-p1 \ + 01bcbdcae35b90de082012e639094c711a7aa2b3.patch:-p1 MAINTAINER?= dinoex@FreeBSD.org COMMENT?= Graphics library for fast creation of images @@ -13,52 +16,54 @@ COMMENT?= Graphics library for fast creation of images LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING +LIB_DEPENDS= libavif.so:graphics/libavif \ + libheif.so:graphics/libheif \ + libfreetype.so:print/freetype2 \ + libfontconfig.so:x11-fonts/fontconfig \ + libpng.so:graphics/png \ + libwebp.so:graphics/webp + CONFLICTS_INSTALL= libgd ??-libgd mummer # bin/bdftogd bin/gd2copypal bin/gd2togif bin/gd2topng bin/gdcmpgif bin/gdlib-config bin/gdparttopng bin/gdtopng bin/giftogd2 -USES= cpe tar:xz pkgconfig pathfix libtool:keepla shebangfix -SHEBANG_FILES= ${WRKSRC}/src/bdftogd -GNU_CONFIGURE= yes -SUB_FILES= gdlib-config +#USES= cpe tar:xz pkgconfig pathfix libtool:keepla shebangfix +USES= cmake cpe jpeg perl5 pathfix pkgconfig shebangfix tar:xz +SHEBANG_FILES= src/bdftogd 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 -NO_OPTIONS_SORT=yes +TEST_TARGET= test +PORTDOCS= * + +CMAKE_ON= ENABLE_AVIF \ + ENABLE_HEIF \ + ENABLE_GD_FORMATS \ + ENABLE_FREETYPE \ + ENABLE_FONTCONFIG \ + ENABLE_JPEG \ + ENABLE_PNG \ + ENABLE_WEBP \ + VERBOSE_MAKEFILE + +#OPTIONS_DEFINE= DOCS ICONV TEST TIFF RAQM XPM +OPTIONS_DEFINE= DOCS ICONV TIFF RAQM XPM OPTIONS_SUB= yes -PNG_LIB_DEPENDS= libpng.so:graphics/png -PNG_CONFIGURE_OFF= --without-png -PNG_CPPFLAGS= -I${LOCALBASE}/include -JPEG_USES= jpeg -JPEG_CONFIGURE_OFF= --without-jpeg -JPEG_CPPFLAGS= -I${LOCALBASE}/include -WEBP_LIB_DEPENDS= libwebp.so:graphics/webp -WEBP_CONFIGURE_OFF= --without-webp -WEBP_CPPFLAGS= -I${LOCALBASE}/include -TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff -TIFF_CONFIGURE_OFF= --without-tiff -TIFF_CPPFLAGS= -I${LOCALBASE}/include -FREETYPE_LIB_DEPENDS= libfreetype.so:print/freetype2 -FREETYPE_CONFIGURE_OFF= --without-freetype -FREETYPE_CPPFLAGS= -I${LOCALBASE}/include -FONTCONFIG_LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig -FONTCONFIG_CONFIGURE_OFF= --with-fontconfig=no -FONTCONFIG_CPPFLAGS= -I${LOCALBASE}/include + RAQM_DESC= Raqm text layout support + +ICONV_USES= iconv +ICONV_CMAKE_BOOL= ENABLE_ICONV +#TEST_CMAKE_BOOL= BUILD_TEST +TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff +TIFF_CMAKE_BOOL= ENABLE_TIFF RAQM_LIB_DEPENDS= libraqm.so:print/libraqm -RAQM_CONFIGURE_OFF= --with-raqm=no -RAQM_CPPFLAGS= -I${LOCALBASE}/include -XPM_USES= xorg -XPM_USE= xorg=xpm,x11 -XPM_CONFIGURE_ON= --with-x -XPM_CONFIGURE_OFF= --with-xpm=no -ICONV_USES= iconv -ICONV_CONFIGURE_ON= ${ICONV_CONFIGURE_ARG} +RAQM_CMAKE_BOOL= ENABLE_RAQM +XPM_USES= xorg +XPM_USE= xorg=xpm,x11 +XPM_CMAKE_BOOL= ENABLE_XPM -.include +#.include # force gdlib-config --ldflags -LDFLAGS+= -L${LOCALBASE}/lib +# LDFLAGS+= -L${LOCALBASE}/lib # The GD_FONTS environment variable can be set to specify the gzipped # tar-ball containing the fonts in bdf format and the bdf file names. @@ -69,46 +74,39 @@ LDFLAGS+= -L${LOCALBASE}/lib # GD_FONTS="/usr/ports/distfiles/x-koi8u.tgz koi6x10.bdf koi8x13.bdf \ # koi9x15.bdf koi12x24.bdf koi10x20.bdf" # -.if defined(GD_FONTS) -USES+= perl5 -USE_PERL5= build -WRKFONTS= ${WRKSRC}/src -.endif - -pre-extract:: - @${ECHO_MSG} "" - @${ECHO_MSG} "GD_FONTS can be set to specify an alternative list of .bdf files" - @${ECHO_MSG} "" - -post-extract: -.if defined(GD_FONTS) - cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts extract ${GD_FONTS} -.endif - -pre-configure: -.if defined(GD_FONTS) - cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts configure ${GD_FONTS} -.endif - # bump shlib version - ${REINPLACE_CMD} \ - -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \ - ${WRKSRC}/configure - -pre-configure-ICONV-off: - ${REINPLACE_CMD} \ - -e 's|iconv|noiconv|' \ - ${WRKSRC}/configure - -.if defined(GD_FONTS) -pre-build: - cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts build ${GD_FONTS} -.endif - -post-install: - ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \ - ${STAGEDIR}${PREFIX}/include/ - ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so.6* - ${INSTALL_SCRIPT} ${WRKDIR}/gdlib-config \ - ${STAGEDIR}${PREFIX}/bin/ +#.if defined(GD_FONTS) +#WRKFONTS= ${WRKSRC}/src +#.endif + +#pre-extract:: +# @${ECHO_MSG} "" +# @${ECHO_MSG} "GD_FONTS can be set to specify an alternative list of .bdf files" +# @${ECHO_MSG} "" + +#post-extract: +#.if defined(GD_FONTS) +# cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts extract ${GD_FONTS} +#.endif + +#pre-configure: +#.if defined(GD_FONTS) +# cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts configure ${GD_FONTS} +#.endif +# # bump shlib version +# ${REINPLACE_CMD} \ +# -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \ +# ${WRKSRC}/configure + +#.if defined(GD_FONTS) +#pre-build: +# cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts build ${GD_FONTS} +#.endif + +#post-install: +# ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \ +# ${STAGEDIR}${PREFIX}/include/ +# ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so.6* +# ${INSTALL_SCRIPT} ${WRKDIR}/gdlib-config \ +# ${STAGEDIR}${PREFIX}/bin/ .include diff --git a/graphics/gd/distinfo b/graphics/gd/distinfo index c82be508530b..3350b5c7b539 100644 --- a/graphics/gd/distinfo +++ b/graphics/gd/distinfo @@ -1,3 +1,7 @@ -TIMESTAMP = 1613146049 -SHA256 (libgd-2.3.1.tar.xz) = 9767917d9f818faec4ddd763fe4a4ad9f6322c3d25da290ab2ea3e2ce4b52a7b -SIZE (libgd-2.3.1.tar.xz) = 2632076 +TIMESTAMP = 1643567428 +SHA256 (libgd-2.3.3.tar.xz) = 3fe822ece20796060af63b7c60acb151e5844204d289da0ce08f8fdf131e5a61 +SIZE (libgd-2.3.3.tar.xz) = 2809056 +SHA256 (f4bc1f5c26925548662946ed7cfa473c190a104a.patch) = 5c3032164ba8050e0d7223d2a7bf1b96b44e6ee3738b91f98b90b15bd98d9fff +SIZE (f4bc1f5c26925548662946ed7cfa473c190a104a.patch) = 824 +SHA256 (01bcbdcae35b90de082012e639094c711a7aa2b3.patch) = 461d9f4b193eec14d384a5e9f68e9d2574cf81f1b5b2ef3f2f0df65343b75193 +SIZE (01bcbdcae35b90de082012e639094c711a7aa2b3.patch) = 1130 diff --git a/graphics/gd/files/gdlib-config.in b/graphics/gd/files/gdlib-config.in deleted file mode 100644 index e05a7f021a3e..000000000000 --- a/graphics/gd/files/gdlib-config.in +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# -# Return information about the local GD library installation -# -# Modeled for ports: -# audio/mp3plot -# devel/cvsgraph -# graphics/R-cran-GDD -# graphics/a2png -# graphics/gdtclft -# graphics/lua-gd -# graphics/mscgen -# graphics/p5-GD -# math/gnuplot -# net-p2p/amule -# net-p2p/mldonkey -# science/octopus - -echo "gdlib-config: warning: this script is deprecated;" \ - "please use the pkg-config file instead." >&2 -sleep 10 - -# installation directories -prefix=%%PREFIX%% -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include -bindir=${exec_prefix}/bin - -usage() -{ - cat <&2 -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --libdir) - echo "${libdir}" - ;; - --includedir) - echo "${includedir}" - ;; - --version) - echo "%%PORTVERSION%%" - ;; - --majorversion) - echo %%MAJORVERSION%% - ;; - --minorversion) - echo 2 - ;; - --revision) - echo 5 - ;; - --ldflags) - echo " -L${prefix}/lib -fstack-protector-strong " - ;; - --libs) - echo "-lgd" - ;; - --cflags|--includes) - echo "-I${includedir}" - ;; - --features) - echo GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_ZLIB GD_PNG GD_FREETYPE GD_FONTCONFIG GD_JPEG GD_TIFF GD_WEBP - ;; - --all) - echo "GD library 2.2.5" - echo "includedir: ${includedir}" - echo "cflags: -I${includedir}" - echo "ldflags: -L${prefix}/lib -fstack-protector-strong " - echo "libs: -lgd" - echo "libdir: $libdir" - echo "features: GD_GIF GD_GIFANIM GD_OPENPOLYGON GD_ZLIB GD_PNG GD_FREETYPE GD_FONTCONFIG GD_JPEG GD_TIFF GD_WEBP" - ;; - *) - usage 1 1>&2 - ;; - esac - shift -done diff --git a/graphics/gd/files/makefonts b/graphics/gd/files/makefonts deleted file mode 100644 index 62868129cad1..000000000000 --- a/graphics/gd/files/makefonts +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -target="${1}" -shift -tarball="${1}" -shift -fonts="Tiny Small MediumBold Large Giant" -case "${target}" in -extract) - tar -xvzpf "${tarball}" $@ - ;; -configure) - for font in ${fonts} - do - f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]` - mv -v "gdfont${f}.c" "gdfont${f}.c.dist" - mv -v "gdfont${f}.h" "gdfont${f}.h.dist" - done - ;; -build) - set -x - for font in ${fonts} - do - f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]` - perl ./bdftogd "gdFont${font}" "font${f}" < "${1}" - shift - done - ;; -esac -# eof diff --git a/graphics/gd/files/patch-CMakeLists.txt b/graphics/gd/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..5bbaf50d9a53 --- /dev/null +++ b/graphics/gd/files/patch-CMakeLists.txt @@ -0,0 +1,49 @@ +--- CMakeLists.txt.orig 2022-01-30 22:18:03 UTC ++++ CMakeLists.txt +@@ -318,27 +318,27 @@ else(WIN32) + endif(WIN32) + + +-INSTALL(FILES docs/INSTALL DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES docs/README.JPN DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES docs/README.CMAKE DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES docs/README.TESTING DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES docs/README.TXT DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) ++INSTALL(FILES docs/INSTALL DESTINATION share/doc/gd) ++INSTALL(FILES docs/README.JPN DESTINATION share/doc/gd) ++INSTALL(FILES docs/README.CMAKE DESTINATION share/doc/gd) ++INSTALL(FILES docs/README.TESTING DESTINATION share/doc/gd) ++INSTALL(FILES docs/README.TXT DESTINATION share/doc/gd) + + +-INSTALL(FILES examples/arc.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/copyrotated.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/crop.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/flip.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/gif.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/nnquant.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/noIcon.pic DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/noIcon.sgi DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/noIcon.tga DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/noIconAlpha.tga DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/test_crop_threshold.png DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/tgaread.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/tiffread.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) +-INSTALL(FILES examples/windows.c DESTINATION share/doc/gd-${GDLIB_MAJOR}.${GDLIB_MINOR}) ++INSTALL(FILES examples/arc.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/copyrotated.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/crop.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/flip.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/gif.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/nnquant.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/noIcon.pic DESTINATION share/doc/gd) ++INSTALL(FILES examples/noIcon.sgi DESTINATION share/doc/gd) ++INSTALL(FILES examples/noIcon.tga DESTINATION share/doc/gd) ++INSTALL(FILES examples/noIconAlpha.tga DESTINATION share/doc/gd) ++INSTALL(FILES examples/test_crop_threshold.png DESTINATION share/doc/gd) ++INSTALL(FILES examples/tgaread.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/tiffread.c DESTINATION share/doc/gd) ++INSTALL(FILES examples/windows.c DESTINATION share/doc/gd) + + + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") diff --git a/graphics/gd/files/patch-bdftogd b/graphics/gd/files/patch-bdftogd deleted file mode 100644 index 450d1a048ded..000000000000 --- a/graphics/gd/files/patch-bdftogd +++ /dev/null @@ -1,68 +0,0 @@ ---- src/bdftogd.orig 2017-01-29 09:45:57 UTC -+++ src/bdftogd -@@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname - my $filename = shift; - $filename = 'gd' . $filename unless $filename =~ /^gd/i; - -+my $gdfunc = $gdname; -+$gdfunc =~ s/(.*Font)(.*)/$1Get$2/; -+ - if (-f "$filename.c") { die "File $filename.c already exists, won't overwrite\n"; } - if (-f "$filename.h") { die "File $filename.h already exists, won't overwrite\n"; } - -@@ -139,6 +142,10 @@ print FILEC <<"EOF"; - - $info - -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ - #include "$filename.h" - - char ${gdname}Data[] = { -@@ -177,28 +184,40 @@ gdFont ${gdname}Rep = { - ${gdname}Data - }; - --gdFontPtr ${gdname} = &${gdname}Rep; -+BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep; - --/* This file has not been truncated. */ -+BGD_DECLARE(gdFontPtr) -+$gdfunc (void) -+{ -+ return $gdname; -+} - -+/* This file has not been truncated. */ - EOF - - - close FILEC; - - print FILEH <<"EOF"; -- - #ifndef $capdef - #define $capdef 1 - -+#ifdef __cplusplus -+extern "C" { -+#endif -+ - $info - - #include "gd.h" - --extern gdFontPtr $gdname; -+extern BGD_EXPORT_DATA_PROT gdFontPtr $gdname; -+BGD_DECLARE(gdFontPtr) $gdfunc(void); - -+#ifdef __cplusplus -+} - #endif - -+#endif - EOF - - 1; diff --git a/graphics/gd/files/patch-gd.c b/graphics/gd/files/patch-gd.c deleted file mode 100644 index a4e142c83b31..000000000000 --- a/graphics/gd/files/patch-gd.c +++ /dev/null @@ -1,136 +0,0 @@ -index d8eaf43..d852068 100644 ---- src/gd.c -+++ src/gd.c -@@ -66,6 +66,9 @@ static const unsigned char gd_toascii[256] = { - }; - #endif /*CHARSET_EBCDIC */ - -+/* 2.0.10: cast instead of floor() yields 35% performance improvement. Thanks to John Buckman. */ -+#define floor_cast(exp) ((long) exp) -+ - extern const int gdCosT[]; - extern const int gdSinT[]; - -@@ -3452,50 +3455,51 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, - int dstW, int dstH, int srcW, int srcH) - { - int x, y; -+ double sy1, sy2, sx1, sx2; -+ - if (!dst->trueColor) { - gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); - return; - } - for (y = dstY; (y < dstY + dstH); y++) { -+ sy1 = ((double) y - (double) dstY) * (double) srcH / (double) dstH; -+ sy2 = ((double) (y + 1) - (double) dstY) * (double) srcH / (double) dstH; - for (x = dstX; (x < dstX + dstW); x++) { -- float sy1, sy2, sx1, sx2; -- float sx, sy; -- float spixels = 0.0; -- float red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; -- float alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0; -- sy1 = ((float)(y - dstY)) * (float)srcH / (float)dstH; -- sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH; -+ double sx, sy; -+ double spixels = 0; -+ double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; -+ double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0; -+ sx1 = ((double) x - (double) dstX) * (double) srcW / dstW; -+ sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW; - sy = sy1; - do { -- float yportion; -- if (floorf(sy) == floorf(sy1)) { -- yportion = 1.0 - (sy - floorf(sy)); -+ double yportion; -+ if (floor_cast(sy) == floor_cast(sy1)) { -+ yportion = 1.0f - (sy - floor_cast(sy)); - if (yportion > sy2 - sy1) { - yportion = sy2 - sy1; - } -- sy = floorf(sy); -+ sy = floor_cast(sy); - } else if (sy == floorf(sy2)) { -- yportion = sy2 - floorf(sy2); -+ yportion = sy2 - floor_cast(sy2); - } else { -- yportion = 1.0; -+ yportion = 1.0f; - } -- sx1 = ((float)(x - dstX)) * (float) srcW / dstW; -- sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW; - sx = sx1; - do { -- float xportion; -- float pcontribution; -+ double xportion; -+ double pcontribution; - int p; -- if (floorf(sx) == floorf(sx1)) { -- xportion = 1.0 - (sx - floorf(sx)); -+ if (floorf(sx) == floor_cast(sx1)) { -+ xportion = 1.0f - (sx - floor_cast(sx)); - if (xportion > sx2 - sx1) { - xportion = sx2 - sx1; - } -- sx = floorf(sx); -+ sx = floor_cast(sx); - } else if (sx == floorf(sx2)) { -- xportion = sx2 - floorf(sx2); -+ xportion = sx2 - floor_cast(sx2); - } else { -- xportion = 1.0; -+ xportion = 1.0f; - } - pcontribution = xportion * yportion; - p = gdImageGetTrueColorPixel(src, (int) sx + srcX, (int) sy + srcY); -@@ -3508,21 +3512,24 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, - alpha_sum += alpha_factor; - contrib_sum += pcontribution; - spixels += xportion * yportion; -- sx += 1.0; -+ sx += 1.0f; - } - while (sx < sx2); -+ - sy += 1.0f; - } -+ - while (sy < sy2); - -- if (spixels != 0.0) { -+ if (spixels != 0.0f) { - red /= spixels; - green /= spixels; - blue /= spixels; - alpha /= spixels; -+ alpha += 0.5; - } -- if ( alpha_sum != 0.0) { -- if( contrib_sum != 0.0) { -+ if ( alpha_sum != 0.0f) { -+ if( contrib_sum != 0.0f) { - alpha_sum /= contrib_sum; - } - red /= alpha_sum; -@@ -3530,14 +3537,14 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, - blue /= alpha_sum; - } - /* Clamping to allow for rounding errors above */ -- if (red > 255.0) { -- red = 255.0; -+ if (red > 255.0f) { -+ red = 255.0f; - } -- if (green > 255.0) { -- green = 255.0; -+ if (green > 255.0f) { -+ green = 255.0f; - } - if (blue > 255.0f) { -- blue = 255.0; -+ blue = 255.0f; - } - if (alpha > gdAlphaMax) { - alpha = gdAlphaMax; diff --git a/graphics/gd/files/patch-gd_png.c b/graphics/gd/files/patch-gd_png.c deleted file mode 100644 index ac3565d86808..000000000000 --- a/graphics/gd/files/patch-gd_png.c +++ /dev/null @@ -1,17 +0,0 @@ ---- src/gd_png.c.orig 2016-10-12 08:13:44 UTC -+++ src/gd_png.c -@@ -277,6 +277,14 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro - 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); -+ -+ if (overflow2(sizeof (int), width)) { -+ return NULL; -+ } -+ if (overflow2(sizeof (int) * width, height)) { -+ return NULL; -+ } -+ - if ((color_type == PNG_COLOR_TYPE_RGB) || (color_type == PNG_COLOR_TYPE_RGB_ALPHA) - || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - im = gdImageCreateTrueColor ((int) width, (int) height); diff --git a/graphics/gd/files/patch-gdtest.c b/graphics/gd/files/patch-gdtest.c deleted file mode 100644 index f2c9a0ff2ced..000000000000 --- a/graphics/gd/files/patch-gdtest.c +++ /dev/null @@ -1,58 +0,0 @@ ---- src/gdtest.c.orig 2015-09-16 11:34:29 UTC -+++ src/gdtest.c -@@ -35,6 +35,8 @@ main (int argc, char **argv) - gdSink imgsnk; - int foreground; - int i; -+ gdIOCtx *ctx; -+ - if (argc != 2) { - fprintf(stderr, "Usage: gdtest filename.png\n"); - exit (1); -@@ -63,6 +65,35 @@ main (int argc, char **argv) - - CompareImages ("Initial Versions", ref, im); - -+ /* */ -+ /* Send to GIF File then Ptr */ -+ /* */ -+ sprintf(of, "%s.gif", argv[1]); -+ out = fopen(of, "wb"); -+ gdImageGif(im, out); -+ fclose(out); -+ -+ in = fopen(of, "rb"); -+ if (!in) { -+ fprintf(stderr, "GIF Output file does not exist!\n"); -+ exit(1); -+ } -+ im2 = gdImageCreateFromGif(in); -+ fclose(in); -+ -+ CompareImages("GD->GIF File->GD", ref, im2); -+ -+ unlink(of); -+ gdImageDestroy(im2); -+ -+ iptr = gdImageGifPtr(im,&sz); -+ ctx = gdNewDynamicCtx(sz,iptr); -+ im2 = gdImageCreateFromGifCtx(ctx); -+ -+ CompareImages("GD->GIF ptr->GD", ref, im2); -+ -+ gdImageDestroy(im2); -+ ctx->gd_free(ctx); - - /* */ - /* Send to PNG File then Ptr */ -@@ -334,6 +365,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); - diff --git a/graphics/gd/pkg-plist b/graphics/gd/pkg-plist index 33ea9e973102..471ab9ea63e0 100644 --- a/graphics/gd/pkg-plist +++ b/graphics/gd/pkg-plist @@ -1,21 +1,20 @@ -%%FREETYPE%%%%JPEG%%bin/annotate +bin/annotate bin/bdftogd bin/gd2copypal bin/gd2togif -%%PNG%%bin/gd2topng +bin/gd2topng bin/gdcmpgif -bin/gdlib-config -%%PNG%%bin/gdparttopng -%%PNG%%bin/gdtopng +bin/gdparttopng +bin/gdtopng bin/giftogd2 -%%PNG%%bin/pngtogd -%%PNG%%bin/pngtogd2 -%%PNG%%bin/webpng -include/entities.h +bin/pngtogd +bin/pngtogd2 +bin/webpng 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 @@ -23,11 +22,27 @@ include/gdfontmb.h include/gdfonts.h include/gdfontt.h include/gdfx.h -include/gdhelpers.h include/gdpp.h -lib/libgd.a -lib/libgd.la lib/libgd.so -lib/libgd.so.6 -lib/libgd.so.6.0.9 +lib/libgd.so.3 +lib/libgd.so.3.0.11 libdata/pkgconfig/gdlib.pc +%%PORTDOCS%%share/doc/gd/INSTALL +%%PORTDOCS%%share/doc/gd/README.CMAKE +%%PORTDOCS%%share/doc/gd/README.JPN +%%PORTDOCS%%share/doc/gd/README.TESTING +%%PORTDOCS%%share/doc/gd/README.TXT +%%PORTDOCS%%share/doc/gd/arc.c +%%PORTDOCS%%share/doc/gd/copyrotated.c +%%PORTDOCS%%share/doc/gd/crop.c +%%PORTDOCS%%share/doc/gd/flip.c +%%PORTDOCS%%share/doc/gd/gif.c +%%PORTDOCS%%share/doc/gd/nnquant.c +%%PORTDOCS%%share/doc/gd/noIcon.pic +%%PORTDOCS%%share/doc/gd/noIcon.sgi +%%PORTDOCS%%share/doc/gd/noIcon.tga +%%PORTDOCS%%share/doc/gd/noIconAlpha.tga +%%PORTDOCS%%share/doc/gd/test_crop_threshold.png +%%PORTDOCS%%share/doc/gd/tgaread.c +%%PORTDOCS%%share/doc/gd/tiffread.c +%%PORTDOCS%%share/doc/gd/windows.c