Ravenports generated: 15 Apr 2020 07:13
[ravenports.git] / bucket_ED / libGD
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               libGD
4 VERSION=                2.3.0
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.3.0/
13 DISTFILE[1]=            libgd-2.3.0.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.3.0
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.8
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 ecd9155b9a417fb3f837f29e5966323796de247789163761dd72dbf83bfcac58      2539188 libgd-2.3.0.tar.xz
66
67
68 [FILE:389:manifests/plist.single]
69 bin/
70  annotate
71  bdftogd
72  gd2copypal
73  gd2togif
74  gd2topng
75  gdcmpgif
76  gdparttopng
77  gdtopng
78  giftogd2
79  pngtogd
80  pngtogd2
81  webpng
82 include/
83  entities.h
84  gd.h
85  gd_color_map.h
86  gd_errors.h
87  gd_io.h
88  gdcache.h
89  gdfontg.h
90  gdfontl.h
91  gdfontmb.h
92  gdfonts.h
93  gdfontt.h
94  gdfx.h
95  gdhelpers.h
96  gdpp.h
97 lib/
98  libgd.a
99  libgd.la
100  libgd.so
101  libgd.so.%%SOMAJOR%%
102  libgd.so.%%SOVERSION%%
103 lib/pkgconfig/gdlib.pc
104
105
106 [FILE:1238:patches/patch-bdftogd]
107 --- src/bdftogd.orig    2017-08-30 11:05:55 UTC
108 +++ src/bdftogd
109 @@ -24,6 +24,9 @@ $gdname = 'gd' . $gdname unless $gdname
110  my $filename = shift;
111  $filename = 'gd' . $filename unless $filename =~ /^gd/i;
112  
113 +my $gdfunc = $gdname;
114 +$gdfunc =~ s/(.*Font)(.*)/$1Get$2/;
115 +
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"; }
118  
119 @@ -139,6 +142,10 @@ print FILEC <<"EOF";
120  
121  $info
122  
123 +#ifdef HAVE_CONFIG_H
124 +#include "config.h"
125 +#endif
126 +
127  #include "$filename.h"
128  
129  char ${gdname}Data[] = {
130 @@ -177,28 +184,40 @@ gdFont ${gdname}Rep = {
131         ${gdname}Data
132  };
133  
134 -gdFontPtr ${gdname} = &${gdname}Rep;
135 +BGD_EXPORT_DATA_PROT gdFontPtr ${gdname} = &${gdname}Rep;
136  
137 -/* This file has not been truncated. */
138 +BGD_DECLARE(gdFontPtr)
139 +$gdfunc (void)
140 +{
141 +  return $gdname;
142 +}
143  
144 +/* This file has not been truncated. */
145  EOF
146  
147  
148  close FILEC;
149  
150  print FILEH <<"EOF";
151 -
152  #ifndef $capdef
153  #define $capdef 1
154  
155 +#ifdef __cplusplus
156 +extern "C" {
157 +#endif
158 +
159  $info
160  
161  #include "gd.h"
162  
163 -extern gdFontPtr $gdname;
164 +extern BGD_EXPORT_DATA_PROT  gdFontPtr $gdname;
165 +BGD_DECLARE(gdFontPtr) $gdfunc(void);
166  
167 +#ifdef __cplusplus
168 +}
169  #endif
170  
171 +#endif
172  EOF
173  
174  1;
175
176
177 [FILE:646:patches/patch-gd_png.c]
178 --- src/gd_png.c.orig   2017-08-30 11:05:54 UTC
179 +++ src/gd_png.c
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 */
182  
183         png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL);
184 +
185 +       if (overflow2(sizeof (int), width)) {
186 +               return NULL;
187 +       }
188 +       if (overflow2(sizeof (int) * width, height)) {
189 +               return NULL;
190 +       }
191 +
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);
195
196
197 [FILE:1461:patches/patch-gdtest.c]
198 --- src/gdtest.c.orig   2017-08-30 11:05:55 UTC
199 +++ src/gdtest.c
200 @@ -35,6 +35,8 @@ main (int argc, char **argv)
201         gdSink imgsnk;
202         int foreground;
203         int i;
204 +       gdIOCtx *ctx;
205 +
206         if (argc != 2) {
207                 fprintf(stderr, "Usage: gdtest filename.png\n");
208                 exit (1);
209 @@ -63,6 +65,35 @@ main (int argc, char **argv)
210  
211         CompareImages ("Initial Versions", ref, im);
212  
213 +        /* */
214 +        /* Send to GIF File then Ptr */
215 +        /* */
216 +        sprintf(of, "%s.gif", argv[1]);
217 +        out = fopen(of, "wb");
218 +        gdImageGif(im, out);
219 +        fclose(out);
220 +
221 +        in = fopen(of, "rb");
222 +        if (!in) {
223 +                fprintf(stderr, "GIF Output file does not exist!\n");
224 +                exit(1);
225 +        }
226 +        im2 = gdImageCreateFromGif(in);
227 +        fclose(in);
228 +
229 +        CompareImages("GD->GIF File->GD", ref, im2);
230 +
231 +        unlink(of);
232 +        gdImageDestroy(im2);
233 +
234 +       iptr = gdImageGifPtr(im,&sz);
235 +       ctx = gdNewDynamicCtx(sz,iptr);
236 +       im2 = gdImageCreateFromGifCtx(ctx);
237 +
238 +        CompareImages("GD->GIF ptr->GD", ref, im2);
239 +
240 +       gdImageDestroy(im2);
241 +       ctx->gd_free(ctx);
242  
243         /* */
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);
248  
249 +       out = fopen ("test/gdtest_merge_out.png", "wb");
250 +       gdImagePng(im2, out);
251 +       fclose(out);
252 +
253         gdImageDestroy (im2);
254         gdImageDestroy (im3);
255  
256
257
258 [FILE:551:files/makefonts]
259 #!/bin/sh
260
261 target="${1}"
262 shift
263 tarball="${1}"
264 shift
265 fonts="Tiny Small MediumBold Large Giant"
266 case "${target}" in
267 extract)
268         tar -xvzpf "${tarball}" $@
269         ;;
270 configure)
271         for font in ${fonts}
272         do
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"
276         done
277         ;;
278 build)
279         set -x
280         for font in ${fonts}
281         do
282                 f=`echo "${font}" | tr -d [[:lower:]] | tr [[:upper:]] [[:lower:]]`
283                 perl ./bdftogd "gdFont${font}" "font${f}" < "${1}"
284                 shift
285         done
286         ;;
287 esac
288 # eof
289