1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{10..13} )
7 inherit flag-o-matic gnome.org meson python-any-r1 vala xdg
9 DESCRIPTION="Library providing a virtual terminal emulator widget"
10 HOMEPAGE="https://gitlab.gnome.org/GNOME/vte/"
12 # Upstream is hostile and refuses to upload tarballs.
13 SRC_URI="https://gitlab.gnome.org/GNOME/${PN}/-/archive/${PV}/${P}.tar.bz2"
16 https://dev.gentoo.org/~pacho/${PN}/${P}-command-notify.patch.xz
17 https://dev.gentoo.org/~pacho/${PN}/${P}-a11y-implement-GtkAccessibleText.patch.xz )
19 # Once SIXEL support ships (0.66 or later), might need xterm license (but code might be considered upgraded to LGPL-3+)
20 LICENSE="LGPL-3+ GPL-3+"
22 SLOT="2.91" # vte_api_version in meson.build
23 KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv sparc x86"
24 IUSE="+crypt debug gtk-doc +icu +introspection systemd +vala vanilla"
26 gtk-doc? ( introspection )
27 vala? ( introspection )
31 >=x11-libs/gtk+-3.24.22:3[introspection?]
33 >=dev-libs/fribidi-1.0.0
34 >=dev-libs/glib-2.72:2
35 crypt? ( >=net-libs/gnutls-3.2.7:0= )
36 icu? ( dev-libs/icu:= )
37 >=x11-libs/pango-1.22.0
38 >=dev-libs/libpcre2-10.21:=
39 systemd? ( >=sys-apps/systemd-220:= )
41 introspection? ( >=dev-libs/gobject-introspection-1.56:= )
42 x11-libs/pango[introspection?]
45 ~gui-libs/vte-common-${PV}[systemd?]
51 gtk-doc? ( dev-util/gi-docgen )
52 >=sys-devel/gettext-0.19.8
54 vala? ( $(vala_depend) )
57 PATCHES=( "${FILESDIR}/${PN}-0.76.3-stdint.patch" )
61 use vala && vala_setup
64 use elibc_musl && eapply "${FILESDIR}"/${PN}-0.66.2-musl-W_EXITCODE.patch
66 if ! use vanilla; then
67 # From https://src.fedoraproject.org/rpms/vte291/raw/f40/f/0001-add-notification-and-shell-precmd-preexec.patch
68 # Adds OSC 777 support for desktop notifications in gnome-terminal or elsewhere
69 eapply "${WORKDIR}"/${P}-command-notify.patch
70 # From https://src.fedoraproject.org/rpms/vte291/raw/f40/f/0001-a11y-implement-GtkAccessibleText.patch
71 # Migrate to GTK4 and add VteTerminal:enable-a11y feature flag
72 eapply "${WORKDIR}"/${P}-a11y-implement-GtkAccessibleText.patch
75 # -Ddebugg option enables various debug support via VTE_DEBUG, but also ggdb3; strip the latter
76 sed -e '/ggdb3/d' -i meson.build || die
77 sed -i 's/vte_gettext_domain = vte_api_name/vte_gettext_domain = vte_gtk3_api_name/' meson.build || die
81 # Upstream don't support LTO & error out on it in meson.build
87 $(meson_use gtk-doc docs)
88 $(meson_use introspection gir)
89 -Dfribidi=true # pulled in by pango anyhow
91 $(meson_use crypt gnutls)
95 $(meson_use systemd _systemd)
96 $(meson_use vala vapi)
102 # not meson_src_install because this would include einstalldocs, which
103 # would result in file collisions with gui-libs/vte
106 # Remove files that are provided by gui-libs/vte-common
107 rm "${ED}"/usr/libexec/vte-urlencode-cwd || die
108 rm "${ED}"/etc/profile.d/vte.sh || die
109 rm "${ED}"/etc/profile.d/vte.csh || die
111 rm "${ED}"/usr/lib/systemd/user/vte-spawn-.scope.d/defaults.conf || die
114 mkdir -p "${ED}"/usr/share/gtk-doc/ || die
115 mv "${ED}"/usr/share/doc/vte-${SLOT} "${ED}"/usr/share/gtk-doc/vte-${SLOT}-gtk3 || die