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.3.0/
13 DISTFILE[1]= libgd-2.3.0.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.8
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 ecd9155b9a417fb3f837f29e5966323796de247789163761dd72dbf83bfcac58 2539188 libgd-2.3.0.tar.xz
68 [FILE:389:manifests/plist.single]
102 libgd.so.%%SOVERSION%%
103 lib/pkgconfig/gdlib.pc
106 [FILE:1238:patches/patch-bdftogd]
107 --- src/bdftogd.orig 2017-08-30 11:05:55 UTC
109 @@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname
110 my $filename = shift;
111 $filename = 'gd' . $filename unless $filename =~ /^gd/i;
113 +my $gdfunc = $gdname;
114 +$gdfunc =~ s/(.*Font)(.*)/$1Get$2/;
116 if (-f "$filename.c") { die "File $filename.c already exists, won't overwrite\n"; }
117 if (-f "$filename.h") { die "File $filename.h already exists, won't overwrite\n"; }
119 @@ -139,6 +142,10 @@ print FILEC <<"EOF";
123 +#ifdef HAVE_CONFIG_H
127 #include "$filename.h"
129 char ${gdname}Data[] = {
130 @@ -177,28 +184,40 @@ gdFont ${gdname}Rep = {
134 -gdFontPtr ${gdname} = &${gdname}Rep;
135 +BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep;
137 -/* This file has not been truncated. */
138 +BGD_DECLARE(gdFontPtr)
144 +/* This file has not been truncated. */
163 -extern gdFontPtr $gdname;
164 +extern BGD_EXPORT_DATA_PROT gdFontPtr $gdname;
165 +BGD_DECLARE(gdFontPtr) $gdfunc(void);
177 [FILE:646:patches/patch-gd_png.c]
178 --- src/gd_png.c.orig 2017-08-30 11:05:54 UTC
180 @@ -277,6 +277,14 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFro
181 png_read_info (png_ptr, info_ptr); /* read all PNG info up to image data */
183 png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
185 + if (overflow2(sizeof (int), width)) {
188 + if (overflow2(sizeof (int) * width, height)) {
192 if ((color_type == PNG_COLOR_TYPE_RGB) || (color_type == PNG_COLOR_TYPE_RGB_ALPHA)
193 || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
194 im = gdImageCreateTrueColor ((int) width, (int) height);
197 [FILE:1461:patches/patch-gdtest.c]
198 --- src/gdtest.c.orig 2017-08-30 11:05:55 UTC
200 @@ -35,6 +35,8 @@ main (int argc, char **argv)
207 fprintf(stderr, "Usage: gdtest filename.png\n");
209 @@ -63,6 +65,35 @@ main (int argc, char **argv)
211 CompareImages ("Initial Versions", ref, im);
214 + /* Send to GIF File then Ptr */
216 + sprintf(of, "%s.gif", argv[1]);
217 + out = fopen(of, "wb");
218 + gdImageGif(im, out);
221 + in = fopen(of, "rb");
223 + fprintf(stderr, "GIF Output file does not exist!\n");
226 + im2 = gdImageCreateFromGif(in);
229 + CompareImages("GD->GIF File->GD", ref, im2);
232 + gdImageDestroy(im2);
234 + iptr = gdImageGifPtr(im,&sz);
235 + ctx = gdNewDynamicCtx(sz,iptr);
236 + im2 = gdImageCreateFromGifCtx(ctx);
238 + CompareImages("GD->GIF ptr->GD", ref, im2);
240 + gdImageDestroy(im2);
244 /* Send to PNG File then Ptr */
245 @@ -334,6 +365,10 @@ main (int argc, char **argv)
246 printf ("[Merged Image has %d colours]\n", im2->colorsTotal);
247 CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3);
249 + out = fopen ("test/gdtest_merge_out.png", "wb");
250 + gdImagePng(im2, out);
253 gdImageDestroy (im2);
254 gdImageDestroy (im3);
258 [FILE:551:files/makefonts]
265 fonts="Tiny Small MediumBold Large Giant"
268 tar -xvzpf "${tarball}" $@
273 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
274 mv -v "gdfont${f}.c" "gdfont${f}.c.dist"
275 mv -v "gdfont${f}.h" "gdfont${f}.h.dist"
282 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
283 perl ./bdftogd "gdFont${font}" "font${f}" < "${1}"