Ravenports generated: 14 Dec 2019 09:17
[ravenports.git] / bucket_ED / libGD
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               libGD
4 VERSION=                2.2.5
5 KEYWORDS=               graphics
6 VARIANTS=               standard
7 SDESC[standard]=        Graphics library for fast creation of images
8 HOMEPAGE=               https://www.libgd.org/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            https://github.com/libgd/libgd/releases/download/gd-2.2.5/
13 DISTFILE[1]=            libgd-2.2.5.tar.xz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 BUILDRUN_DEPENDS=       WebP:single:standard
21                         fontconfig:primary:standard
22                         freetype:primary:standard
23
24 USES=                   pkgconfig libtool:keepla shebangfix zlib
25
26 DISTNAME=               libgd-2.2.5
27
28 FPC_EQUIVALENT=         graphics/gd
29 SHEBANG_FILES=          {{WRKSRC}}/src/bdftogd
30
31 MUST_CONFIGURE=         gnu
32 CONFIGURE_ARGS=         --with-xpm=no
33
34 PLIST_SUB=              SOVERSION=6.0.5
35                         SOMAJOR=6
36
37 post-patch:
38         # bump shlib version
39         ${REINPLACE_CMD} \
40                 -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \
41                 ${WRKSRC}/configure
42         ${REINPLACE_CMD} \
43                 -e 's|iconv|noiconv|' ${WRKSRC}/configure
44
45 post-install:
46         ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \
47                 ${STAGEDIR}${PREFIX}/include/
48         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so
49
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.
57
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.
62
63
64 [FILE:97:distinfo]
65 8c302ccbf467faec732f0741a859eef4ecae22fea2d2ab87467be940842bde51      2594092 libgd-2.2.5.tar.xz
66
67
68 [FILE:403:manifests/plist.single]
69 bin/
70  annotate
71  bdftogd
72  gd2copypal
73  gd2togif
74  gd2topng
75  gdcmpgif
76  gdlib-config
77  gdparttopng
78  gdtopng
79  giftogd2
80  pngtogd
81  pngtogd2
82  webpng
83 include/
84  entities.h
85  gd.h
86  gd_color_map.h
87  gd_errors.h
88  gd_io.h
89  gdcache.h
90  gdfontg.h
91  gdfontl.h
92  gdfontmb.h
93  gdfonts.h
94  gdfontt.h
95  gdfx.h
96  gdhelpers.h
97  gdpp.h
98 lib/
99  libgd.a
100  libgd.la
101  libgd.so
102  libgd.so.%%SOMAJOR%%
103  libgd.so.%%SOVERSION%%
104 lib/pkgconfig/gdlib.pc
105
106
107 [FILE:1239:patches/patch-bdftogd]
108 --- src/bdftogd.orig    2017-01-29 09:45:57 UTC
109 +++ src/bdftogd
110 @@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname 
111  my $filename = shift;
112  $filename = 'gd' . $filename unless $filename =~ /^gd/i;
113  
114 +my $gdfunc = $gdname;
115 +$gdfunc =~ s/(.*Font)(.*)/$1Get$2/;
116 +
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"; }
119  
120 @@ -139,6 +142,10 @@ print FILEC <<"EOF";
121  
122  $info
123  
124 +#ifdef HAVE_CONFIG_H
125 +#include "config.h"
126 +#endif
127 +
128  #include "$filename.h"
129  
130  char ${gdname}Data[] = {
131 @@ -177,28 +184,40 @@ gdFont ${gdname}Rep = {
132         ${gdname}Data
133  };
134  
135 -gdFontPtr ${gdname} = &${gdname}Rep;
136 +BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep;
137  
138 -/* This file has not been truncated. */
139 +BGD_DECLARE(gdFontPtr)
140 +$gdfunc (void)
141 +{
142 +  return $gdname;
143 +}
144  
145 +/* This file has not been truncated. */
146  EOF
147  
148  
149  close FILEC;
150  
151  print FILEH <<"EOF";
152 -
153  #ifndef $capdef
154  #define $capdef 1
155  
156 +#ifdef __cplusplus
157 +extern "C" {
158 +#endif
159 +
160  $info
161  
162  #include "gd.h"
163  
164 -extern gdFontPtr $gdname;
165 +extern BGD_EXPORT_DATA_PROT  gdFontPtr $gdname;
166 +BGD_DECLARE(gdFontPtr) $gdfunc(void);
167  
168 +#ifdef __cplusplus
169 +}
170  #endif
171  
172 +#endif
173  EOF
174  
175  1;
176
177
178 [FILE:646:patches/patch-gd_png.c]
179 --- src/gd_png.c.orig   2016-10-12 08:13:44 UTC
180 +++ src/gd_png.c
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 */
183  
184         png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
185 +
186 +       if (overflow2(sizeof (int), width)) {
187 +               return NULL;
188 +       }
189 +       if (overflow2(sizeof (int) * width, height)) {
190 +               return NULL;
191 +       }
192 +
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);
196
197
198 [FILE:1461:patches/patch-gdtest.c]
199 --- src/gdtest.c.orig   2015-09-16 11:34:29 UTC
200 +++ src/gdtest.c
201 @@ -35,6 +35,8 @@ main (int argc, char **argv)
202         gdSink imgsnk;
203         int foreground;
204         int i;
205 +       gdIOCtx *ctx;
206 +
207         if (argc != 2) {
208                 fprintf(stderr, "Usage: gdtest filename.png\n");
209                 exit (1);
210 @@ -63,6 +65,35 @@ main (int argc, char **argv)
211  
212         CompareImages ("Initial Versions", ref, im);
213  
214 +        /* */
215 +        /* Send to GIF File then Ptr */
216 +        /* */
217 +        sprintf(of, "%s.gif", argv[1]);
218 +        out = fopen(of, "wb");
219 +        gdImageGif(im, out);
220 +        fclose(out);
221 +
222 +        in = fopen(of, "rb");
223 +        if (!in) {
224 +                fprintf(stderr, "GIF Output file does not exist!\n");
225 +                exit(1);
226 +        }
227 +        im2 = gdImageCreateFromGif(in);
228 +        fclose(in);
229 +
230 +        CompareImages("GD->GIF File->GD", ref, im2);
231 +
232 +        unlink(of);
233 +        gdImageDestroy(im2);
234 +
235 +       iptr = gdImageGifPtr(im,&sz);
236 +       ctx = gdNewDynamicCtx(sz,iptr);
237 +       im2 = gdImageCreateFromGifCtx(ctx);
238 +
239 +        CompareImages("GD->GIF ptr->GD", ref, im2);
240 +
241 +       gdImageDestroy(im2);
242 +       ctx->gd_free(ctx);
243  
244         /* */
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);
249  
250 +       out = fopen ("test/gdtest_merge_out.png", "wb");
251 +       gdImagePng(im2, out);
252 +       fclose(out);
253 +
254         gdImageDestroy (im2);
255         gdImageDestroy (im3);
256  
257
258
259 [FILE:551:files/makefonts]
260 #!/bin/sh
261
262 target="${1}"
263 shift
264 tarball="${1}"
265 shift
266 fonts="Tiny Small MediumBold Large Giant"
267 case "${target}" in
268 extract)
269         tar -xvzpf "${tarball}" $@
270         ;;
271 configure)
272         for font in ${fonts}
273         do
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"
277         done
278         ;;
279 build)
280         set -x
281         for font in ${fonts}
282         do
283                 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
284                 perl ./bdftogd "gdFont${font}" "font${f}" < "${1}"
285                 shift
286         done
287         ;;
288 esac
289 # eof
290