| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
PYTHON_COMPAT=( python3_{10..13} python3_13t )
|
| 7 |
|
inherit python-r1 meson
|
|
6 |
PYTHON_COMPAT=( python3_{11..14} )
|
|
7 |
DISTUTILS_OPTIONAL=1
|
|
8 |
DISTUTILS_EXT=1
|
|
9 |
DISTUTILS_USE_PEP517=meson-python
|
|
10 |
inherit distutils-r1 meson
|
| 8 |
11 |
|
| 9 |
12 |
DESCRIPTION="C Library for NVM Express on Linux"
|
| 10 |
13 |
HOMEPAGE="https://github.com/linux-nvme/libnvme"
|
| ... | ... | |
| 12 |
15 |
|
| 13 |
16 |
LICENSE="LGPL-2.1+"
|
| 14 |
17 |
SLOT="0/1"
|
| 15 |
|
KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86"
|
| 16 |
|
IUSE="dbus +json keyutils python ssl test +uuid"
|
|
18 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
|
|
19 |
IUSE="dbus examples io-uring +json keyutils python ssl test"
|
| 17 |
20 |
RESTRICT="!test? ( test )"
|
| 18 |
21 |
|
| 19 |
22 |
REQUIRED_USE="
|
| ... | ... | |
| 26 |
29 |
dbus? ( sys-apps/dbus:= )
|
| 27 |
30 |
python? ( ${PYTHON_DEPS} )
|
| 28 |
31 |
ssl? ( >=dev-libs/openssl-1.1:= )
|
| 29 |
|
uuid? ( sys-apps/util-linux:= )
|
|
32 |
io-uring? ( sys-libs/liburing:= )
|
| 30 |
33 |
"
|
| 31 |
34 |
RDEPEND="
|
| 32 |
35 |
${DEPEND}
|
| 33 |
36 |
"
|
| 34 |
37 |
BDEPEND="
|
| 35 |
|
python? ( dev-lang/swig )
|
|
38 |
python? (
|
|
39 |
${DISTUTILS_DEPS}
|
|
40 |
dev-lang/swig
|
|
41 |
dev-python/meson-python[${PYTHON_USEDEP}]
|
|
42 |
)
|
| 36 |
43 |
"
|
| 37 |
44 |
|
|
45 |
distutils_enable_tests unittest
|
|
46 |
|
|
47 |
src_prepare() {
|
|
48 |
default
|
|
49 |
use python && distutils-r1_src_prepare
|
|
50 |
}
|
|
51 |
|
| 38 |
52 |
src_configure() {
|
| 39 |
53 |
local emesonargs=(
|
| 40 |
54 |
-Dpython=disabled
|
| 41 |
55 |
$(meson_use test tests)
|
|
56 |
$(meson_use examples)
|
| 42 |
57 |
$(meson_feature json json-c)
|
| 43 |
58 |
$(meson_feature dbus libdbus)
|
| 44 |
59 |
$(meson_feature keyutils)
|
| 45 |
60 |
$(meson_feature ssl openssl)
|
|
61 |
$(meson_feature io-uring liburing)
|
| 46 |
62 |
)
|
| 47 |
63 |
meson_src_configure
|
|
64 |
use python && distutils-r1_src_configure
|
| 48 |
65 |
}
|
| 49 |
66 |
|
| 50 |
67 |
python_compile() {
|
| ... | ... | |
| 52 |
69 |
-Dpython=enabled
|
| 53 |
70 |
)
|
| 54 |
71 |
meson_src_configure --reconfigure
|
| 55 |
|
meson_src_compile
|
|
72 |
distutils-r1_python_compile
|
| 56 |
73 |
}
|
| 57 |
74 |
|
| 58 |
75 |
src_compile() {
|
| 59 |
76 |
meson_src_compile
|
| 60 |
77 |
|
| 61 |
|
if use python; then
|
| 62 |
|
python_copy_sources
|
| 63 |
|
python_foreach_impl python_compile
|
| 64 |
|
fi
|
|
78 |
use python && distutils-r1_src_compile
|
| 65 |
79 |
}
|
| 66 |
80 |
|
| 67 |
|
python_install() {
|
| 68 |
|
meson_src_install
|
| 69 |
|
use python && python_optimize
|
|
81 |
src_test() {
|
|
82 |
meson_src_test
|
|
83 |
use python && distutils-r1_src_test
|
| 70 |
84 |
}
|
| 71 |
85 |
|
| 72 |
|
src_install() {
|
| 73 |
|
use python && python_foreach_impl python_install
|
|
86 |
python_test() {
|
|
87 |
local -A test_args=(
|
|
88 |
["test-nbft.py"]="--filename=${S}/libnvme/tests/NBFT"
|
|
89 |
)
|
|
90 |
pushd "${BUILD_DIR}" >/dev/null || die
|
|
91 |
local testfile
|
|
92 |
for testfile in "${S}"/libnvme/tests/*.py; do
|
|
93 |
PYTHONPATH="${BUILD_DIR}" "${EPYTHON}" "${testfile}" \
|
|
94 |
${test_args[${testfile##*/}]} \
|
|
95 |
|| die "test ${testfile##*/} failed with ${EPYTHON}"
|
|
96 |
done
|
|
97 |
popd >/dev/null || die
|
|
98 |
}
|
| 74 |
99 |
|
|
100 |
src_install() {
|
| 75 |
101 |
meson_src_install
|
|
102 |
use python && distutils-r1_src_install
|
| 76 |
103 |
}
|