dev-python/mpmath: Bump to 1.4.0_alpha4
[gentoo/gentoo.git] / x11-wm / qtile / qtile-0.28.1.ebuild
blob7bd2f780e08e5d252b43145c843e610dec94c65d
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 DISTUTILS_EXT=1
7 DISTUTILS_USE_PEP517=standalone
8 PYTHON_COMPAT=( python3_{10..12} )
10 inherit distutils-r1 pypi virtualx
12 DESCRIPTION="A full-featured, hackable tiling window manager written in Python"
13 HOMEPAGE="
14         https://qtile.org/
15         https://github.com/qtile/qtile/
16         https://pypi.org/project/qtile/
19 LICENSE="MIT"
20 SLOT="0"
21 KEYWORDS="amd64 ~riscv"
22 IUSE="pulseaudio wayland"
24 RDEPEND="
25         >=dev-python/cairocffi-1.6.0[${PYTHON_USEDEP}]
26         >=dev-python/cffi-1.1.0:=[${PYTHON_USEDEP}]
27         dev-python/dbus-next[${PYTHON_USEDEP}]
28         dev-python/pygobject[${PYTHON_USEDEP}]
29         >=dev-python/xcffib-1.4.0[${PYTHON_USEDEP}]
30         x11-libs/cairo[X,xcb(+)]
31         x11-libs/libnotify[introspection]
32         x11-libs/pango
33         pulseaudio? (
34                 dev-python/pulsectl-asyncio[${PYTHON_USEDEP}]
35                 media-libs/libpulse
36         )
37         wayland? (
38                 >=dev-python/pywayland-0.4.17[${PYTHON_USEDEP}]
39                 >=dev-python/pywlroots-0.17[${PYTHON_USEDEP}]
40         )
42 BDEPEND="
43         dev-python/cffi[${PYTHON_USEDEP}]
44         dev-python/setuptools[${PYTHON_USEDEP}]
45         dev-python/setuptools-scm[${PYTHON_USEDEP}]
46         test? (
47                 dev-python/libcst[${PYTHON_USEDEP}]
48                 media-gfx/imagemagick[X]
49                 x11-base/xorg-server[xephyr,xvfb]
50         )
51         wayland? (
52                 >=dev-python/pywayland-0.4.17[${PYTHON_USEDEP}]
53                 >=dev-python/pywlroots-0.17[${PYTHON_USEDEP}]
54         )
57 distutils_enable_tests pytest
59 python_prepare_all() {
60         sed -e "s/can_import(\"wlroots.ffi_build\")/$(usex wayland True False)/" \
61                 -i setup.py || die
63         # some tests expect bin/qtile
64         mkdir bin || die
65         cat >> bin/qtile <<-EOF || die
66                 #!/bin/sh
67                 exec qtile "\${@}"
68         EOF
69         chmod +x bin/qtile || die
71         distutils-r1_python_prepare_all
74 src_compile() {
75         local -x CFFI_TMPDIR=${T}
76         distutils-r1_src_compile
79 src_test() {
80         virtx distutils-r1_src_test
83 python_test() {
84         local EPYTEST_DESELECT=(
85                 # mypy stuff
86                 test/test_check.py
87                 test/migrate/test_check_migrations.py
88                 # TODO: this test clearly requires x11 — so why is wayland
89                 # variant being run?
90                 'test/backend/x11/test_window.py::test_urgent_hook_fire[wayland-2]'
91         )
93         # force usage of built module
94         rm -rf libqtile || die
96         local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
97         local -x TZ=UTC
98         nonfatal epytest --backend=x11 $(usev wayland '--backend=wayland') ||
99                 die -n "Tests failed with ${EPYTHON}"
102 python_install_all() {
103         local DOCS=( CHANGELOG README.rst )
104         distutils-r1_python_install_all
106         insinto /usr/share/xsessions
107         doins resources/qtile.desktop
109         insinto /usr/share/wayland-sessions
110         doins resources/qtile-wayland.desktop
112         exeinto /etc/X11/Sessions
113         newexe "${FILESDIR}"/${PN}-session-r1 ${PN}