app-admin/awscli: Bump to 1.37.9
[gentoo/gentoo.git] / x11-libs / vte / vte-0.76.3.ebuild
blob9b72b864a7c2c87e18092d4011e768935cb16dc0
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
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"
14 SRC_URI="${SRC_URI}
15         !vanilla? (
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"
25 REQUIRED_USE="
26         gtk-doc? ( introspection )
27         vala? ( introspection )
30 DEPEND="
31         >=x11-libs/gtk+-3.24.22:3[introspection?]
32         >=x11-libs/cairo-1.0
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:= )
40         >=app-arch/lz4-1.9
41         introspection? ( >=dev-libs/gobject-introspection-1.56:= )
42         x11-libs/pango[introspection?]
44 RDEPEND="${DEPEND}
45         ~gui-libs/vte-common-${PV}[systemd?]
47 BDEPEND="
48         ${PYTHON_DEPS}
49         dev-libs/libxml2:2
50         dev-util/glib-utils
51         gtk-doc? ( dev-util/gi-docgen )
52         >=sys-devel/gettext-0.19.8
53         virtual/pkgconfig
54         vala? ( $(vala_depend) )
57 PATCHES=( "${FILESDIR}/${PN}-0.76.3-stdint.patch" )
59 src_prepare() {
60         default
61         use vala && vala_setup
62         xdg_environment_reset
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
73         fi
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
80 src_configure() {
81         # Upstream don't support LTO & error out on it in meson.build
82         filter-lto
84         local emesonargs=(
85                 -Da11y=true
86                 $(meson_use debug)
87                 $(meson_use gtk-doc docs)
88                 $(meson_use introspection gir)
89                 -Dfribidi=true # pulled in by pango anyhow
90                 -Dglade=true
91                 $(meson_use crypt gnutls)
92                 -Dgtk3=true
93                 -Dgtk4=false
94                 $(meson_use icu)
95                 $(meson_use systemd _systemd)
96                 $(meson_use vala vapi)
97         )
98         meson_src_configure
101 src_install() {
102         # not meson_src_install because this would include einstalldocs, which
103         # would result in file collisions with gui-libs/vte
104         meson_install
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
110         if use systemd; then
111                 rm "${ED}"/usr/lib/systemd/user/vte-spawn-.scope.d/defaults.conf || die
112         fi
113         if use gtk-doc; then
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
116         fi