*/*: [QA] Fix trivial cases of MissingTestRestrict
[gentoo.git] / sys-libs / libblockdev / libblockdev-9999.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{2_7,3_{5,6,7}} )
7 inherit python-single-r1 xdg-utils
8
9 DESCRIPTION="A library for manipulating block devices"
10 HOMEPAGE="https://github.com/storaged-project/libblockdev"
11 if [[ "${PV}" == *9999 ]] ; then
12         inherit autotools git-r3
13         EGIT_REPO_URI="https://github.com/storaged-project/libblockdev.git"
14         BDEPEND="
15                 sys-devel/autoconf-archive
16         "
17 else
18         MY_PV="${PV}-1"
19         #MY_P="${PN}-${MY_PV}"
20         #SRC_URI="https://github.com/storaged-project/${PN}/archive/${MY_PV}.tar.gz -> ${MY_P}.tar.gz"
21         SRC_URI="https://github.com/storaged-project/${PN}/releases/download/${MY_PV}/${P}.tar.gz"
22         KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
23         #S="${WORKDIR}/${MY_P}"
24 fi
25 LICENSE="LGPL-2+"
26 SLOT="0"
27 IUSE="bcache +cryptsetup device-mapper dmraid escrow gtk-doc introspection lvm kbd test +tools vdo"
28 RESTRICT="!test? ( test )"
29
30 RDEPEND="
31         >=dev-libs/glib-2.42.2
32         dev-libs/libbytesize
33         >=sys-apps/kmod-19
34         >=sys-apps/util-linux-2.27
35         >=sys-block/parted-3.1
36         cryptsetup? (
37                 escrow? (
38                         >=dev-libs/nss-3.18.0
39                         dev-libs/volume_key
40                 )
41                 >=sys-fs/cryptsetup-1.6.7:=
42         )
43         device-mapper? ( sys-fs/lvm2 )
44         dmraid? (
45                 sys-fs/dmraid
46                 sys-fs/lvm2
47         )
48         lvm? (
49                 sys-fs/lvm2
50                 virtual/udev
51         )
52         vdo? ( dev-libs/libyaml )
53         ${PYTHON_DEPS}
54 "
55
56 DEPEND="
57         ${RDEPEND}
58 "
59
60 BDEPEND+="
61         dev-util/gtk-doc-am
62         gtk-doc? ( dev-util/gtk-doc )
63         introspection? ( >=dev-libs/gobject-introspection-1.3.0 )
64 "
65
66 REQUIRED_USE="${PYTHON_REQUIRED_USE}
67                 escrow? ( cryptsetup )"
68
69 pkg_setup() {
70         python-single-r1_pkg_setup
71 }
72
73 src_prepare() {
74         xdg_environment_reset #623992
75         default
76         [[ "${PV}" == *9999 ]] && eautoreconf
77 }
78
79 src_configure() {
80         local myeconfargs=(
81                 --with-btrfs
82                 --with-fs
83                 --with-part
84                 --without-mpath
85                 --without-nvdimm
86                 $(use_enable introspection)
87                 $(use_enable test tests)
88                 $(use_with bcache)
89                 $(use_with cryptsetup crypto)
90                 $(use_with device-mapper dm)
91                 $(use_with dmraid)
92                 $(use_with escrow)
93                 $(use_with gtk-doc)
94                 $(use_with kbd)
95                 $(use_with lvm lvm)
96                 $(use_with lvm lvm-dbus)
97                 $(use_with tools)
98                 $(use_with vdo)
99         )
100         if python_is_python3 ; then
101                 myeconfargs+=(
102                         --without-python2
103                         --with-python3
104                 )
105         else
106                 myeconfargs+=(
107                         --with-python2
108                         --without-python3
109                 )
110         fi
111         econf "${myeconfargs[@]}"
112 }
113
114 src_install() {
115         default
116         find "${ED}" -type f -name "*.la" -delete || die
117         # This is installed even with USE=-lvm, but libbd_lvm are omitted so it
118         # doesn't work at all.
119         if ! use lvm; then
120                 rm -f "${ED}"/usr/bin/lvm-cache-stats || die
121         fi
122 }