1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= Graphics library for fast creation of images
8 HOMEPAGE= https://www.libgd.org/
12 SITES[main]= https://github.com/libgd/libgd/releases/download/gd-2.2.5/
13 DISTFILE[1]= libgd-2.2.5.tar.xz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILDRUN_DEPENDS= WebP:single:standard
21 fontconfig:primary:standard
22 freetype:primary:standard
24 USES= pkgconfig libtool:keepla shebangfix zlib
28 FPC_EQUIVALENT= graphics/gd
29 SHEBANG_FILES= {{WRKSRC}}/src/bdftogd
32 CONFIGURE_ARGS= --with-xpm=no
34 PLIST_SUB= SOVERSION=6.0.5
40 -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \
43 -e 's|iconv|noiconv|' ${WRKSRC}/configure
46 ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \
47 ${STAGEDIR}${PREFIX}/include/
48 ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so
50 [FILE:619:descriptions/desc.single]
51 gd is a graphics library. It allows your code to quickly draw images
52 complete with lines, arcs, text, multiple colors, cut and paste from
53 other images, and flood fills, and write out the result as a PNG, GIF
54 or JPEG file. This is particularly useful in World Wide Web applications,
55 where PNG, GIF and JPEG are three of the formats accepted for inline
56 images by most browsers.
58 gd does not provide for every possible desirable graphics operation,
59 but version 2.0 does include most frequently requested features,
60 including both truecolor and palette images, resampling (smooth
61 resizing of truecolor images) and so forth.
65 8c302ccbf467faec732f0741a859eef4ecae22fea2d2ab87467be940842bde51 2594092 libgd-2.2.5.tar.xz
68 [FILE:403:manifests/plist.single]
103 libgd.so.%%SOVERSION%%
104 lib/pkgconfig/gdlib.pc
107 [FILE:1239:patches/patch-bdftogd]
108 --- src/bdftogd.orig 2017-01-29 09:45:57 UTC
110 @@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname
111 my $filename = shift;
112 $filename = 'gd' . $filename unless $filename =~ /^gd/i;
114 +my $gdfunc = $gdname;
115 +$gdfunc =~ s/(.*Font)(.*)/$1Get$2/;
117 if (-f "$filename.c") { die "File $filename.c already exists, won't overwrite\n"; }
118 if (-f "$filename.h") { die "File $filename.h already exists, won't overwrite\n"; }
120 @@ -139,6 +142,10 @@ print FILEC <<"EOF";
124 +#ifdef HAVE_CONFIG_H
128 #include "$filename.h"
130 char ${gdname}Data[] = {
131 @@ -177,28 +184,40 @@ gdFont ${gdname}Rep = {
135 -gdFontPtr ${gdname} = &${gdname}Rep;
136 +BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep;
138 -/* This file has not been truncated. */
139 +BGD_DECLARE(gdFontPtr)
145 +/* This file has not been truncated. */
164 -extern gdFontPtr $gdname;
165 +extern BGD_EXPORT_DATA_PROT gdFontPtr $gdname;
166 +BGD_DECLARE(gdFontPtr) $gdfunc(void);
178 [FILE:646:patches/patch-gd_png.c]
179 --- src/gd_png.c.orig 2016-10-12 08:13:44 UTC
181 @@ -277,6 +277,14 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
182 png_read_info (png_ptr, info_ptr); /* read all PNG info up to image data */
184 png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
186 + if (overflow2(sizeof (int), width)) {
189 + if (overflow2(sizeof (int) * width, height)) {
193 if ((color_type == PNG_COLOR_TYPE_RGB) || (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
194 || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
195 im = gdImageCreateTrueColor ((int) width, (int) height);
198 [FILE:1461:patches/patch-gdtest.c]
199 --- src/gdtest.c.orig 2015-09-16 11:34:29 UTC
201 @@ -35,6 +35,8 @@ main (int argc, char **argv)
208 fprintf(stderr, "Usage: gdtest filename.png\n");
210 @@ -63,6 +65,35 @@ main (int argc, char **argv)
212 CompareImages ("Initial Versions", ref, im);
215 + /* Send to GIF File then Ptr */
217 + sprintf(of, "%s.gif", argv[1]);
218 + out = fopen(of, "wb");
219 + gdImageGif(im, out);
222 + in = fopen(of, "rb");
224 + fprintf(stderr, "GIF Output file does not exist!\n");
227 + im2 = gdImageCreateFromGif(in);
230 + CompareImages("GD->GIF File->GD", ref, im2);
233 + gdImageDestroy(im2);
235 + iptr = gdImageGifPtr(im,&sz);
236 + ctx = gdNewDynamicCtx(sz,iptr);
237 + im2 = gdImageCreateFromGifCtx(ctx);
239 + CompareImages("GD->GIF ptr->GD", ref, im2);
241 + gdImageDestroy(im2);
245 /* Send to PNG File then Ptr */
246 @@ -334,6 +365,10 @@ main (int argc, char **argv)
247 printf ("[Merged Image has %d colours]\n", im2->colorsTotal);
248 CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3);
250 + out = fopen ("test/gdtest_merge_out.png", "wb");
251 + gdImagePng(im2, out);
254 gdImageDestroy (im2);
255 gdImageDestroy (im3);
259 [FILE:551:files/makefonts]
266 fonts="Tiny Small MediumBold Large Giant"
269 tar -xvzpf "${tarball}" $@
274 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
275 mv -v "gdfont${f}.c" "gdfont${f}.c.dist"
276 mv -v "gdfont${f}.h" "gdfont${f}.h.dist"
283 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
284 perl ./bdftogd "gdFont${font}" "font${f}" < "${1}"