1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
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"
15 https://github.com/qtile/qtile/
16 https://pypi.org/project/qtile/
21 KEYWORDS="amd64 ~riscv"
22 IUSE="pulseaudio wayland"
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]
34 dev-python/pulsectl-asyncio[${PYTHON_USEDEP}]
38 >=dev-python/pywayland-0.4.17[${PYTHON_USEDEP}]
39 >=dev-python/pywlroots-0.17[${PYTHON_USEDEP}]
43 dev-python/cffi[${PYTHON_USEDEP}]
44 dev-python/setuptools[${PYTHON_USEDEP}]
45 dev-python/setuptools-scm[${PYTHON_USEDEP}]
47 dev-python/libcst[${PYTHON_USEDEP}]
48 media-gfx/imagemagick[X]
49 x11-base/xorg-server[xephyr,xvfb]
52 >=dev-python/pywayland-0.4.17[${PYTHON_USEDEP}]
53 >=dev-python/pywlroots-0.17[${PYTHON_USEDEP}]
57 distutils_enable_tests pytest
59 python_prepare_all() {
60 sed -e "s/can_import(\"wlroots.ffi_build\")/$(usex wayland True False)/" \
63 # some tests expect bin/qtile
65 cat >> bin/qtile <<-EOF || die
69 chmod +x bin/qtile || die
71 distutils-r1_python_prepare_all
75 local -x CFFI_TMPDIR=${T}
76 distutils-r1_src_compile
80 virtx distutils-r1_src_test
84 local EPYTEST_DESELECT=(
87 test/migrate/test_check_migrations.py
88 # TODO: this test clearly requires x11 — so why is wayland
90 'test/backend/x11/test_window.py::test_urgent_hook_fire[wayland-2]'
93 # force usage of built module
94 rm -rf libqtile || die
96 local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
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}