# Copyright 2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 CRATES=" acl-sys@1.2.2 anstream@0.6.21 anstyle@1.0.13 anstyle-parse@0.2.7 anstyle-query@1.1.5 anstyle-wincon@3.0.11 bitflags@1.3.2 bitflags@2.10.0 cfg-if@1.0.4 cfg_aliases@0.2.1 clap@4.5.54 clap_builder@4.5.54 clap_complete@4.5.65 clap_lex@0.7.6 colorchoice@1.0.4 is_terminal_polyfill@1.70.2 libc@0.2.179 libloading@0.9.0 log@0.4.29 memchr@2.7.6 nix@0.30.1 normalize-line-endings@0.3.0 once_cell_polyfill@1.70.2 posix-acl@1.2.0 quick-xml@0.30.0 shell-words@1.1.1 similar@2.7.0 simple-error@0.3.2 snapbox@0.6.23 snapbox-macros@0.4.0 strsim@0.11.1 testing_logger@0.1.1 utf8parse@0.2.2 windows-link@0.2.1 windows-sys@0.61.2 xcb@1.7.0 " RUST_MIN_VER="1.88.0" inherit cargo shell-completion DESCRIPTION="Alter Ego: run desktop applications as another user on Wayland or X11" HOMEPAGE="https://github.com/intgr/ego" SRC_URI=" https://static.crates.io/crates/${PN}/${P}.crate ${CARGO_CRATE_URIS} " LICENSE="Apache-2.0 BSD ISC LGPL-2.1 MIT" SLOT="0" KEYWORDS="~amd64" IUSE="X" DEPEND="sys-apps/acl" RDEPEND=" ${DEPEND} app-admin/sudo X? ( x11-libs/libxcb ) " src_test() { # Upstream tests mutate process-wide display variables. local -x RUST_TEST_THREADS=1 cargo_src_test } src_install() { cargo_src_install einstalldocs newbashcomp varia/ego-completion.bash ego newzshcomp varia/ego-completion.zsh _ego newfishcomp varia/ego-completion.fish ego.fish } pkg_postinst() { elog "Run inside your graphical session, for example:" elog " ego --sudo --user=root your-app" elog "The installed sudo enforces your existing sudoers policy." elog "No accounts, groups, sudoers grants, or Polkit rules are added." elog "Specify --user because upstream otherwise defaults to an ego account." elog "For graphical authentication, set SUDO_ASKPASS to an installed helper." }