1 |
commit: e04bc2e851ac54864c388a674af9d0ce3c83ff66 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Oct 30 21:07:42 2017 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Oct 30 21:08:35 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e04bc2e8 |
7 |
|
8 |
sys-fs/dd-rescue: Rev bump to fix build issue on ARM caused by MUSL patch |
9 |
|
10 |
In addition: |
11 |
|
12 |
- OpenSSL removal updated (crypto_EVP_aes_192_ctr lib check) |
13 |
|
14 |
- lzo USE flag handling fixed (HAVE_LZO_LZO1X_H caused to build with |
15 |
lzo even when USE=-lzo was set but dev-libs/lzo was installed) |
16 |
|
17 |
- HMAC tests disabled due to https://sourceforge.net/p/ddrescue/tickets/3/ |
18 |
|
19 |
Closes: https://bugs.gentoo.org/616364 |
20 |
Package-Manager: Portage-2.3.13, Repoman-2.3.4 |
21 |
|
22 |
sys-fs/dd-rescue/dd-rescue-1.99.6-r1.ebuild | 93 ++++++++++++ |
23 |
.../files/dd_rescue-1.99-disable-hmac-tests.patch | 21 +++ |
24 |
.../dd-rescue/files/dd_rescue-1.99-musl-r1.patch | 161 +++++++++++++++++++++ |
25 |
3 files changed, 275 insertions(+) |
26 |
|
27 |
diff --git a/sys-fs/dd-rescue/dd-rescue-1.99.6-r1.ebuild b/sys-fs/dd-rescue/dd-rescue-1.99.6-r1.ebuild |
28 |
new file mode 100644 |
29 |
index 00000000000..1d391a112ea |
30 |
--- /dev/null |
31 |
+++ b/sys-fs/dd-rescue/dd-rescue-1.99.6-r1.ebuild |
32 |
@@ -0,0 +1,93 @@ |
33 |
+# Copyright 1999-2017 Gentoo Foundation |
34 |
+# Distributed under the terms of the GNU General Public License v2 |
35 |
+ |
36 |
+EAPI="6" |
37 |
+ |
38 |
+inherit toolchain-funcs flag-o-matic multilib autotools |
39 |
+ |
40 |
+MY_PN="${PN/-/_}" |
41 |
+MY_P="${MY_PN}-${PV}" |
42 |
+ |
43 |
+DESCRIPTION="Similar to dd but can copy from source with errors" |
44 |
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/" |
45 |
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.bz2" |
46 |
+ |
47 |
+LICENSE="GPL-2" |
48 |
+SLOT="0" |
49 |
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" |
50 |
+IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr" |
51 |
+ |
52 |
+RDEPEND="lzo? ( dev-libs/lzo ) |
53 |
+ xattr? ( sys-apps/attr )" |
54 |
+DEPEND="${RDEPEND}" |
55 |
+ |
56 |
+S="${WORKDIR}/${MY_P}" |
57 |
+ |
58 |
+PATCHES=( |
59 |
+ "${FILESDIR}"/${MY_PN}-1.99-musl-r1.patch |
60 |
+ "${FILESDIR}"/${MY_PN}-1.99-disable-hmac-tests.patch |
61 |
+) |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ default |
65 |
+ |
66 |
+ sed -i \ |
67 |
+ -e 's:-ldl:$(LDFLAGS) -ldl:' \ |
68 |
+ -e 's:-shared:$(CFLAGS) $(LDFLAGS) -shared:' \ |
69 |
+ Makefile || die |
70 |
+ |
71 |
+ eautoreconf |
72 |
+} |
73 |
+ |
74 |
+src_configure() { |
75 |
+ use static && append-ldflags -static |
76 |
+ # OpenSSL is only used by a random helper tool we don't install. |
77 |
+ ac_cv_header_attr_xattr_h=$(usex xattr) \ |
78 |
+ ac_cv_header_openssl_evp_h=no \ |
79 |
+ ac_cv_lib_crypto_EVP_aes_192_ctr=no \ |
80 |
+ ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \ |
81 |
+ ac_cv_header_lzo_lzo1x_h=$(usex lzo) \ |
82 |
+ econf |
83 |
+} |
84 |
+ |
85 |
+_emake() { |
86 |
+ local arch |
87 |
+ case ${ARCH} in |
88 |
+ x86) arch=i386;; |
89 |
+ amd64) arch=x86_64;; |
90 |
+ arm) arch=arm;; |
91 |
+ arm64) arch=aarch64;; |
92 |
+ esac |
93 |
+ |
94 |
+ local os=$(usex kernel_linux Linux IDK) |
95 |
+ |
96 |
+ # The Makefile is a mess. Override a few vars rather than patch it. |
97 |
+ emake \ |
98 |
+ MACH="${arch}" \ |
99 |
+ OS="${os}" \ |
100 |
+ HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \ |
101 |
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \ |
102 |
+ RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \ |
103 |
+ CFLAGS_OPT='$(CFLAGS)' \ |
104 |
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX%/}/usr/$(get_libdir)/${PN}" \ |
105 |
+ CC="$(tc-getCC)" \ |
106 |
+ "$@" |
107 |
+} |
108 |
+ |
109 |
+src_compile() { |
110 |
+ _emake |
111 |
+} |
112 |
+ |
113 |
+src_test() { |
114 |
+ _emake check |
115 |
+} |
116 |
+ |
117 |
+src_install() { |
118 |
+ # easier to install by hand than trying to make sense of the Makefile. |
119 |
+ dobin dd_rescue |
120 |
+ dodir /usr/$(get_libdir)/${PN} |
121 |
+ cp -pPR libddr_*.so "${ED%/}"/usr/$(get_libdir)/${PN}/ || die |
122 |
+ dodoc README.dd_rescue |
123 |
+ doman dd_rescue.1 |
124 |
+ use lzo && doman ddr_lzo.1 |
125 |
+} |
126 |
|
127 |
diff --git a/sys-fs/dd-rescue/files/dd_rescue-1.99-disable-hmac-tests.patch b/sys-fs/dd-rescue/files/dd_rescue-1.99-disable-hmac-tests.patch |
128 |
new file mode 100644 |
129 |
index 00000000000..244f4312139 |
130 |
--- /dev/null |
131 |
+++ b/sys-fs/dd-rescue/files/dd_rescue-1.99-disable-hmac-tests.patch |
132 |
@@ -0,0 +1,21 @@ |
133 |
+https://sourceforge.net/p/ddrescue/tickets/3/ |
134 |
+ |
135 |
+--- a/Makefile |
136 |
++++ b/Makefile |
137 |
+@@ -500,11 +500,11 @@ check: $(TARGETS) find_nonzero md5 sha1 sha256 sha512 fmt_no |
138 |
+ # Extra xattrs (should be preserved) |
139 |
+ #make check_xattr_copy |
140 |
+ # Tests with HMAC |
141 |
+- echo -n "what do ya want for nothing?" > TEST |
142 |
+- echo "750c783e6ab0b503eaa86e310a5db738 *TEST" > HMACS.md5 |
143 |
+- $(VG) ./dd_rescue -L ./libddr_hash.so=md5:hmacpwd=Jefe:chknm= TEST /dev/null |
144 |
+- rm -f /tmp/dd_rescue CHECKSUMS.sha512 TEST HMACS.md5 |
145 |
+- if ./calchmac.py sha1 pass dd_rescue; then $(MAKE) check_hmac; else echo "Sorry, no more HMAC test due to missing python-hashlib support"; true; fi |
146 |
++ #echo -n "what do ya want for nothing?" > TEST |
147 |
++ #echo "750c783e6ab0b503eaa86e310a5db738 *TEST" > HMACS.md5 |
148 |
++ #$(VG) ./dd_rescue -L ./libddr_hash.so=md5:hmacpwd=Jefe:chknm= TEST /dev/null |
149 |
++ #rm -f /tmp/dd_rescue CHECKSUMS.sha512 TEST HMACS.md5 |
150 |
++ #if ./calchmac.py sha1 pass dd_rescue; then $(MAKE) check_hmac; else echo "Sorry, no more HMAC test due to missing python-hashlib support"; true; fi |
151 |
+ $(MAKE) check_fault |
152 |
+ #$(MAKE) check_aes |
153 |
+ $(MAKE) check_crypt |
154 |
|
155 |
diff --git a/sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r1.patch b/sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r1.patch |
156 |
new file mode 100644 |
157 |
index 00000000000..6751cf00986 |
158 |
--- /dev/null |
159 |
+++ b/sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r1.patch |
160 |
@@ -0,0 +1,161 @@ |
161 |
+From 66e7503f24b9693ddb20a0873ae054f799c3660f Mon Sep 17 00:00:00 2001 |
162 |
+From: Thomas Deutschmann <whissi@g.o> |
163 |
+Date: Mon, 30 Oct 2017 20:12:10 +0100 |
164 |
+Subject: [PATCH 49/49] loff_t and __WORDSIZE includes for MUSL |
165 |
+ |
166 |
+Rewrite of Justin Keogh's patch [Link 1] to fix build problems |
167 |
+on ARM. |
168 |
+ |
169 |
+Link 1: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f5abc0f1b036921d6eb5b0f434c960ed280619f |
170 |
+Fixes: https://bugs.gentoo.org/616364 |
171 |
+--- |
172 |
+ configure.in | 2 +- |
173 |
+ ddr_ctrl.h | 3 +++ |
174 |
+ ffs.h | 3 +++ |
175 |
+ fiemap.h | 4 ++++ |
176 |
+ fmt_no.h | 2 ++ |
177 |
+ fstrim.h | 3 +++ |
178 |
+ libddr_hash.c | 4 ++++ |
179 |
+ libddr_lzo.c | 3 +++ |
180 |
+ libddr_null.c | 3 +++ |
181 |
+ sha512.h | 4 ++++ |
182 |
+ 10 files changed, 30 insertions(+), 1 deletion(-) |
183 |
+ |
184 |
+diff --git a/configure.in b/configure.in |
185 |
+index f813d4b..c9d28c5 100644 |
186 |
+--- a/configure.in |
187 |
++++ b/configure.in |
188 |
+@@ -6,7 +6,7 @@ AC_C_INLINE |
189 |
+ AC_HEADER_STDC |
190 |
+ #AC_PROG_INSTALL |
191 |
+ #CFLAGS="$CFLAGS -DHAVE_CONFIG_H" |
192 |
+-AC_CHECK_HEADERS([fallocate.h dlfcn.h unistd.h attr/xattr.h sys/acl.h sys/ioctl.h endian.h linux/fs.h linux/fiemap.h stdint.h lzo/lzo1x.h openssl/evp.h linux/random.h malloc.h sched.h sys/statvfs.h]) |
193 |
++AC_CHECK_HEADERS([fallocate.h dlfcn.h unistd.h attr/xattr.h sys/acl.h sys/ioctl.h sys/reg.h endian.h linux/fs.h linux/fiemap.h stdint.h lzo/lzo1x.h openssl/evp.h linux/random.h malloc.h sched.h sys/statvfs.h]) |
194 |
+ AC_CHECK_FUNCS([ffs ffsl basename fallocate64 splice getopt_long open64 pread pread64 lseek64 stat64 posix_fadvise posix_fadvise64 __builtin_prefetch htobe64 feof_unlocked getline getentropy getrandom posix_memalign valloc sched_yield fstatvfs]) |
195 |
+ AC_CHECK_LIB(dl,dlsym) |
196 |
+ AC_CHECK_LIB(fallocate,linux_fallocate64) |
197 |
+diff --git a/ddr_ctrl.h b/ddr_ctrl.h |
198 |
+index ac71e4f..58cffd5 100644 |
199 |
+--- a/ddr_ctrl.h |
200 |
++++ b/ddr_ctrl.h |
201 |
+@@ -7,6 +7,9 @@ |
202 |
+ * License: GNU GPLv2 or v3 |
203 |
+ */ |
204 |
+ |
205 |
++#define _GNU_SOURCE |
206 |
++#include <fcntl.h> |
207 |
++ |
208 |
+ #ifndef _DDR_CTRL_H |
209 |
+ #define _DDR_CTRL_H |
210 |
+ |
211 |
+diff --git a/ffs.h b/ffs.h |
212 |
+index 2215080..c1f3444 100644 |
213 |
+--- a/ffs.h |
214 |
++++ b/ffs.h |
215 |
+@@ -28,6 +28,9 @@ |
216 |
+ #include <endian.h> |
217 |
+ #endif |
218 |
+ |
219 |
++#ifdef HAVE_SYS_REG_H |
220 |
++#include <sys/reg.h> |
221 |
++#endif |
222 |
+ |
223 |
+ #ifdef HAVE_FFS |
224 |
+ # define myffs(x) ffs(x) |
225 |
+diff --git a/fiemap.h b/fiemap.h |
226 |
+index df1ba95..31cde3b 100644 |
227 |
+--- a/fiemap.h |
228 |
++++ b/fiemap.h |
229 |
+@@ -29,5 +29,9 @@ |
230 |
+ |
231 |
+ #endif /* HAVE_LINUX_FS_H */ |
232 |
+ |
233 |
++#ifdef HAVE_SYS_REG_H |
234 |
++#include <sys/reg.h> |
235 |
++#endif |
236 |
++ |
237 |
+ #endif /* _FIEMAPH */ |
238 |
+ |
239 |
+diff --git a/fmt_no.h b/fmt_no.h |
240 |
+index 329f997..16eda5c 100644 |
241 |
+--- a/fmt_no.h |
242 |
++++ b/fmt_no.h |
243 |
+@@ -1,4 +1,6 @@ |
244 |
+ /** Decl for int to str conversion with highlighting */ |
245 |
++#define _GNU_SOURCE |
246 |
++#include <fcntl.h> |
247 |
+ |
248 |
+ #ifndef _FMT_NO_H |
249 |
+ #define _FMT_NO_H |
250 |
+diff --git a/fstrim.h b/fstrim.h |
251 |
+index 7447061..b9cdcbb 100644 |
252 |
+--- a/fstrim.h |
253 |
++++ b/fstrim.h |
254 |
+@@ -1,3 +1,6 @@ |
255 |
++#define _GNU_SOURCE |
256 |
++#include <fcntl.h> |
257 |
++ |
258 |
+ #ifndef _FSTRIM_H |
259 |
+ #define _FSTRIM_H |
260 |
+ |
261 |
+diff --git a/libddr_hash.c b/libddr_hash.c |
262 |
+index daa806e..264dba1 100644 |
263 |
+--- a/libddr_hash.c |
264 |
++++ b/libddr_hash.c |
265 |
+@@ -33,6 +33,10 @@ |
266 |
+ #include <unistd.h> |
267 |
+ #include <fcntl.h> |
268 |
+ |
269 |
++#ifdef HAVE_SYS_REG_H |
270 |
++#include <sys/reg.h> |
271 |
++#endif |
272 |
++ |
273 |
+ #include <netinet/in.h> /* For ntohl/htonl */ |
274 |
+ #include <endian.h> |
275 |
+ |
276 |
+diff --git a/libddr_lzo.c b/libddr_lzo.c |
277 |
+index 531df11..3220e2a 100644 |
278 |
+--- a/libddr_lzo.c |
279 |
++++ b/libddr_lzo.c |
280 |
+@@ -26,6 +26,9 @@ |
281 |
+ #include <errno.h> |
282 |
+ #include <netinet/in.h> |
283 |
+ #include <sys/stat.h> |
284 |
++#ifdef HAVE_SYS_REG_H |
285 |
++#include <sys/reg.h> |
286 |
++#endif |
287 |
+ #include <signal.h> |
288 |
+ #include <lzo/lzo1x.h> |
289 |
+ #include <lzo/lzo1y.h> |
290 |
+diff --git a/libddr_null.c b/libddr_null.c |
291 |
+index 3f0f194..c379961 100644 |
292 |
+--- a/libddr_null.c |
293 |
++++ b/libddr_null.c |
294 |
+@@ -10,6 +10,9 @@ |
295 |
+ #include "ddr_ctrl.h" |
296 |
+ #include <string.h> |
297 |
+ #include <stdlib.h> |
298 |
++#ifdef HAVE_SYS_REG_H |
299 |
++#include <sys/reg.h> |
300 |
++#endif |
301 |
+ |
302 |
+ /* fwd decl */ |
303 |
+ extern ddr_plugin_t ddr_plug; |
304 |
+diff --git a/sha512.h b/sha512.h |
305 |
+index 4d08043..f54d371 100644 |
306 |
+--- a/sha512.h |
307 |
++++ b/sha512.h |
308 |
+@@ -3,6 +3,10 @@ |
309 |
+ |
310 |
+ #include "hash.h" |
311 |
+ |
312 |
++#ifdef HAVE_SYS_REG_H |
313 |
++#include <sys/reg.h> |
314 |
++#endif |
315 |
++ |
316 |
+ void sha512_init(hash_t *ctx); |
317 |
+ void sha384_init(hash_t *ctx); |
318 |
+ void sha512_128(const uint8_t* msg, hash_t* ctx); |
319 |
+-- |
320 |
+2.14.3 |
321 |
+ |