summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-crypt/gnupg/gnupg-2.2.19.ebuild')
-rw-r--r--app-crypt/gnupg/gnupg-2.2.19.ebuild13
1 files changed, 13 insertions, 0 deletions
diff --git a/app-crypt/gnupg/gnupg-2.2.19.ebuild b/app-crypt/gnupg/gnupg-2.2.19.ebuild
index 0a1d2df46afd..e756ff966ad1 100644
--- a/app-crypt/gnupg/gnupg-2.2.19.ebuild
+++ b/app-crypt/gnupg/gnupg-2.2.19.ebuild
@@ -53,6 +53,19 @@ PATCHES=(
"${FILESDIR}/${PN}-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch"
)
+src_prepare() {
+ default
+
+ # Inject SSH_AUTH_SOCK into user's sessions after enabling gpg-agent-ssh.socket in systemctl --user mode,
+ # idea borrowed from libdbus, see
+ # https://gitlab.freedesktop.org/dbus/dbus/-/blob/master/bus/systemd-user/dbus.socket.in#L6
+ #
+ # This cannot be upstreamed, as it requires determining the exact prefix of 'systemctl',
+ # which in turn requires discovery in Autoconf, something that upstream deeply resents.
+ sed -e "/DirectoryMode=/a ExecStartPost=-${EPREFIX}/bin/systemctl --user set-environment SSH_AUTH_SOCK=%t/gnupg/S.gpg-agent.ssh" \
+ -i doc/examples/systemd-user/gpg-agent-ssh.socket || die
+}
+
src_configure() {
local myconf=()