Gentoo Archives: gentoo-commits

From: Alfredo Tupone <tupone@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-tcltk/tkimg/files/, dev-tcltk/tkimg/
Date: Tue, 14 Mar 2023 20:33:58
Message-Id: 1678825789.38f7fe2ccd1202077ddc49cb4de13f77a42f80f1.tupone@gentoo
1 commit: 38f7fe2ccd1202077ddc49cb4de13f77a42f80f1
2 Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 14 20:29:02 2023 +0000
4 Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 14 20:29:49 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38f7fe2c
7
8 dev-tcltk/tkimg: fix gcc13 compilation
9
10 Closes: https://bugs.gentoo.org/895822
11 Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
12
13 dev-tcltk/tkimg/files/tkimg-1.4.14-gcc11.patch | 74 ++++++++++++++++++++++
14 ...img-1.4.14-r1.ebuild => tkimg-1.4.14-r2.ebuild} | 17 ++++-
15 2 files changed, 90 insertions(+), 1 deletion(-)
16
17 diff --git a/dev-tcltk/tkimg/files/tkimg-1.4.14-gcc11.patch b/dev-tcltk/tkimg/files/tkimg-1.4.14-gcc11.patch
18 new file mode 100644
19 index 000000000000..6f9e575db2ac
20 --- /dev/null
21 +++ b/dev-tcltk/tkimg/files/tkimg-1.4.14-gcc11.patch
22 @@ -0,0 +1,74 @@
23 +--- a/libtiff/tifftclDecls.h 2023-03-14 18:53:43.978820056 +0100
24 ++++ b/libtiff/tifftclDecls.h 2023-03-14 18:54:32.583047764 +0100
25 +@@ -169,10 +169,10 @@
26 + TIFFTCLAPI int TIFFReadRGBATile(TIFF *tiffptr, uint32_t a,
27 + uint32_t b, uint32_t *c);
28 + /* 57 */
29 +-TIFFTCLAPI int TIFFRGBAImageOK(TIFF *tiffptr, char *a);
30 ++TIFFTCLAPI int TIFFRGBAImageOK(TIFF *tiffptr, char a[1024]);
31 + /* 58 */
32 + TIFFTCLAPI int TIFFRGBAImageBegin(TIFFRGBAImage *a, TIFF *tiffptr,
33 +- int b, char *c);
34 ++ int b, char c[1024]);
35 + /* 59 */
36 + TIFFTCLAPI int TIFFRGBAImageGet(TIFFRGBAImage *d, uint32_t *c,
37 + uint32_t b, uint32_t a);
38 +--- a/tiff/tiffZip.c 2023-03-14 19:04:42.869354563 +0100
39 ++++ b/tiff/tiffZip.c 2023-03-14 19:05:14.768849607 +0100
40 +@@ -22,6 +22,7 @@
41 + * OF THIS SOFTWARE.
42 + */
43 +
44 ++#include <stdint.h>
45 + #include "tiffInt.h"
46 +
47 + /*
48 +@@ -233,7 +234,7 @@
49 + we need to simplify this code to reflect a ZLib that is likely updated
50 + to deal with 8byte memory sizes, though this code will respond
51 + appropriately even before we simplify it */
52 +- sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
53 ++ sp->stream.avail_out = (uint64_t)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
54 + return (deflateReset(&sp->stream) == Z_OK);
55 + }
56 +
57 +--- a/tiff/tiffPixar.c 2023-03-14 20:52:33.865532115 +0100
58 ++++ b/tiff/tiffPixar.c 2023-03-14 20:54:14.606973646 +0100
59 +@@ -592,8 +592,8 @@
60 + #define DecoderState(tif) ((PixarLogState*) (tif)->tif_data)
61 + #define EncoderState(tif) ((PixarLogState*) (tif)->tif_data)
62 +
63 +-static int PixarLogEncode(TIFF* tif, uint8_t bp, tmsize_t cc, uint16_t s);
64 +-static int PixarLogDecode(TIFF* tif, uint8_t op, tmsize_t occ, uint16_t s);
65 ++static int PixarLogEncode(TIFF* tif, uint8_t *bp, tmsize_t cc, uint16_t s);
66 ++static int PixarLogDecode(TIFF* tif, uint8_t *op, tmsize_t occ, uint16_t s);
67 +
68 + #define PIXARLOGDATAFMT_UNKNOWN -1
69 +
70 +@@ -747,7 +747,7 @@
71 + }
72 +
73 + static int
74 +-PixarLogDecode(TIFF* tif, uint8_t op, tmsize_t occ, uint16_t s)
75 ++PixarLogDecode(TIFF* tif, uint8_t *op, tmsize_t occ, uint16_t s)
76 + {
77 + static const char module[] = "PixarLogDecode";
78 + TIFFDirectory *td = &tif->tif_dir;
79 +@@ -1111,7 +1111,7 @@
80 + * Encode a chunk of pixels.
81 + */
82 + static int
83 +-PixarLogEncode(TIFF* tif, uint8_t bp, tmsize_t cc, uint16_t s)
84 ++PixarLogEncode(TIFF* tif, uint8_t *bp, tmsize_t cc, uint16_t s)
85 + {
86 + static const char module[] = "PixarLogEncode";
87 + TIFFDirectory *td = &tif->tif_dir;
88 +@@ -1411,7 +1411,7 @@
89 + /*
90 + * Allocate state block so tag methods have storage to record values.
91 + */
92 +- tif->tif_data = (uint8_t) TkimgTIFFmalloc(sizeof (PixarLogState));
93 ++ tif->tif_data = (uint8_t *) TkimgTIFFmalloc(sizeof (PixarLogState));
94 + if (tif->tif_data == NULL)
95 + goto bad;
96 + sp = (PixarLogState*) tif->tif_data;
97
98 diff --git a/dev-tcltk/tkimg/tkimg-1.4.14-r1.ebuild b/dev-tcltk/tkimg/tkimg-1.4.14-r2.ebuild
99 similarity index 89%
100 rename from dev-tcltk/tkimg/tkimg-1.4.14-r1.ebuild
101 rename to dev-tcltk/tkimg/tkimg-1.4.14-r2.ebuild
102 index c92ed64bf558..904cc6621894 100644
103 --- a/dev-tcltk/tkimg/tkimg-1.4.14-r1.ebuild
104 +++ b/dev-tcltk/tkimg/tkimg-1.4.14-r2.ebuild
105 @@ -35,7 +35,10 @@ RESTRICT="!test? ( test )"
106
107 S="${WORKDIR}/${MYP}"
108
109 -PATCHES=( "${WORKDIR}"/patchset-1 )
110 +PATCHES=(
111 + "${WORKDIR}"/patchset-1
112 + "${FILESDIR}"/${P}-gcc11.patch
113 +)
114
115 QA_CONFIG_IMPL_DECL_SKIP=(
116 stat64 # used to test for Large File Support
117 @@ -50,6 +53,9 @@ src_prepare() {
118 libpng/pngtclDecls.h \
119 libtiff/tifftclDecls.h
120
121 + # libtiff unbundle is problematic
122 + rm ../patchset-1/tkimg-1.4.12-tiff.patch || die
123 +
124 default
125
126 echo "unknown" > manifest.uuid || die
127 @@ -69,6 +75,15 @@ src_prepare() {
128 tc-export AR
129 }
130
131 +src_configure() {
132 + default
133 +
134 + sed -i \
135 + -e "/PACKAGE_/d" \
136 + libtiff/libtiff/tif_config.h \
137 + || die
138 +}
139 +
140 src_test() {
141 virtx default
142 }