1 |
commit: f2c2beb6007ad270dff9aacedbcf2ef0946eaa74 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 7 23:31:23 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 7 23:31:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2c2beb6 |
7 |
|
8 |
app-text/xmlto: fix build w/ clang 15 (backport warning fixes) |
9 |
|
10 |
Throw in some other upstream warning fixes too. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/869080 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
.../xmlto/files/xmlto-0.0.28-fix-warnings.patch | 116 +++++++++++++++++++++ |
16 |
app-text/xmlto/xmlto-0.0.28-r9.ebuild | 54 ++++++++++ |
17 |
2 files changed, 170 insertions(+) |
18 |
|
19 |
diff --git a/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch b/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch |
20 |
new file mode 100644 |
21 |
index 000000000000..b90eea1f42df |
22 |
--- /dev/null |
23 |
+++ b/app-text/xmlto/files/xmlto-0.0.28-fix-warnings.patch |
24 |
@@ -0,0 +1,116 @@ |
25 |
+https://bugs.gentoo.org/869080 |
26 |
+ |
27 |
+https://pagure.io/xmlto/c/1375e2df75530cd198bd16ac3de38e2b0d126276?branch=master |
28 |
+https://pagure.io/xmlto/c/412f97cdc00d2bbf7e8121012b49fc07b3fe3d2b?branch=master |
29 |
+https://pagure.io/xmlto/c/8e34f087bf410bcc5fe445933d6ad9bae54f24b5?branch=master |
30 |
+https://pagure.io/xmlto/c/6fa6a0e07644f20abf2596f78a60112713e11cbe?branch=master |
31 |
+ |
32 |
+From 1375e2df75530cd198bd16ac3de38e2b0d126276 Mon Sep 17 00:00:00 2001 |
33 |
+From: Thomas Kuehne <thomas@××××××.cn> |
34 |
+Date: Dec 11 2021 20:45:45 +0000 |
35 |
+Subject: fix -Wimplicit-int for ifsense |
36 |
+ |
37 |
+ |
38 |
+fixes: |
39 |
+xmlif/xmlif.l:46:8: warning: type defaults to ‘int’ in declaration of ‘ifsense’ [-Wimplicit-int] |
40 |
+ 46 | static ifsense; /* sense of last `if' or unless seen */ |
41 |
+ | ^~~~~~~ |
42 |
+ |
43 |
+Signed-off-by: Thomas Kuehne <thomas@××××××.cn> |
44 |
+ |
45 |
+--- a/xmlif/xmlif.l |
46 |
++++ b/xmlif/xmlif.l |
47 |
+@@ -43,7 +43,7 @@ |
48 |
+ |
49 |
+ static char **selections; /* selection tokens */ |
50 |
+ static int nselections; /* number of selections */ |
51 |
+-static ifsense; /* sense of last `if' or unless seen */ |
52 |
++static int ifsense; /* sense of last `if' or unless seen */ |
53 |
+ static char *attribute; /* last attribute scanned */ |
54 |
+ |
55 |
+ struct stack_t { |
56 |
+ |
57 |
+ |
58 |
+From 412f97cdc00d2bbf7e8121012b49fc07b3fe3d2b Mon Sep 17 00:00:00 2001 |
59 |
+From: Thomas Kuehne <thomas@××××××.cn> |
60 |
+Date: Dec 11 2021 20:45:59 +0000 |
61 |
+Subject: fix extra ‘;’ outside of a function |
62 |
+ |
63 |
+ |
64 |
+Fixes: |
65 |
+xmlif/xmlif.l:240:24: warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic] |
66 |
+ 240 | int yywrap() {exit(0);}; |
67 |
+ | ^ |
68 |
+ |
69 |
+Signed-off-by: Thomas Kuehne <thomas@××××××.cn> |
70 |
+ |
71 |
+--- a/xmlif/xmlif.l |
72 |
++++ b/xmlif/xmlif.l |
73 |
+@@ -237,7 +237,7 @@ WS [ \t\n]* |
74 |
+ |
75 |
+ #include "config.h" |
76 |
+ |
77 |
+-int yywrap() {exit(0);}; |
78 |
++int yywrap() {exit(0);} |
79 |
+ |
80 |
+ main(int argc, char *argv[]) |
81 |
+ { |
82 |
+ |
83 |
+ |
84 |
+From 8e34f087bf410bcc5fe445933d6ad9bae54f24b5 Mon Sep 17 00:00:00 2001 |
85 |
+From: Thomas Kuehne <thomas@××××××.cn> |
86 |
+Date: Dec 11 2021 20:56:00 +0000 |
87 |
+Subject: Fix return type of main function |
88 |
+ |
89 |
+ |
90 |
+Fixes: |
91 |
+xmlif/xmlif.l:242:1: warning: return type defaults to ‘int’ [-Wimplicit-int] |
92 |
+ 242 | main(int argc, char *argv[]) |
93 |
+ | ^~~~ |
94 |
+ |
95 |
+Signed-off-by: Thomas Kuehne <thomas@××××××.cn> |
96 |
+ |
97 |
+--- a/xmlif/xmlif.l |
98 |
++++ b/xmlif/xmlif.l |
99 |
+@@ -239,7 +239,7 @@ WS [ \t\n]* |
100 |
+ |
101 |
+ int yywrap() {exit(0);} |
102 |
+ |
103 |
+-main(int argc, char *argv[]) |
104 |
++int main(int argc, char *argv[]) |
105 |
+ { |
106 |
+ int i; |
107 |
+ |
108 |
+@@ -265,7 +265,7 @@ main(int argc, char *argv[]) |
109 |
+ exit(1); |
110 |
+ } |
111 |
+ |
112 |
+- yylex(); |
113 |
++ return yylex(); |
114 |
+ } |
115 |
+ |
116 |
+ /* |
117 |
+ |
118 |
+From 6fa6a0e07644f20abf2596f78a60112713e11cbe Mon Sep 17 00:00:00 2001 |
119 |
+From: Thomas Kuehne <thomas@××××××.cn> |
120 |
+Date: Dec 11 2021 21:03:42 +0000 |
121 |
+Subject: add strings.h import |
122 |
+ |
123 |
+ |
124 |
+Fixes: |
125 |
+xmlif/xmlif.l:162:13: warning: implicit declaration of function ‘strncasecmp’; did you mean ‘strncmp’? [-Wimplicit-function-declaration] |
126 |
+ 162 | if (strncasecmp(selections[i], attr, eqoffset) == 0) |
127 |
+ | ^~~~~~~~~~~ |
128 |
+ |
129 |
+Signed-off-by: Thomas Kuehne <thomas@××××××.cn> |
130 |
+ |
131 |
+--- a/xmlif/xmlif.l |
132 |
++++ b/xmlif/xmlif.l |
133 |
+@@ -37,6 +37,7 @@ |
134 |
+ */ |
135 |
+ #include <string.h> |
136 |
+ #include <stdlib.h> |
137 |
++#include <strings.h> |
138 |
+ |
139 |
+ #define TRUE 1 |
140 |
+ #define FALSE 0 |
141 |
|
142 |
diff --git a/app-text/xmlto/xmlto-0.0.28-r9.ebuild b/app-text/xmlto/xmlto-0.0.28-r9.ebuild |
143 |
new file mode 100644 |
144 |
index 000000000000..1db249209926 |
145 |
--- /dev/null |
146 |
+++ b/app-text/xmlto/xmlto-0.0.28-r9.ebuild |
147 |
@@ -0,0 +1,54 @@ |
148 |
+# Copyright 1999-2022 Gentoo Authors |
149 |
+# Distributed under the terms of the GNU General Public License v2 |
150 |
+ |
151 |
+EAPI=7 |
152 |
+ |
153 |
+inherit autotools |
154 |
+ |
155 |
+DESCRIPTION="Script for converting XML and DocBook documents to a variety of output formats" |
156 |
+HOMEPAGE="https://pagure.io/xmlto" |
157 |
+SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.bz2" |
158 |
+ |
159 |
+LICENSE="GPL-2" |
160 |
+SLOT="0" |
161 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
162 |
+IUSE="latex text" |
163 |
+ |
164 |
+RDEPEND=" |
165 |
+ app-text/docbook-xsl-stylesheets |
166 |
+ app-text/docbook-xml-dtd:4.2 |
167 |
+ dev-libs/libxslt |
168 |
+ || ( sys-apps/util-linux app-misc/getopt ) |
169 |
+ text? ( || ( virtual/w3m www-client/elinks www-client/links www-client/lynx ) ) |
170 |
+ latex? ( dev-texlive/texlive-formatsextra ) |
171 |
+" |
172 |
+# We only depend on flex when we patch the input lexer. |
173 |
+DEPEND="${RDEPEND}" |
174 |
+ |
175 |
+DOCS=( AUTHORS ChangeLog FAQ NEWS README THANKS ) |
176 |
+ |
177 |
+PATCHES=( |
178 |
+ "${FILESDIR}"/${PN}-0.0.22-format_fo_passivetex_check.patch |
179 |
+ "${FILESDIR}"/${PN}-0.0.28-allow-links.patch |
180 |
+ "${FILESDIR}"/${P}-dont-hardcode-paths.patch |
181 |
+ "${FILESDIR}"/${P}-fix-warnings.patch |
182 |
+) |
183 |
+ |
184 |
+src_prepare() { |
185 |
+ default |
186 |
+ |
187 |
+ # fix symbol clash on Solaris |
188 |
+ if [[ ${CHOST} == *-solaris* ]] ; then |
189 |
+ sed -i -e 's/\(attrib\|val\)/XMLTO\1/g' xmlif/xmlif.l || die |
190 |
+ fi |
191 |
+ |
192 |
+ eautoreconf |
193 |
+} |
194 |
+ |
195 |
+src_configure() { |
196 |
+ # We don't want the script to detect /bin/sh if it is bash. |
197 |
+ export ac_cv_path_BASH="${BASH}" |
198 |
+ has_version sys-apps/util-linux || export GETOPT=getopt-long |
199 |
+ |
200 |
+ econf |
201 |
+} |