1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
8 SDESC[standard]= Graphics library for fast creation of images
9 HOMEPAGE= https://www.libgd.org/
13 SITES[main]= https://github.com/libgd/libgd/releases/download/gd-2.3.3/
14 DISTFILE[1]= libgd-2.3.3.tar.xz:main
16 SPKGS[standard]= single
18 OPTIONS_AVAILABLE= none
19 OPTIONS_STANDARD= none
21 BUILD_DEPENDS= WebP:dev:standard
22 BUILDRUN_DEPENDS= WebP:primary:standard
24 USES= cpe pkgconfig libtool:keepla shebangfix zlib jpeg
25 png tiff fontconfig solaris-funcs mbsdfix
31 FPC_EQUIVALENT= graphics/gd
32 SHEBANG_FILES= {{WRKSRC}}/src/bdftogd
33 SOL_FUNCTIONS= getline:src/annotate.c
36 CONFIGURE_ARGS= --with-xpm=no
38 PLIST_SUB= SOVERSION=6.0.11
44 -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \
47 -e 's|iconv|noiconv|' ${WRKSRC}/configure
50 ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \
51 ${STAGEDIR}${PREFIX}/include/
52 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so
54 [FILE:619:descriptions/desc.single]
55 gd is a graphics library. It allows your code to quickly draw images
56 complete with lines, arcs, text, multiple colors, cut and paste from
57 other images, and flood fills, and write out the result as a PNG, GIF
58 or JPEG file. This is particularly useful in World Wide Web applications,
59 where PNG, GIF and JPEG are three of the formats accepted for inline
60 images by most browsers.
62 gd does not provide for every possible desirable graphics operation,
63 but version 2.0 does include most frequently requested features,
64 including both truecolor and palette images, resampling (smooth
65 resizing of truecolor images) and so forth.
69 3fe822ece20796060af63b7c60acb151e5844204d289da0ce08f8fdf131e5a61 2809056 libgd-2.3.3.tar.xz
72 [FILE:377:manifests/plist.single]
105 libgd.so.%%SOVERSION%%
106 lib/pkgconfig/gdlib.pc
109 [FILE:1238:patches/patch-bdftogd]
110 --- src/bdftogd.orig 2021-09-11 04:41:44 UTC
112 @@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname
113 my $filename = shift;
114 $filename = 'gd' . $filename unless $filename =~ /^gd/i;
116 +my $gdfunc = $gdname;
117 +$gdfunc =~ s/(.*Font)(.*)/$1Get$2/;
119 if (-f "$filename.c") { die "File $filename.c already exists, won't overwrite\n"; }
120 if (-f "$filename.h") { die "File $filename.h already exists, won't overwrite\n"; }
122 @@ -139,6 +142,10 @@ print FILEC <<"EOF";
126 +#ifdef HAVE_CONFIG_H
130 #include "$filename.h"
132 char ${gdname}Data[] = {
133 @@ -177,28 +184,40 @@ gdFont ${gdname}Rep = {
137 -gdFontPtr ${gdname} = &${gdname}Rep;
138 +BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep;
140 -/* This file has not been truncated. */
141 +BGD_DECLARE(gdFontPtr)
147 +/* This file has not been truncated. */
166 -extern gdFontPtr $gdname;
167 +extern BGD_EXPORT_DATA_PROT gdFontPtr $gdname;
168 +BGD_DECLARE(gdFontPtr) $gdfunc(void);
180 [FILE:646:patches/patch-gd_png.c]
181 --- src/gd_png.c.orig 2021-09-11 04:43:11 UTC
183 @@ -276,6 +276,14 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
184 png_read_info (png_ptr, info_ptr); /* read all PNG info up to image data */
186 png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
188 + if (overflow2(sizeof (int), width)) {
191 + if (overflow2(sizeof (int) * width, height)) {
195 if ((color_type == PNG_COLOR_TYPE_RGB) || (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
196 || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
197 im = gdImageCreateTrueColor ((int) width, (int) height);
200 [FILE:1461:patches/patch-gdtest.c]
201 --- src/gdtest.c.orig 2021-09-11 04:43:11 UTC
203 @@ -34,6 +34,8 @@ main (int argc, char **argv)
210 fprintf(stderr, "Usage: gdtest filename.png\n");
212 @@ -62,6 +64,35 @@ main (int argc, char **argv)
214 CompareImages ("Initial Versions", ref, im);
217 + /* Send to GIF File then Ptr */
219 + sprintf(of, "%s.gif", argv[1]);
220 + out = fopen(of, "wb");
221 + gdImageGif(im, out);
224 + in = fopen(of, "rb");
226 + fprintf(stderr, "GIF Output file does not exist!\n");
229 + im2 = gdImageCreateFromGif(in);
232 + CompareImages("GD->GIF File->GD", ref, im2);
235 + gdImageDestroy(im2);
237 + iptr = gdImageGifPtr(im,&sz);
238 + ctx = gdNewDynamicCtx(sz,iptr);
239 + im2 = gdImageCreateFromGifCtx(ctx);
241 + CompareImages("GD->GIF ptr->GD", ref, im2);
243 + gdImageDestroy(im2);
247 /* Send to PNG File then Ptr */
248 @@ -317,6 +348,10 @@ main (int argc, char **argv)
249 printf ("[Merged Image has %d colours]\n", im2->colorsTotal);
250 CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3);
252 + out = fopen ("test/gdtest_merge_out.png", "wb");
253 + gdImagePng(im2, out);
256 gdImageDestroy (im2);
257 gdImageDestroy (im3);
261 [FILE:551:files/makefonts]
268 fonts="Tiny Small MediumBold Large Giant"
271 tar -xvzpf "${tarball}" $@
276 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
277 mv -v "gdfont${f}.c" "gdfont${f}.c.dist"
278 mv -v "gdfont${f}.h" "gdfont${f}.h.dist"
285 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
286 perl ./bdftogd "gdFont${font}" "font${f}" < "${1}"