app-emacs/pinentry: new package, add 0.1_p20170913

This has been taken from lisp/net/pinentry.el in the GNU Emacs
repository. The file was dropped in Emacs 26 because of its sparse
documentation (see upstream bug at https://debbugs.gnu.org/27445
and etc/NEWS.26 in Emacs).

The package is still useful, e.g. with gpgsm, where loopback
pinentry-mode isn't supported by EasyPG.

The corresponding client is installed by app-crypt/pinentry[emacs]
as pinentry-emacs.

Signed-off-by: Ulrich Müller <ulm@gentoo.org>
This commit is contained in:
Ulrich Müller
2023-11-16 20:30:22 +01:00
parent 8165ba0b55
commit ecafd0276e
6 changed files with 87 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
DIST pinentry-0.1_p20170913.el.xz 4792 BLAKE2B b2c301720a42f43ad5d1986c427e972cfb197d98bd5bd878106a591e1d54800843f3e607c8d6933bd50b695ae8447d8d2aed772615846a5ce5acf6a67c009a8a SHA512 d582328e64abcc8ef964b4e4b136b9814ecc92edc930a922012809313f7dfdbf407890f9592d37b784f50fda44cf8acf5500881cf33966a1160c8496c201ac33
@@ -0,0 +1,11 @@
(add-to-list 'load-path "@SITELISP@")
(autoload 'pinentry-start "pinentry"
"Start a Pinentry service.
Once the environment is properly set, subsequent invocations of
the gpg command will interact with Emacs for passphrase input.
If the optional QUIET argument is non-nil, messages at startup
will not be shown.
\(fn &optional QUIET)" t)
+14
View File
@@ -0,0 +1,14 @@
This package (and corresponding support in app-crypt/pinentry)
provides a way to input a passphrase through the Emacs minibuffer.
To use it, add the line
allow-emacs-pinentry
to your gpg-agent.conf configuration file, which can usually be found
in the ~/.gnupg/ directory.
The pinentry server can be started with the command "pinentry-start".
You may add the following line to your Emacs configuration file:
(pinentry-start 'quiet)
@@ -0,0 +1,32 @@
Fix byte-compile warnings in Emacs 29.
Drop cl-lib which was needed only for cl-letf.
--- a/pinentry.el
+++ b/pinentry.el
@@ -49,8 +49,6 @@
;;; Code:
-(eval-when-compile (require 'cl-lib))
-
(defgroup pinentry nil
"The Pinentry server"
:version "25.1"
@@ -92,7 +90,7 @@
;; These error codes are defined in libgpg-error/src/err-codes.h.in.
(defmacro pinentry--error-code (code)
- (logior (lsh 5 24) code))
+ (logior (ash 5 24) code))
(defconst pinentry--error-not-implemented
(cons (pinentry--error-code 69) "not implemented"))
(defconst pinentry--error-cancelled
@@ -174,7 +172,7 @@
(ignore-errors
(let (delete-by-moving-to-trash)
(delete-file server-file)))
- (cl-letf (((default-file-modes) ?\700))
+ (with-file-modes ?\700
(setq pinentry--server-process
(make-network-process
:name "pinentry"
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>gnu-emacs@gentoo.org</email>
<name>Gentoo GNU Emacs project</name>
</maintainer>
<stabilize-allarches/>
</pkgmetadata>
@@ -0,0 +1,20 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit elisp readme.gentoo-r1
DESCRIPTION="GnuPG Pinentry server implementation for Emacs"
HOMEPAGE="https://www.emacswiki.org/emacs/EasyPG"
# taken from lisp/net/pinentry.el in GNU Emacs repo (commit bc511a64f6da)
SRC_URI="https://dev.gentoo.org/~ulm/distfiles/${P}.el.xz"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RDEPEND="app-crypt/pinentry[emacs]"
PATCHES=( "${FILESDIR}"/${PN}-emacs-29.patch )
SITEFILE="50${PN}-gentoo.el"