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