3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
DISTUTILS_USE_PEP517=setuptools
|
7 |
|
PYTHON_COMPAT=( python3_{11..13} )
|
8 |
|
inherit distutils-r1 optfeature pypi
|
9 |
|
|
10 |
|
DESCRIPTION="Python binding to libudev"
|
11 |
|
HOMEPAGE="https://pyudev.readthedocs.io/en/latest/ https://github.com/pyudev/pyudev"
|
12 |
|
SRC_URI="https://github.com/pyudev/pyudev/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
|
|
6 |
MY_PN=DirectX-Headers
|
|
7 |
inherit dot-a meson-multilib
|
13 |
8 |
|
14 |
|
LICENSE="LGPL-2.1"
|
15 |
|
SLOT="0"
|
16 |
|
KEYWORDS="~alpha amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
|
17 |
|
|
18 |
|
# Known to fail on test system that aren't exactly the same devices as on CI
|
19 |
|
#RESTRICT="test"
|
20 |
|
|
21 |
|
RDEPEND="
|
22 |
|
virtual/udev
|
23 |
|
"
|
24 |
|
BDEPEND="
|
25 |
|
test? (
|
26 |
|
dev-python/docutils[${PYTHON_USEDEP}]
|
27 |
|
dev-python/hypothesis[${PYTHON_USEDEP}]
|
28 |
|
)
|
29 |
|
"
|
30 |
|
|
31 |
|
DOCS=( CHANGES.rst README.rst )
|
32 |
|
|
33 |
|
PATCHES=(
|
34 |
|
"${FILESDIR}/pyudev-0.24.3-tests.patch"
|
35 |
|
)
|
36 |
|
|
37 |
|
distutils_enable_tests pytest
|
|
9 |
if [[ ${PV} == *9999* ]]; then
|
|
10 |
EGIT_REPO_URI="https://github.com/microsoft/${MY_PN}.git"
|
|
11 |
inherit git-r3
|
|
12 |
else
|
|
13 |
SRC_URI="https://github.com/microsoft/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
14 |
KEYWORDS="~amd64 ~x86"
|
|
15 |
S="${WORKDIR}"/${MY_PN}-${PV}
|
|
16 |
fi
|
38 |
17 |
|
39 |
|
python_prepare_all() {
|
40 |
|
if use test; then
|
41 |
|
ewarn "If your PORTAGE_TMPDIR is longer in length then '/var/tmp/',"
|
42 |
|
ewarn "change it to /var/tmp to ensure tests will pass."
|
43 |
|
fi
|
|
18 |
DESCRIPTION="DirectX header files and WSL stubs"
|
|
19 |
HOMEPAGE="https://github.com/microsoft/DirectX-Headers"
|
44 |
20 |
|
45 |
|
# tests are known to pass then fail on alternate runs
|
46 |
|
# tests: fix run_path
|
47 |
|
sed -e "s|== \('/run/udev'\)|in (\1,'/dev/.udev')|g" \
|
48 |
|
-i tests/test_core.py || die
|
49 |
|
|
50 |
|
# disable usage of hypothesis timeouts (too short)
|
51 |
|
sed -e '/@settings/s/(/(deadline=None,/' -i tests{,/_device_tests}/*.py || die
|
52 |
|
|
53 |
|
# remove GUI tests that require a display server
|
54 |
|
rm tests/test_observer.py tests/test_observer_deprecated.py || die
|
|
21 |
LICENSE="MIT"
|
|
22 |
SLOT="0"
|
55 |
23 |
|
56 |
|
distutils-r1_python_prepare_all
|
57 |
|
}
|
|
24 |
multilib_src_configure() {
|
|
25 |
lto-guarantee-fat
|
58 |
26 |
|
59 |
|
python_test() {
|
60 |
|
local -a EPYTEST_DESELECT=(
|
61 |
|
# tests that require root access
|
62 |
|
tests/test_device.py::TestAttributes::test_asint
|
63 |
|
tests/test_device.py::TestAttributes::test_asbool
|
64 |
|
tests/test_device.py::TestAttributes::test_getitem
|
65 |
|
tests/test_device.py::TestAttributes::test_asstring
|
66 |
|
|
67 |
|
# tests don't work on systems that differ from the upstream CI
|
68 |
|
tests/test_monitor.py::TestMonitorObserver::test_deprecated_handler
|
69 |
|
tests/test_monitor.py::TestMonitorObserver::test_fake
|
|
27 |
local emesonargs=(
|
|
28 |
-Dbuild-test=false
|
70 |
29 |
)
|
71 |
|
epytest tests
|
72 |
|
}
|
73 |
30 |
|
74 |
|
src_test() {
|
75 |
|
local virt=$(systemd-detect-virt 2>/dev/null)
|
76 |
|
if [[ ${virt} == systemd-nspawn ]] ; then
|
77 |
|
ewarn "Skipping tests because in systemd-nspawn container"
|
78 |
|
else
|
79 |
|
distutils-r1_src_test
|
80 |
|
fi
|
|
31 |
meson_src_configure
|
81 |
32 |
}
|
82 |
33 |
|
83 |
|
pkg_postinst() {
|
84 |
|
optfeature "PyQt5 bindings" "dev-python/pyqt5"
|
|
34 |
multilib_src_install_all() {
|
|
35 |
strip-lto-bytecode
|
|
36 |
einstalldocs
|
|
37 |
|
85 |
38 |
}
|