summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sping@gentoo.org>2017-12-13 01:08:09 +0100
committerSebastian Pipping <sping@gentoo.org>2017-12-13 01:09:31 +0100
commit00312f382135326dc1f784f9fdda60e1ec9e453b (patch)
treecb1fd1d3c17dc8fa6cc01f1d475da09df3906d54 /sys-fs/dd-rescue
parentdev-python/autopep8: 1.3.3 (diff)
downloadgentoo-00312f382135326dc1f784f9fdda60e1ec9e453b.tar.gz
gentoo-00312f382135326dc1f784f9fdda60e1ec9e453b.tar.bz2
gentoo-00312f382135326dc1f784f9fdda60e1ec9e453b.zip
sys-fs/dd-rescue: 1.99.8
Package-Manager: Portage-2.3.16, Repoman-2.3.6
Diffstat (limited to 'sys-fs/dd-rescue')
-rw-r--r--sys-fs/dd-rescue/Manifest1
-rw-r--r--sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild104
-rw-r--r--sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r2.patch161
3 files changed, 266 insertions, 0 deletions
diff --git a/sys-fs/dd-rescue/Manifest b/sys-fs/dd-rescue/Manifest
index 7308747532b6..92c2e3407587 100644
--- a/sys-fs/dd-rescue/Manifest
+++ b/sys-fs/dd-rescue/Manifest
@@ -2,3 +2,4 @@ DIST dd_rescue-1.46.tar.gz 126790 BLAKE2B 027d509349e77fa020757b826184b4a2206c3f
DIST dd_rescue-1.99.5.tar.bz2 170712 BLAKE2B f19a91de3acf96759c51361a30262a0c77aad45121fdcaa20e0a38e1b47a3f7a9530d22abed78dd78924cb77e053e19eabc9a6c93ba4a0601f5916468f6ba139 SHA512 a240eb9d50950cefbc65d953c84a8e3782d39282aff4e7fa42364b40cee0eb0a02f61315786a1008cf7ae9c3d758700e9f3a0087b9477b3ffbfcbcef59f07d88
DIST dd_rescue-1.99.6.tar.bz2 171621 BLAKE2B cee1bfb3014e87fdc083ed956427c91a1329f39215d300171e4dc6a553a81e04dd95c006354e318cf692845becc052db77c1daac54942b019e307bc2ba594b1e SHA512 b91508ebdd5f5a4945fa15a86b530bb03e49e74ffe6d2227c9dac4a5fa1b8e9ccf6f1e68204220b571b4661b78892be3a955005f253fd691a85977f35fc74b5e
DIST dd_rescue-1.99.7.tar.bz2 172414 BLAKE2B 0f9bd9abd3936eeb4ec22f2c3cf59a3dbf2cb1c2e7fe854b7e0b0c5e3b521541595115952b0d840d739bfb2080a0f2920e867551b3598db62df1f41cb15f3121 SHA512 56e1aca8f068110376ba8b3b7ef7ec203a1632cf943d0b47e415699af67ac29984094a22fb685a4237f6a6962d4aa972714f2ac19e283d209ed3e5c193c9d72d
+DIST dd_rescue-1.99.8.tar.bz2 174594 BLAKE2B 51e62989bf6318cb5926f30bc1db746bddd41fb49aab15dc2b1c67e0af079469161d390ba4e1e109d195249b3aace3aa830a3aec14ba534eb47f38c0136f910c SHA512 a230e1df4532671ea631036012dd1e38614e45bed58b00757f0017b0ea60f14ac3bdac07777d175aa4929def593b3c8485e463b1fc25b5067adf4cf3f3ac040d
diff --git a/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild b/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild
new file mode 100644
index 000000000000..135b53fec881
--- /dev/null
+++ b/sys-fs/dd-rescue/dd-rescue-1.99.8.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit toolchain-funcs flag-o-matic multilib autotools
+
+MY_PN="${PN/-/_}"
+MY_P="${MY_PN}-${PV}"
+
+DESCRIPTION="Similar to dd but can copy from source with errors"
+HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
+SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr"
+
+RDEPEND="lzo? ( dev-libs/lzo )
+ xattr? ( sys-apps/attr )"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}"/${MY_PN}-1.99-musl-r2.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e 's:-ldl:$(LDFLAGS) -ldl:' \
+ -e 's:-shared:$(CFLAGS) $(LDFLAGS) -shared:' \
+ Makefile || die
+
+ if ! use cpu_flags_x86_sse4_2; then
+ sed -i \
+ -e 's:^CC_FLAGS_CHECK(-msse4.2,SSE42):#&:' \
+ configure.in || die
+ fi
+
+ if ! use cpu_flags_x86_avx2; then
+ sed -i \
+ -e 's:^CC_FLAGS_CHECK(-mavx2,AVX2):#&:' \
+ configure.in || die
+ fi
+
+ eautoreconf
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ # OpenSSL is only used by a random helper tool we don't install.
+ ac_cv_header_attr_xattr_h=$(usex xattr) \
+ ac_cv_header_openssl_evp_h=no \
+ ac_cv_lib_crypto_EVP_aes_192_ctr=no \
+ ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \
+ ac_cv_header_lzo_lzo1x_h=$(usex lzo) \
+ econf
+}
+
+_emake() {
+ local arch
+ case ${ARCH} in
+ x86) arch=i386;;
+ amd64) arch=x86_64;;
+ arm) arch=arm;;
+ arm64) arch=aarch64;;
+ esac
+
+ local os=$(usex kernel_linux Linux IDK)
+
+ # The Makefile is a mess. Override a few vars rather than patch it.
+ emake \
+ MACH="${arch}" \
+ OS="${os}" \
+ HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \
+ HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \
+ RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
+ CFLAGS_OPT='$(CFLAGS)' \
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX%/}/usr/$(get_libdir)/${PN}" \
+ CC="$(tc-getCC)" \
+ "$@"
+}
+
+src_compile() {
+ _emake
+}
+
+src_test() {
+ _emake check
+}
+
+src_install() {
+ # easier to install by hand than trying to make sense of the Makefile.
+ dobin dd_rescue
+ dodir /usr/$(get_libdir)/${PN}
+ cp -pPR libddr_*.so "${ED%/}"/usr/$(get_libdir)/${PN}/ || die
+ dodoc README.dd_rescue
+ doman dd_rescue.1
+ use lzo && doman ddr_lzo.1
+}
diff --git a/sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r2.patch b/sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r2.patch
new file mode 100644
index 000000000000..c98ddeca13a0
--- /dev/null
+++ b/sys-fs/dd-rescue/files/dd_rescue-1.99-musl-r2.patch
@@ -0,0 +1,161 @@
+From e96b79c9e4cd6c40ba6e5fe495904f07a95fb909 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi@gentoo.org>
+Date: Wed, 13 Dec 2017 01:02:12 +0100
+Subject: [PATCH 49/49] loff_t and __WORDSIZE includes for MUSL
+
+Rewrite of Justin Keogh's patch [Link 1] to fix build problems
+on ARM.
+
+Link 1: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f5abc0f1b036921d6eb5b0f434c960ed280619f
+Fixes: https://bugs.gentoo.org/616364
+---
+ configure.in | 2 +-
+ ddr_ctrl.h | 3 +++
+ ffs.h | 3 +++
+ fiemap.h | 4 ++++
+ fmt_no.h | 2 ++
+ fstrim.h | 3 +++
+ libddr_hash.c | 4 ++++
+ libddr_lzo.c | 3 +++
+ libddr_null.c | 3 +++
+ sha512.h | 4 ++++
+ 10 files changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index eb2e813..355ea84 100644
+--- a/configure.in
++++ b/configure.in
+@@ -6,7 +6,7 @@ AC_C_INLINE
+ AC_HEADER_STDC
+ #AC_PROG_INSTALL
+ #CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
+-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])
++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])
+ 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 __builtin_cpu_supports])
+ AC_CHECK_LIB(dl,dlsym)
+ AC_CHECK_LIB(fallocate,linux_fallocate64)
+diff --git a/ddr_ctrl.h b/ddr_ctrl.h
+index ac71e4f..58cffd5 100644
+--- a/ddr_ctrl.h
++++ b/ddr_ctrl.h
+@@ -7,6 +7,9 @@
+ * License: GNU GPLv2 or v3
+ */
+
++#define _GNU_SOURCE
++#include <fcntl.h>
++
+ #ifndef _DDR_CTRL_H
+ #define _DDR_CTRL_H
+
+diff --git a/ffs.h b/ffs.h
+index 2215080..c1f3444 100644
+--- a/ffs.h
++++ b/ffs.h
+@@ -28,6 +28,9 @@
+ #include <endian.h>
+ #endif
+
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
+
+ #ifdef HAVE_FFS
+ # define myffs(x) ffs(x)
+diff --git a/fiemap.h b/fiemap.h
+index df1ba95..31cde3b 100644
+--- a/fiemap.h
++++ b/fiemap.h
+@@ -29,5 +29,9 @@
+
+ #endif /* HAVE_LINUX_FS_H */
+
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
++
+ #endif /* _FIEMAPH */
+
+diff --git a/fmt_no.h b/fmt_no.h
+index cb0a81b..52ec236 100644
+--- a/fmt_no.h
++++ b/fmt_no.h
+@@ -1,4 +1,6 @@
+ /** Decl for int to str conversion with highlighting */
++#define _GNU_SOURCE
++#include <fcntl.h>
+
+ #ifndef _FMT_NO_H
+ #define _FMT_NO_H
+diff --git a/fstrim.h b/fstrim.h
+index 7447061..b9cdcbb 100644
+--- a/fstrim.h
++++ b/fstrim.h
+@@ -1,3 +1,6 @@
++#define _GNU_SOURCE
++#include <fcntl.h>
++
+ #ifndef _FSTRIM_H
+ #define _FSTRIM_H
+
+diff --git a/libddr_hash.c b/libddr_hash.c
+index 7c8cdf8..cdbbd4d 100644
+--- a/libddr_hash.c
++++ b/libddr_hash.c
+@@ -33,6 +33,10 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
++
+ #include <netinet/in.h> /* For ntohl/htonl */
+ #include <endian.h>
+
+diff --git a/libddr_lzo.c b/libddr_lzo.c
+index 8d3983e..8c83c04 100644
+--- a/libddr_lzo.c
++++ b/libddr_lzo.c
+@@ -26,6 +26,9 @@
+ #include <errno.h>
+ #include <netinet/in.h>
+ #include <sys/stat.h>
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
+ #include <signal.h>
+ #include <lzo/lzo1x.h>
+ #include <lzo/lzo1y.h>
+diff --git a/libddr_null.c b/libddr_null.c
+index 3f0f194..c379961 100644
+--- a/libddr_null.c
++++ b/libddr_null.c
+@@ -10,6 +10,9 @@
+ #include "ddr_ctrl.h"
+ #include <string.h>
+ #include <stdlib.h>
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
+
+ /* fwd decl */
+ extern ddr_plugin_t ddr_plug;
+diff --git a/sha512.h b/sha512.h
+index 4d08043..f54d371 100644
+--- a/sha512.h
++++ b/sha512.h
+@@ -3,6 +3,10 @@
+
+ #include "hash.h"
+
++#ifdef HAVE_SYS_REG_H
++#include <sys/reg.h>
++#endif
++
+ void sha512_init(hash_t *ctx);
+ void sha384_init(hash_t *ctx);
+ void sha512_128(const uint8_t* msg, hash_t* ctx);
+--
+2.15.0
+