1 |
commit: d2adbf791493b27c42120df242478d5e3b35a9cc |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Sep 7 22:51:23 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 7 22:51:29 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2adbf79 |
7 |
|
8 |
net-misc/rsync: fix build w/ clang 15 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../rsync/files/rsync-3.2.5-pedantic-errors.patch | 53 ++++++++++++++++++++++ |
13 |
net-misc/rsync/rsync-3.2.5-r1.ebuild | 12 ++++- |
14 |
net-misc/rsync/rsync-9999.ebuild | 8 +++- |
15 |
3 files changed, 71 insertions(+), 2 deletions(-) |
16 |
|
17 |
diff --git a/net-misc/rsync/files/rsync-3.2.5-pedantic-errors.patch b/net-misc/rsync/files/rsync-3.2.5-pedantic-errors.patch |
18 |
new file mode 100644 |
19 |
index 000000000000..33afbd954a12 |
20 |
--- /dev/null |
21 |
+++ b/net-misc/rsync/files/rsync-3.2.5-pedantic-errors.patch |
22 |
@@ -0,0 +1,53 @@ |
23 |
+https://github.com/WayneD/rsync/commit/9a3449a3980421f84ac55498ba565bc112b20d6c |
24 |
+ |
25 |
+In particular, avoids attr configure test failing. |
26 |
+ |
27 |
+From 9a3449a3980421f84ac55498ba565bc112b20d6c Mon Sep 17 00:00:00 2001 |
28 |
+From: Wayne Davison <wayne@×××××××××.net> |
29 |
+Date: Thu, 18 Aug 2022 17:33:54 -0700 |
30 |
+Subject: [PATCH] Stop enabling -pedantic-errors. |
31 |
+ |
32 |
+--- a/configure.ac |
33 |
++++ b/configure.ac |
34 |
+@@ -1071,21 +1071,6 @@ elif test x"$ac_cv_header_popt_h" != x"yes"; then |
35 |
+ with_included_popt=yes |
36 |
+ fi |
37 |
+ |
38 |
+-if test x"$GCC" = x"yes"; then |
39 |
+- if test x"$with_included_popt" != x"yes"; then |
40 |
+- # Turn pedantic warnings into errors to ensure an array-init overflow is an error. |
41 |
+- CFLAGS="$CFLAGS -pedantic-errors" |
42 |
+- else |
43 |
+- # Our internal popt code cannot be compiled with pedantic warnings as errors, so try to |
44 |
+- # turn off pedantic warnings (which will not lose the error for array-init overflow). |
45 |
+- # Older gcc versions don't understand -Wno-pedantic, so check if --help=warnings lists |
46 |
+- # -Wpedantic and use that as a flag. |
47 |
+- case `$CC --help=warnings 2>/dev/null | grep Wpedantic` in |
48 |
+- *-Wpedantic*) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;; |
49 |
+- esac |
50 |
+- fi |
51 |
+-fi |
52 |
+- |
53 |
+ AC_MSG_CHECKING([whether to use included libpopt]) |
54 |
+ if test x"$with_included_popt" = x"yes"; then |
55 |
+ AC_MSG_RESULT($srcdir/popt) |
56 |
+ |
57 |
+--- a/configure.sh |
58 |
++++ b/configure.sh |
59 |
+@@ -9982,14 +9982,14 @@ fi |
60 |
+ if test x"$GCC" = x"yes"; then |
61 |
+ if test x"$with_included_popt" != x"yes"; then |
62 |
+ # Turn pedantic warnings into errors to ensure an array-init overflow is an error. |
63 |
+- CFLAGS="$CFLAGS -pedantic-errors" |
64 |
++ CFLAGS="$CFLAGS " |
65 |
+ else |
66 |
+ # Our internal popt code cannot be compiled with pedantic warnings as errors, so try to |
67 |
+ # turn off pedantic warnings (which will not lose the error for array-init overflow). |
68 |
+ # Older gcc versions don't understand -Wno-pedantic, so check if --help=warnings lists |
69 |
+ # -Wpedantic and use that as a flag. |
70 |
+ case `$CC --help=warnings 2>/dev/null | grep Wpedantic` in |
71 |
+- *-Wpedantic*) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;; |
72 |
++ *-Wpedantic*) CFLAGS="$CFLAGS -Wno-pedantic" ;; |
73 |
+ esac |
74 |
+ fi |
75 |
+ fi |
76 |
|
77 |
diff --git a/net-misc/rsync/rsync-3.2.5-r1.ebuild b/net-misc/rsync/rsync-3.2.5-r1.ebuild |
78 |
index 1abfebf444ed..6e6e4bd34c3e 100644 |
79 |
--- a/net-misc/rsync/rsync-3.2.5-r1.ebuild |
80 |
+++ b/net-misc/rsync/rsync-3.2.5-r1.ebuild |
81 |
@@ -3,6 +3,8 @@ |
82 |
|
83 |
EAPI=8 |
84 |
|
85 |
+# Uncomment when introducing a patch which touches configure |
86 |
+RSYNC_NEEDS_AUTOCONF=1 |
87 |
PYTHON_COMPAT=( python3_{8..10} ) |
88 |
inherit prefix python-single-r1 systemd |
89 |
|
90 |
@@ -17,6 +19,10 @@ else |
91 |
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/waynedavison.asc |
92 |
inherit verify-sig |
93 |
|
94 |
+ if [[ -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then |
95 |
+ inherit autotools |
96 |
+ fi |
97 |
+ |
98 |
if [[ ${PV} == *_pre* ]] ; then |
99 |
SRC_DIR="src-previews" |
100 |
else |
101 |
@@ -60,6 +66,10 @@ else |
102 |
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-waynedavison )" |
103 |
fi |
104 |
|
105 |
+PATCHES=( |
106 |
+ "${FILESDIR}"/${P}-pedantic-errors.patch |
107 |
+) |
108 |
+ |
109 |
pkg_setup() { |
110 |
# - USE=examples needs Python itself at runtime, but nothing else |
111 |
# - 9999 needs commonmark at build time |
112 |
@@ -71,7 +81,7 @@ pkg_setup() { |
113 |
src_prepare() { |
114 |
default |
115 |
|
116 |
- if [[ ${PV} == *9999 ]] ; then |
117 |
+ if [[ ${PV} == *9999 || -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then |
118 |
eaclocal -I m4 |
119 |
eautoconf -o configure.sh |
120 |
eautoheader && touch config.h.in |
121 |
|
122 |
diff --git a/net-misc/rsync/rsync-9999.ebuild b/net-misc/rsync/rsync-9999.ebuild |
123 |
index 1abfebf444ed..804909ae11e6 100644 |
124 |
--- a/net-misc/rsync/rsync-9999.ebuild |
125 |
+++ b/net-misc/rsync/rsync-9999.ebuild |
126 |
@@ -3,6 +3,8 @@ |
127 |
|
128 |
EAPI=8 |
129 |
|
130 |
+# Uncomment when introducing a patch which touches configure |
131 |
+#RSYNC_NEEDS_AUTOCONF=1 |
132 |
PYTHON_COMPAT=( python3_{8..10} ) |
133 |
inherit prefix python-single-r1 systemd |
134 |
|
135 |
@@ -17,6 +19,10 @@ else |
136 |
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/waynedavison.asc |
137 |
inherit verify-sig |
138 |
|
139 |
+ if [[ -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then |
140 |
+ inherit autotools |
141 |
+ fi |
142 |
+ |
143 |
if [[ ${PV} == *_pre* ]] ; then |
144 |
SRC_DIR="src-previews" |
145 |
else |
146 |
@@ -71,7 +77,7 @@ pkg_setup() { |
147 |
src_prepare() { |
148 |
default |
149 |
|
150 |
- if [[ ${PV} == *9999 ]] ; then |
151 |
+ if [[ ${PV} == *9999 || -n ${RSYNC_NEEDS_AUTOCONF} ]] ; then |
152 |
eaclocal -I m4 |
153 |
eautoconf -o configure.sh |
154 |
eautoheader && touch config.h.in |