1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs flag-o-matic multilib autotools
11 DESCRIPTION="Similar to dd but can copy from source with errors"
12 HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
13 SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.bz2"
17 KEYWORDS="amd64 ~arm ~mips ppc ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
18 IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr"
20 RDEPEND="lzo? ( dev-libs/lzo )
21 xattr? ( sys-apps/attr )"
24 S="${WORKDIR}/${MY_P}"
27 "${FILESDIR}"/${MY_PN}-1.99-musl-r2.patch
28 "${FILESDIR}"/${PN}-1.99.8-xattr.patch
35 -e 's:-ldl:$(LDFLAGS) -ldl:' \
36 -e 's:-shared:$(CFLAGS) $(LDFLAGS) -shared:' \
39 if ! use cpu_flags_x86_sse4_2; then
41 -e 's:^CC_FLAGS_CHECK(-msse4.2,SSE42):#&:' \
45 if ! use cpu_flags_x86_avx2; then
47 -e 's:^CC_FLAGS_CHECK(-mavx2,AVX2):#&:' \
55 use static && append-ldflags -static
56 # OpenSSL is only used by a random helper tool we don't install.
57 ac_cv_header_attr_xattr_h=$(usex xattr) \
58 ac_cv_header_openssl_evp_h=no \
59 ac_cv_lib_crypto_EVP_aes_192_ctr=no \
60 ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \
61 ac_cv_header_lzo_lzo1x_h=$(usex lzo) \
74 local os=$(usex kernel_linux Linux IDK)
76 # The Makefile is a mess. Override a few vars rather than patch it.
80 HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \
81 HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \
82 RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
83 CFLAGS_OPT='$(CFLAGS)' \
84 LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/${PN}" \
98 # easier to install by hand than trying to make sense of the Makefile.
100 dodir /usr/$(get_libdir)/${PN}
101 cp -pPR libddr_*.so "${ED%/}"/usr/$(get_libdir)/${PN}/ || die
102 dodoc README.dd_rescue
104 use lzo && doman ddr_lzo.1