# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= libGD VERSION= 2.3.3 REVISION= 1 KEYWORDS= graphics VARIANTS= standard SDESC[standard]= Graphics library for fast creation of images HOMEPAGE= https://www.libgd.org/ CONTACT= nobody DOWNLOAD_GROUPS= main SITES[main]= https://github.com/libgd/libgd/releases/download/gd-2.3.3/ DISTFILE[1]= libgd-2.3.3.tar.xz:main DF_INDEX= 1 SPKGS[standard]= single OPTIONS_AVAILABLE= none OPTIONS_STANDARD= none BUILD_DEPENDS= WebP:dev:standard BUILDRUN_DEPENDS= WebP:primary:standard USES= cpe pkgconfig libtool:keepla shebangfix zlib jpeg png tiff fontconfig solaris-funcs mbsdfix DISTNAME= libgd-2.3.3 CPE_PRODUCT= libgd CPE_VENDOR= libgd FPC_EQUIVALENT= graphics/gd SHEBANG_FILES= {{WRKSRC}}/src/bdftogd SOL_FUNCTIONS= getline:src/annotate.c MUST_CONFIGURE= gnu CONFIGURE_ARGS= --with-xpm=no PLIST_SUB= SOVERSION=6.0.11 SOMAJOR=6 post-patch: # bump shlib version ${REINPLACE_CMD} \ -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \ ${WRKSRC}/configure ${REINPLACE_CMD} \ -e 's|iconv|noiconv|' ${WRKSRC}/configure post-install: ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \ ${STAGEDIR}${PREFIX}/include/ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so [FILE:619:descriptions/desc.single] gd is a graphics library. It allows your code to quickly draw images complete with lines, arcs, text, multiple colors, cut and paste from other images, and flood fills, and write out the result as a PNG, GIF or JPEG file. This is particularly useful in World Wide Web applications, where PNG, GIF and JPEG are three of the formats accepted for inline images by most browsers. gd does not provide for every possible desirable graphics operation, but version 2.0 does include most frequently requested features, including both truecolor and palette images, resampling (smooth resizing of truecolor images) and so forth. [FILE:97:distinfo] 3fe822ece20796060af63b7c60acb151e5844204d289da0ce08f8fdf131e5a61 2809056 libgd-2.3.3.tar.xz [FILE:377:manifests/plist.single] bin/ annotate bdftogd gd2copypal gd2togif gd2topng gdcmpgif gdparttopng gdtopng giftogd2 pngtogd pngtogd2 webpng include/ gd.h gd_color_map.h gd_errors.h gd_io.h gdcache.h gdfontg.h gdfontl.h gdfontmb.h gdfonts.h gdfontt.h gdfx.h gdhelpers.h gdpp.h lib/ libgd.a libgd.la libgd.so libgd.so.%%SOMAJOR%% libgd.so.%%SOVERSION%% lib/pkgconfig/gdlib.pc [FILE:1238:patches/patch-bdftogd] --- src/bdftogd.orig 2021-09-11 04:41:44 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; [FILE:646:patches/patch-gd_png.c] --- src/gd_png.c.orig 2021-09-11 04:43:11 UTC +++ src/gd_png.c @@ -276,6 +276,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); [FILE:1461:patches/patch-gdtest.c] --- src/gdtest.c.orig 2021-09-11 04:43:11 UTC +++ src/gdtest.c @@ -34,6 +34,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); @@ -62,6 +64,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 */ @@ -317,6 +348,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); [FILE:551:files/makefonts] #!/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