blob: b543813618521a889d3f97b45e2f508507c5238c (
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
|
# Copyright 2019-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
inherit python-any-r1
DESCRIPTION="A fast and low-memory footprint OCI Container Runtime fully written in C"
HOMEPAGE="https://github.com/containers/crun"
if [[ "$PV" == *9999* ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/containers/${PN}.git"
else
SRC_URI="https://github.com/containers/${PN}/releases/download/${PV}/${P}.tar.gz"
KEYWORDS="amd64 ~arm arm64 ~loong ppc64 ~riscv"
fi
LICENSE="GPL-2+ LGPL-2.1+"
SLOT="0"
IUSE="+bpf +caps criu +seccomp selinux systemd static-libs"
DEPEND="
dev-libs/yajl:=
sys-kernel/linux-headers
caps? ( sys-libs/libcap )
criu? ( >=sys-process/criu-3.15 )
seccomp? ( sys-libs/libseccomp )
systemd? ( sys-apps/systemd:= )
"
RDEPEND="${DEPEND}
selinux? ( sec-policy/selinux-container )"
BDEPEND="
${PYTHON_DEPS}
virtual/pkgconfig
"
src_configure() {
local myeconfargs=(
--cache-file="${S}"/config.cache
$(use_enable bpf)
$(use_enable caps)
$(use_enable criu)
$(use_enable seccomp)
$(use_enable systemd)
$(usex static-libs '--enable-shared --enable-static' '--enable-shared --disable-static' '' '')
)
econf "${myeconfargs[@]}"
}
src_test() {
emake check-TESTS -C ./libocispec
# the crun test suite is comprehensive to the extent that tests will fail
# within a sandbox environment, due to the nature of the privileges
# required to create linux "containers".
local supported_tests=(
"tests/tests_libcrun_utils"
"tests/tests_libcrun_errors"
"tests/tests_libcrun_intelrdt"
"tests/test_oci_features"
)
emake check-TESTS TESTS="${supported_tests[*]}"
}
src_install() {
emake "DESTDIR=${D}" install-exec
doman crun.1
einstalldocs
einfo "Cleaning up .la files"
find "${ED}" -name '*.la' -delete || die
}
|