| 1 |
|
# Copyright 1999-2018 Gentoo Foundation
|
|
1 |
# Copyright 1999-2026 Gentoo Authors
|
| 2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
3 |
|
| 4 |
|
EAPI=6
|
|
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
COMMIT=6837474129968d7de13d91e5454bd824c9136e73
|
| 7 |
|
inherit autotools flag-o-matic gnome2-utils
|
|
6 |
inherit flag-o-matic qmake-utils xdg-utils
|
| 8 |
7 |
|
| 9 |
8 |
DESCRIPTION="Checks and undeletes partitions + PhotoRec, signature based recovery tool"
|
| 10 |
9 |
HOMEPAGE="https://www.cgsecurity.org/wiki/TestDisk"
|
| 11 |
|
SRC_URI="https://git.cgsecurity.org/cgit/${PN}/snapshot/${PN}-${COMMIT}.tar.gz -> ${P}.tar.gz"
|
|
10 |
SRC_URI="https://www.cgsecurity.org/${P}.tar.bz2"
|
| 12 |
11 |
|
| 13 |
|
LICENSE="GPL-2"
|
|
12 |
LICENSE="GPL-2+"
|
| 14 |
13 |
SLOT="0"
|
| 15 |
|
KEYWORDS="amd64 ~arm ~hppa ~ppc x86"
|
| 16 |
|
IUSE="ewf jpeg ntfs qt5 reiserfs static zlib"
|
| 17 |
|
|
| 18 |
|
REQUIRED_USE="static? ( !qt5 )"
|
|
14 |
KEYWORDS="amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv x86"
|
|
15 |
IUSE="jpeg ntfs gui reiserfs static +sudo zlib"
|
|
16 |
REQUIRED_USE="static? ( !gui )"
|
|
17 |
|
|
18 |
QA_CONFIG_IMPL_DECL_SKIP=(
|
|
19 |
'ntfs_mbstoucs' # configure script checking NTFS, has fallbacks
|
|
20 |
)
|
| 19 |
21 |
|
| 20 |
22 |
# WARNING: reiserfs support does NOT work with reiserfsprogs
|
| 21 |
23 |
# you MUST use progsreiserfs-0.3.1_rc8 (the last version ever released).
|
| 22 |
|
COMMON_DEPEND="
|
|
24 |
# sudo is detected during configure for extra functionality, see bug #892904
|
|
25 |
DEPEND="
|
|
26 |
sudo? ( app-admin/sudo )
|
| 23 |
27 |
static? (
|
| 24 |
28 |
sys-apps/util-linux[static-libs]
|
| 25 |
29 |
sys-fs/e2fsprogs[static-libs]
|
| 26 |
30 |
sys-libs/ncurses:0[static-libs]
|
| 27 |
|
jpeg? ( virtual/jpeg:0[static-libs] )
|
| 28 |
|
ntfs? ( sys-fs/ntfs3g:=[static-libs] )
|
|
31 |
jpeg? ( media-libs/libjpeg-turbo:=[static-libs] )
|
|
32 |
ntfs? ( sys-fs/ntfs3g[static-libs] )
|
| 29 |
33 |
reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8[static-libs] )
|
| 30 |
|
zlib? ( sys-libs/zlib[static-libs] )
|
| 31 |
|
!arm? ( ewf? ( app-forensics/libewf:=[static-libs] ) )
|
|
34 |
zlib? ( virtual/zlib:=[static-libs] )
|
| 32 |
35 |
)
|
| 33 |
36 |
!static? (
|
| 34 |
37 |
sys-apps/util-linux
|
| 35 |
38 |
sys-fs/e2fsprogs
|
| 36 |
39 |
sys-libs/ncurses:0=
|
| 37 |
|
jpeg? ( virtual/jpeg:0 )
|
| 38 |
|
ntfs? ( sys-fs/ntfs3g )
|
| 39 |
|
qt5? (
|
|
40 |
jpeg? ( media-libs/libjpeg-turbo:= )
|
|
41 |
ntfs? ( sys-fs/ntfs3g:= )
|
|
42 |
gui? (
|
| 40 |
43 |
dev-qt/qtcore:5
|
| 41 |
44 |
dev-qt/qtgui:5
|
| 42 |
45 |
dev-qt/qtwidgets:5
|
| 43 |
46 |
)
|
| 44 |
47 |
reiserfs? ( >=sys-fs/progsreiserfs-0.3.1_rc8 )
|
| 45 |
|
zlib? ( sys-libs/zlib )
|
| 46 |
|
!arm? ( ewf? ( app-forensics/libewf:= ) )
|
|
48 |
zlib? ( virtual/zlib:= )
|
| 47 |
49 |
)
|
| 48 |
50 |
"
|
| 49 |
|
DEPEND="${COMMON_DEPEND}
|
| 50 |
|
qt5? ( dev-qt/linguist-tools:5 )
|
|
51 |
RDEPEND="
|
|
52 |
sudo? ( app-admin/sudo )
|
|
53 |
!static? ( ${DEPEND} )
|
| 51 |
54 |
"
|
| 52 |
|
RDEPEND="!static? ( ${COMMON_DEPEND} )"
|
| 53 |
|
|
| 54 |
|
DOCS=( )
|
|
55 |
BDEPEND="gui? ( dev-qt/linguist-tools:5 )"
|
| 55 |
56 |
|
| 56 |
|
S="${WORKDIR}/${PN}-${COMMIT}"
|
|
57 |
DOCS=()
|
| 57 |
58 |
|
| 58 |
|
src_prepare() {
|
| 59 |
|
default
|
| 60 |
|
eautoreconf
|
| 61 |
|
}
|
|
59 |
PATCHES=(
|
|
60 |
# https://github.com/cgsecurity/testdisk/commit/2c6780ca1edd0b0ba2e5e86b12634e3cc8475872
|
|
61 |
"${FILESDIR}/${P}-musl.patch"
|
|
62 |
)
|
| 62 |
63 |
|
| 63 |
64 |
src_configure() {
|
| 64 |
|
local myeconfargs=(
|
| 65 |
|
--enable-sudo
|
| 66 |
|
--without-ntfs
|
| 67 |
|
$(use_with ewf)
|
|
65 |
export MOC="$(qt5_get_bindir)/moc"
|
|
66 |
export PATH="$(qt5_get_bindir):${PATH}"
|
|
67 |
|
|
68 |
local myconf=(
|
|
69 |
--without-ntfs # old NTFS implementation, use ntfs-3g instead.
|
|
70 |
--without-ewf # app-forensics/libewf removed from ::gentoo
|
| 68 |
71 |
$(use_with jpeg)
|
| 69 |
72 |
$(use_with ntfs ntfs3g)
|
| 70 |
|
$(use_enable qt5 qt)
|
|
73 |
$(use_enable gui qt)
|
|
74 |
$(use_enable sudo)
|
| 71 |
75 |
$(use_with reiserfs)
|
| 72 |
76 |
$(use_with zlib)
|
| 73 |
77 |
)
|
| ... | ... | |
| 76 |
80 |
# target, but better, as it doesn't break.
|
| 77 |
81 |
use static && append-ldflags -static
|
| 78 |
82 |
|
| 79 |
|
econf "${myeconfargs[@]}"
|
|
83 |
econf "${myconf[@]}"
|
| 80 |
84 |
|
| 81 |
85 |
# perform safety checks for NTFS, REISERFS and JPEG
|
| 82 |
|
if use ntfs && ! egrep -q '^#define HAVE_LIBNTFS(3G)? 1$' "${S}"/config.h ; then
|
|
86 |
if use ntfs && ! grep -E -q '^#define HAVE_LIBNTFS(3G)? 1$' "${S}"/config.h ; then
|
| 83 |
87 |
die "Failed to find either NTFS or NTFS-3G library."
|
| 84 |
88 |
fi
|
| 85 |
|
if use reiserfs && egrep -q 'undef HAVE_LIBREISERFS\>' "${S}"/config.h ; then
|
|
89 |
if use reiserfs && grep -E -q 'undef HAVE_LIBREISERFS\>' "${S}"/config.h ; then
|
| 86 |
90 |
die "Failed to find reiserfs library."
|
| 87 |
91 |
fi
|
| 88 |
|
if use jpeg && egrep -q 'undef HAVE_LIBJPEG\>' "${S}"/config.h ; then
|
|
92 |
if use jpeg && grep -E -q 'undef HAVE_LIBJPEG\>' "${S}"/config.h ; then
|
| 89 |
93 |
die "Failed to find jpeg library."
|
| 90 |
94 |
fi
|
| 91 |
95 |
}
|
| 92 |
96 |
|
| 93 |
97 |
pkg_postinst() {
|
| 94 |
|
gnome2_icon_cache_update
|
|
98 |
xdg_icon_cache_update
|
| 95 |
99 |
}
|
| 96 |
100 |
|
| 97 |
101 |
pkg_postrm() {
|
| 98 |
|
gnome2_icon_cache_update
|
|
102 |
xdg_icon_cache_update
|
| 99 |
103 |
}
|