| 1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| ... | ... | |
| 11 |
11 |
DESCRIPTION="Similar to dd but can copy from source with errors"
|
| 12 |
12 |
HOMEPAGE="http://www.garloff.de/kurt/linux/ddrescue/"
|
| 13 |
13 |
SRC_URI="http://www.garloff.de/kurt/linux/ddrescue/${MY_P}.tar.bz2"
|
|
14 |
S="${WORKDIR}/${MY_P}"
|
| 14 |
15 |
|
| 15 |
|
LICENSE="GPL-2"
|
|
16 |
LICENSE="|| ( GPL-2 GPL-3 )"
|
| 16 |
17 |
SLOT="0"
|
| 17 |
|
KEYWORDS="amd64 ~arm ~arm64 ~mips ppc ~ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
| 18 |
|
IUSE="cpu_flags_x86_avx2 lzo cpu_flags_x86_sse4_2 static xattr"
|
|
18 |
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
|
|
19 |
IUSE="cpu_flags_x86_avx2 lzo lzma cpu_flags_x86_sse4_2 static test xattr"
|
|
20 |
RESTRICT="!test? ( test )"
|
| 19 |
21 |
|
| 20 |
22 |
RDEPEND="
|
| 21 |
23 |
lzo? ( dev-libs/lzo )
|
| 22 |
24 |
xattr? ( sys-apps/attr )
|
| 23 |
25 |
"
|
| 24 |
26 |
DEPEND="${RDEPEND}"
|
| 25 |
|
|
| 26 |
|
S="${WORKDIR}/${MY_P}"
|
| 27 |
|
|
| 28 |
|
PATCHES=(
|
| 29 |
|
"${FILESDIR}"/${PN}-1.99.13-musl.patch
|
| 30 |
|
)
|
|
27 |
BDEPEND="
|
|
28 |
test? (
|
|
29 |
lzo? (
|
|
30 |
app-arch/lzop
|
|
31 |
)
|
|
32 |
)
|
|
33 |
"
|
| 31 |
34 |
|
| 32 |
35 |
src_prepare() {
|
| 33 |
36 |
default
|
| ... | ... | |
| 53 |
56 |
}
|
| 54 |
57 |
|
| 55 |
58 |
src_configure() {
|
| 56 |
|
# configure tests for the existence of fallocate64; if it can't find
|
| 57 |
|
# it it replaces it with a wrapper incompatible with musl... /o\
|
| 58 |
|
# we force it to assume its existence and then tell everyone to
|
| 59 |
|
# supply the *64 interface... bug 920159
|
| 60 |
|
# this workaround will stop working around once musl drops the *64 functions.
|
| 61 |
|
|
| 62 |
59 |
use static && append-ldflags -static
|
|
60 |
|
| 63 |
61 |
# OpenSSL is only used by a random helper tool we don't install.
|
| 64 |
|
ac_cv_header_attr_xattr_h=$(usex xattr) \
|
| 65 |
|
ac_cv_header_openssl_evp_h=no \
|
| 66 |
|
ac_cv_lib_crypto_EVP_aes_192_ctr=no \
|
| 67 |
|
ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo) \
|
| 68 |
|
ac_cv_header_lzo_lzo1x_h=$(usex lzo) \
|
| 69 |
|
ac_cv_func_fallocate64=yes \
|
|
62 |
export ac_cv_header_attr_xattr_h=$(usex xattr)
|
|
63 |
export ac_cv_header_openssl_evp_h=no
|
|
64 |
export ac_cv_lib_crypto_EVP_aes_192_ctr=no
|
|
65 |
export ac_cv_lib_lzo2_lzo1x_1_compress=$(usex lzo)
|
|
66 |
export ac_cv_header_lzo_lzo1x_h=$(usex lzo)
|
|
67 |
export ac_cv_header_lzma_h=$(usex lzma)
|
|
68 |
export ac_cv_lib_lzma_lzma_easy_encoder=$(usex lzma)
|
| 70 |
69 |
econf
|
| 71 |
70 |
}
|
| 72 |
71 |
|
| 73 |
72 |
_emake() {
|
| 74 |
73 |
local arch
|
| 75 |
74 |
case ${ARCH} in
|
| 76 |
|
x86) arch=i386;;
|
| 77 |
|
amd64) arch=x86_64;;
|
| 78 |
|
arm) arch=arm;;
|
| 79 |
|
arm64) arch=aarch64;;
|
|
75 |
x86) arch=i386;;
|
|
76 |
amd64) arch=x86_64;;
|
|
77 |
arm) arch=arm;;
|
|
78 |
arm64) arch=aarch64;;
|
| 80 |
79 |
esac
|
| 81 |
80 |
|
| 82 |
81 |
local os=$(usex kernel_linux Linux IDK)
|
| 83 |
82 |
|
| 84 |
|
# The Makefile is a mess. Override a few vars rather than patch it.
|
|
83 |
# HAVE_LZO is special as it's checked for emptiness in test_crypt.sh.
|
|
84 |
# We could try make RDRND and friends controlled via USE but it's too brittle,
|
|
85 |
# see bug #947105.
|
| 85 |
86 |
emake \
|
| 86 |
87 |
MACH="${arch}" \
|
| 87 |
88 |
OS="${os}" \
|
| 88 |
89 |
HAVE_SSE42=$(usex cpu_flags_x86_sse4_2 1 0) \
|
| 89 |
90 |
HAVE_AVX2=$(usex cpu_flags_x86_avx2 1 0) \
|
| 90 |
|
RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS} -D_LARGEFILE64_SOURCE" \
|
|
91 |
HAVE_LZMA=$(usex lzma 1 0) \
|
|
92 |
HAVE_LZO=$(usev lzo 1) \
|
|
93 |
HAVE_OPENSSL=0 \
|
|
94 |
RPM_OPT_FLAGS="${CFLAGS} ${CPPFLAGS}" \
|
| 91 |
95 |
CFLAGS_OPT='$(CFLAGS)' \
|
| 92 |
96 |
LDFLAGS="${LDFLAGS} -Wl,-rpath,${EPREFIX}/usr/$(get_libdir)/${PN}" \
|
| 93 |
97 |
CC="$(tc-getCC)" \
|
| ... | ... | |
| 99 |
103 |
}
|
| 100 |
104 |
|
| 101 |
105 |
src_test() {
|
| 102 |
|
append-cflags -fcommon # bug #707796
|
|
106 |
if ! use lzo ; then
|
|
107 |
sed -i \
|
|
108 |
-e '/^LZOP=/s:LZOP=.*:LZOP=:' \
|
|
109 |
-e '/^LZOP=/a exit 0' \
|
|
110 |
test_lzo.sh || die
|
|
111 |
fi
|
|
112 |
|
| 103 |
113 |
_emake check
|
| 104 |
114 |
}
|
| 105 |
115 |
|