blob: 4159e6d31b6d4f46047404bb125e2279f4ca70c4 (
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..14} )
DISTUTILS_OPTIONAL=1
DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=meson-python
inherit distutils-r1 meson
DESCRIPTION="C Library for NVM Express on Linux"
HOMEPAGE="https://github.com/linux-nvme/libnvme"
SRC_URI="https://github.com/linux-nvme/libnvme/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
LICENSE="LGPL-2.1+"
SLOT="0/1"
KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86"
IUSE="dbus io-uring +json keyutils python ssl test"
RESTRICT="!test? ( test )"
REQUIRED_USE="
python? ( ${PYTHON_REQUIRED_USE} )
"
DEPEND="
json? ( dev-libs/json-c:= )
keyutils? ( sys-apps/keyutils:= )
dbus? ( sys-apps/dbus:= )
python? ( ${PYTHON_DEPS} )
ssl? ( >=dev-libs/openssl-1.1:= )
io-uring? ( sys-libs/liburing:= )
"
RDEPEND="
${DEPEND}
"
BDEPEND="
python? (
${DISTUTILS_DEPS}
dev-lang/swig
dev-python/meson-python[${PYTHON_USEDEP}]
)
"
distutils_enable_tests unittest
PATCHES=(
"${FILESDIR}"/libnvme-1.14-remove-glibc-include.patch
)
src_prepare() {
default
use python && distutils-r1_src_prepare
}
src_configure() {
local emesonargs=(
-Dpython=disabled
$(meson_use test tests)
$(meson_feature json json-c)
$(meson_feature dbus libdbus)
$(meson_feature keyutils)
$(meson_feature ssl openssl)
$(meson_feature io-uring liburing)
)
meson_src_configure
use python && distutils-r1_src_configure
}
python_compile() {
local emesonargs=(
-Dpython=enabled
)
meson_src_configure --reconfigure
distutils-r1_python_compile
}
src_compile() {
meson_src_compile
use python && distutils-r1_src_compile
}
src_test() {
meson_src_test
use python && distutils-r1_src_test
}
python_test() {
local -A test_args=(
["test-nbft.py"]="--filename=${S}/libnvme/tests/NBFT"
)
pushd "${BUILD_DIR}" >/dev/null || die
local testfile
for testfile in "${S}"/libnvme/tests/*.py; do
PYTHONPATH="${BUILD_DIR}" "${EPYTHON}" "${testfile}" \
${test_args[${testfile##*/}]} \
|| die "test ${testfile##*/} failed with ${EPYTHON}"
done
popd >/dev/null || die
}
src_install() {
meson_src_install
use python && distutils-r1_src_install
}
|