x11-terms/xfce4-terminal: Bump to 0.8.9.2
[gentoo.git] / x11-terms / kitty / kitty-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{7,8} )
7
8 inherit eutils python-single-r1 toolchain-funcs xdg
9
10 if [[ ${PV} == "9999" ]] ; then
11         EGIT_REPO_URI="https://github.com/kovidgoyal/kitty.git"
12         inherit git-r3
13 else
14         SRC_URI="https://github.com/kovidgoyal/kitty/releases/download/v${PV}/${P}.tar.xz"
15         KEYWORDS="~amd64 ~x86"
16 fi
17
18 DESCRIPTION="A modern, hackable, featureful, OpenGL-based terminal emulator"
19 HOMEPAGE="https://github.com/kovidgoyal/kitty"
20
21 LICENSE="GPL-3"
22 SLOT="0"
23 IUSE="debug wayland"
24 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
25
26 RDEPEND="
27         ${PYTHON_DEPS}
28         media-libs/fontconfig
29         media-libs/freetype:2
30         >=media-libs/harfbuzz-1.5.0:=
31         media-libs/libcanberra
32         media-libs/libpng:0=
33         x11-libs/libxcb[xkb]
34         x11-libs/libXcursor
35         x11-libs/libXi
36         x11-libs/libXinerama
37         x11-libs/libxkbcommon[X]
38         x11-libs/libXrandr
39         sys-apps/dbus
40         sys-libs/zlib
41         wayland? (
42                 dev-libs/wayland
43                 >=dev-libs/wayland-protocols-1.17
44         )
45 "
46
47 DEPEND="${RDEPEND}
48         media-libs/mesa[X(+)]
49         sys-libs/ncurses
50 "
51
52 BDEPEND="virtual/pkgconfig"
53
54 [[ ${PV} == *9999 ]] && BDEPEND+=" >=dev-python/sphinx-1.7"
55
56 PATCHES=(
57         "${FILESDIR}"/kitty-9999-flags.patch
58         "${FILESDIR}"/${PN}-0.14.4-svg-icon.patch
59 )
60
61 src_prepare() {
62         default
63
64         # disable wayland as required
65         if ! use wayland; then
66                 sed -i "/'x11 wayland'/s/ wayland//" setup.py || die
67         fi
68
69         # respect doc dir
70         sed -i "/htmldir =/s/appname/'${PF}'/" setup.py || die
71
72         tc-export CC
73 }
74
75 src_compile() {
76         "${EPYTHON}" setup.py \
77                 --verbose $(usex debug --debug "") \
78                 --libdir-name $(get_libdir) \
79                 linux-package || die "Failed to compile kitty."
80 }
81
82 src_test() {
83         export KITTY_CONFIG_DIRECTORY=${T}
84         "${EPYTHON}" test.py || die
85 }
86
87 src_install() {
88         insinto /usr
89         doins -r linux-package/*
90         dobin linux-package/bin/kitty
91         python_fix_shebang "${ED}"
92 }
93
94 pkg_postinst() {
95         xdg_icon_cache_update
96         optfeature "Displaying images in the terminal" virtual/imagemagick-tools
97 }
98
99 pkg_postrm() {
100         xdg_icon_cache_update
101 }