Commit: a87ce937a54bb64c88ca471093afe557fb9c0551 Parent: 5ba128ffbd19ac44e700f35446e0f166c3d618b4 Author: Randy Palamar Date: Sat, 5 Nov 2022 09:24:39 -0600 add pinentry-dmenu as a replacement for pinentry this also patches the gnupg ebuild to support pinentry-dmenu as an alternate pinentry provider Diffstat:
A | app-crypt/gnupg/Manifest | | | 2 | ++ |
A | app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch | | | 33 | +++++++++++++++++++++++++++++++++ |
A | app-crypt/gnupg/gnupg-2.2.39.ebuild | | | 168 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | app-crypt/pinentry-dmenu/pinentry-dmenu-9999.ebuild | | | 45 | +++++++++++++++++++++++++++++++++++++++++++++ |
4 files changed, 248 insertions(+), 0 deletions(-)
diff --git a/app-crypt/gnupg/Manifest b/app-crypt/gnupg/Manifest @@ -0,0 +1,2 @@ +DIST gnupg-2.2.39.tar.bz2 7290098 BLAKE2B a9e31830f3ef9ec6d8d461a85fcbe4b91bcac9607d3b5f13f5edc0c54505afb6c6c119cd397023b1378d96c7d0f15c0d60da1d15721e9a18eb3ea8c7b69fba83 SHA512 73f881c12c82010aeaada500517ff39ab22b27ff21b1248bc2228b60a2d75385a44a53c5cfadb8f6b84ef22ad9db0105096b6620fb689560809b324019713940 +DIST gnupg-2.2.39.tar.bz2.sig 119 BLAKE2B 584d7d36671670ac507948257e9c6be556ed2a2d3c0100bb2746edfe96df5ee1d4c6172fe0cae39d85fc290097bc5f6e1b351debc8ec2f5cc78047354fbed016 SHA512 6f7d7c2d1fae706b03c735cf453976c3aebef3f23659426f39a88c63d979f4d873ae09280d75dee9000805468d2a7f49d348609061939000f7cedf34ec5c6019 diff --git a/app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch b/app-crypt/gnupg/files/gnupg-2.1.20-gpgscm-Use-shorter-socket-path-lengts-to-improve-tes.patch @@ -0,0 +1,33 @@ +From e3bdb7d17264b8d5bd9abab97c96d9c4a50e4f61 Mon Sep 17 00:00:00 2001 +From: Kristian Fiskerstrand <kf@sumptuouscapital.com> +Date: Mon, 3 Apr 2017 23:44:56 +0300 +Subject: [PATCH] gpgscm: Use shorter socket path lengts to improve test + reliability + +-- +As socket lengths are normally restricted to 108 characters +(UNIX_PATH_MAX variable in /usr/include/linux/un.h), using 42 characters +by default easily results in errors. +--- + tests/gpgscm/tests.scm | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm +index 592b36f..f54a387 100644 +--- a/tests/gpgscm/tests.scm ++++ b/tests/gpgscm/tests.scm +@@ -273,9 +273,9 @@ + (canonical-path (_mkdtemp (if (null? components) + (path-join + (get-temp-path) +- (string-append "gpgscm-" (get-isotime) "-" ++ (string-append "gscm" + (basename-suffix *scriptname* ".scm") +- "-XXXXXX")) ++ "XXXXXX")) + (apply path-join components))))) + + ;; Make a temporary directory and remove it at interpreter shutdown. +-- +2.10.2 + diff --git a/app-crypt/gnupg/gnupg-2.2.39.ebuild b/app-crypt/gnupg/gnupg-2.2.39.ebuild @@ -0,0 +1,168 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Maintainers should: +# 1. Join the "Gentoo" project at https://dev.gnupg.org/project/view/27/ +# 2. Subscribe to release tasks like https://dev.gnupg.org/T6159 +# (find the one for the current release then subscribe to it + +# any subsequent ones linked within so you're covered for a while.) + +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gnupg.asc +inherit flag-o-matic systemd toolchain-funcs verify-sig + +MY_P="${P/_/-}" + +DESCRIPTION="The GNU Privacy Guard, a GPL OpenPGP implementation" +HOMEPAGE="https://gnupg.org/" +SRC_URI="mirror://gnupg/gnupg/${MY_P}.tar.bz2" +SRC_URI+=" verify-sig? ( mirror://gnupg/gnupg/${P}.tar.bz2.sig )" +S="${WORKDIR}/${MY_P}" + +LICENSE="GPL-3+" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="bzip2 doc ldap nls readline selinux +smartcard ssl test tofu tools usb user-socket wks-server" +RESTRICT="!test? ( test )" + +# Existence of executables is checked during configuration. +# Note: On each bump, update dep bounds on each version from configure.ac! +DEPEND=">=dev-libs/libassuan-2.5.0 + >=dev-libs/libgcrypt-1.8.0:= + >=dev-libs/libgpg-error-1.29 + >=dev-libs/libksba-1.3.5 + >=dev-libs/npth-1.2 + >=net-misc/curl-7.10 + sys-libs/zlib + bzip2? ( app-arch/bzip2 ) + ldap? ( net-nds/openldap:= ) + readline? ( sys-libs/readline:0= ) + smartcard? ( usb? ( virtual/libusb:1 ) ) + ssl? ( >=net-libs/gnutls-3.0:0= ) + tofu? ( >=dev-db/sqlite-3.7 )" + +RDEPEND="${DEPEND} + || ( + app-crypt/pinentry + app-crypt/pinentry-dmenu + ) + nls? ( virtual/libintl ) + selinux? ( sec-policy/selinux-gpg ) + wks-server? ( virtual/mta )" + +BDEPEND="virtual/pkgconfig + doc? ( sys-apps/texinfo ) + nls? ( sys-devel/gettext ) + verify-sig? ( sec-keys/openpgp-keys-gnupg )" + +DOCS=( + ChangeLog NEWS README THANKS TODO VERSION + doc/FAQ doc/DETAILS doc/HACKING doc/TRANSLATE doc/OpenPGP doc/KEYSERVER +) + +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=( + $(use_enable bzip2) + $(use_enable nls) + $(use_enable smartcard scdaemon) + $(use_enable ssl gnutls) + $(use_enable test all-tests) + $(use_enable test tests) + $(use_enable tofu) + $(use smartcard && use_enable usb ccid-driver || echo '--disable-ccid-driver') + $(use_enable wks-server wks-tools) + $(use_with ldap) + $(use_with readline) + --with-mailprog=/usr/libexec/sendmail + --disable-ntbtls + --enable-gpg + --enable-gpgsm + --enable-large-secmem + + CC_FOR_BUILD="$(tc-getBUILD_CC)" + GPG_ERROR_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpg-error-config" + KSBA_CONFIG="${ESYSROOT}/usr/bin/ksba-config" + LIBASSUAN_CONFIG="${ESYSROOT}/usr/bin/libassuan-config" + LIBGCRYPT_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-libgcrypt-config" + NPTH_CONFIG="${ESYSROOT}/usr/bin/npth-config" + + $("${S}/configure" --help | grep -o -- '--without-.*-prefix') + ) + + if use prefix && use usb; then + # bug #649598 + append-cppflags -I"${EPREFIX}/usr/include/libusb-1.0" + fi + + # bug #663142 + if use user-socket; then + myconf+=( --enable-run-gnupg-user-socket ) + fi + + # glib fails and picks up clang's internal stdint.h causing weird errors + tc-is-clang && export gl_cv_absolute_stdint_h="${ESYSROOT}"/usr/include/stdint.h + + # Hardcode mailprog to /usr/libexec/sendmail even if it does not exist. + # As of GnuPG 2.3, the mailprog substitution is used for the binary called + # by wks-client & wks-server; and if it's autodetected but not not exist at + # build time, then then 'gpg-wks-client --send' functionality will not + # work. This has an unwanted side-effect in stage3 builds: there was a + # [R]DEPEND on virtual/mta, which also brought in virtual/logger, bloating + # the build where the install guide previously make the user chose the + # logger & mta early in the install. + + econf "${myconf[@]}" +} + +src_compile() { + default + + use doc && emake -C doc html +} + +src_test() { + # bug #638574 + use tofu && export TESTFLAGS=--parallel + + default +} + +src_install() { + default + + use tools && + dobin \ + tools/{convert-from-106,gpg-check-pattern} \ + tools/{gpg-zip,gpgconf,gpgsplit,lspgpot,mail-signed-keys} \ + tools/make-dns-cert + + dosym gpg /usr/bin/gpg2 + dosym gpgv /usr/bin/gpgv2 + echo ".so man1/gpg.1" > "${ED}"/usr/share/man/man1/gpg2.1 || die + echo ".so man1/gpgv.1" > "${ED}"/usr/share/man/man1/gpgv2.1 || die + + dodir /etc/env.d + echo "CONFIG_PROTECT=/usr/share/gnupg/qualified.txt" >> "${ED}"/etc/env.d/30gnupg || die + + use doc && dodoc doc/gnupg.html/* doc/*.png + + systemd_douserunit doc/examples/systemd-user/*.{service,socket} +} diff --git a/app-crypt/pinentry-dmenu/pinentry-dmenu-9999.ebuild b/app-crypt/pinentry-dmenu/pinentry-dmenu-9999.ebuild @@ -0,0 +1,45 @@ +EAPI=8 +inherit git-r3 savedconfig + +DESCRIPTION="A pinentry program with the charm of dmenu" +HOMEPAGE="https://github.com/0x766F6964/pinentry-dmenu" +EGIT_REPO_URI="https://github.com/0x766F6964/pinentry-dmenu.git" + +LICENSE="MIT" +SLOT="0" +IUSE="savedconfig static xinerama" + +RDEPEND=" + media-libs/fontconfig + x11-libs/libX11 + x11-libs/libXft + xinerama? ( x11-libs/libXinerama ) +" +DEPEND=" + ${RDEPEND} + >=dev-libs/libassuan-2.1 + >=dev-libs/libgpg-error-1.17 + x11-base/xorg-proto +" + +src_prepare() { + default + + if use static; then + export CFLAGS="${CFLAGS} -static" + export LDFLAGS="${LDFLAGS} -static" + fi + + if ! use xinerama; then + sed /^XINERAMA/d <config.mk >config.mk.new + mv config.mk.new config.mk + fi + + restore_config config.h +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}${LOCAL_PREFIX}" install + + save_config config.h +}