blob: 32fbb2ec3b0ca109a8aa7865913bbf2d17bb2234 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{13..14} )
inherit python-single-r1 toolchain-funcs
DESCRIPTION="Tools for creating and converting OVA virtual appliance files"
HOMEPAGE="https://github.com/vmware/open-vmdk"
SRC_URI="https://github.com/vmware/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="fuse +python test"
RESTRICT="!test? ( test )"
PROPERTIES="test_network fuse? ( test_privileged )"
REQUIRED_USE="
python? ( ${PYTHON_REQUIRED_USE} )
test? ( ${PYTHON_REQUIRED_USE} )
"
PYDEPEND="
${PYTHON_DEPS}
$(python_gen_cond_dep '
dev-libs/libxml2[python,${PYTHON_USEDEP}]
dev-python/lxml[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/xmltodict[${PYTHON_USEDEP}]
')
"
DEPEND="
virtual/zlib
fuse? ( sys-fs/fuse:3= )
"
RDEPEND="
${DEPEND}
python? ( ${PYDEPEND} )
"
BDEPEND="
fuse? ( virtual/pkgconfig )
test? (
fuse? ( sys-fs/e2fsprogs[fuse] )
python? ( ${PYDEPEND} )
$(python_gen_cond_dep '
dev-python/pytest[${PYTHON_USEDEP}]
')
)
"
pkg_setup() {
if use python || use test; then
python-single-r1_pkg_setup
fi
}
my_emake() {
emake \
"$(use python || echo DIRS='vmdk ova templates')" \
PREFIX="${EPREFIX}/usr" \
"${@}"
}
src_compile() {
my_emake all $(usev fuse) CC="$(tc-getCC)"
}
src_test() {
local ignore=()
use python || ignore+=( pytest/test_*configs.py $(grep -Flr .py pytest) )
use fuse || ignore+=( pytest/test_fuse.py )
use fuse && addwrite /dev/fuse
epytest "${ignore[@]/#/--ignore=}"
}
src_install() {
my_emake install $(usex fuse install-fuse "") DESTDIR="${D}"
use python && python_fix_shebang "${ED}"/usr/bin
}
|