From owner-svn-ports-all@freebsd.org Fri Jul 24 04:07:16 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00FB836E304; Fri, 24 Jul 2020 04:07:15 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BCbJ32THzz4ZvP; Fri, 24 Jul 2020 04:07:15 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C83CF24498; Fri, 24 Jul 2020 04:07:14 +0000 (UTC) (envelope-from ashish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06O47Eg7027030; Fri, 24 Jul 2020 04:07:14 GMT (envelope-from ashish@FreeBSD.org) Received: (from ashish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06O47EKo027029; Fri, 24 Jul 2020 04:07:14 GMT (envelope-from ashish@FreeBSD.org) Message-Id: <202007240407.06O47EKo027029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ashish set sender to ashish@FreeBSD.org using -f From: Ashish SHUKLA Date: Fri, 24 Jul 2020 04:07:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r542998 - in head/sysutils/password-store: . files X-SVN-Group: ports-head X-SVN-Commit-Author: ashish X-SVN-Commit-Paths: in head/sysutils/password-store: . files X-SVN-Commit-Revision: 542998 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2020 04:07:16 -0000 Author: ashish Date: Fri Jul 24 04:07:14 2020 New Revision: 542998 URL: https://svnweb.freebsd.org/changeset/ports/542998 Log: - Add a non-default option WAYLAND to build port with wl-clipboard integration - Pet portlint PR: 248204 Approved by: rene Added: head/sysutils/password-store/files/extra-patch-wayland-copy-paste.diff (contents, props changed) Modified: head/sysutils/password-store/Makefile Modified: head/sysutils/password-store/Makefile ============================================================================== --- head/sysutils/password-store/Makefile Fri Jul 24 04:03:40 2020 (r542997) +++ head/sysutils/password-store/Makefile Fri Jul 24 04:07:14 2020 (r542998) @@ -2,7 +2,7 @@ PORTNAME= password-store PORTVERSION= 1.7.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= https://git.zx2c4.com/${PORTNAME}/snapshot/ @@ -12,22 +12,23 @@ COMMENT= Stores, retrieves, generates, and synchronize LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -USES= tar:xz - RUN_DEPENDS= bash:shells/bash \ getopt>=0:misc/getopt \ gnupg>=2:security/gnupg \ tree>=1.7:sysutils/tree +USES= tar:xz + NO_ARCH= yes NO_BUILD= yes -OPTIONS_DEFINE= CONTRIB EXAMPLES GIT XCLIP QRENCODE +OPTIONS_DEFINE= CONTRIB EXAMPLES GIT XCLIP WAYLAND QRENCODE OPTIONS_DEFAULT= CONTRIB XCLIP OPTIONS_SUB= yes GIT_DESC= Enable git storage XCLIP_DESC= Enable xclip feature +WAYLAND_DESC= Enable wl-clipboard support CONTRIB_DESC= Include shell completions, import scripts, related projects QRENCODE_DESC= Enable QR code support @@ -36,6 +37,8 @@ XCLIP_RUN_DEPENDS= base64>=0:converters/base64 \ xclip>=0:x11/xclip CONTRIB_RUN_DEPENDS= pwgen>=0:sysutils/pwgen QRENCODE_RUN_DEPENDS= libqrencode>=0:graphics/libqrencode +WAYLAND_RUN_DEPENDS= wl-clipboard>=0:x11/wl-clipboard +WAYLAND_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-wayland-copy-paste.diff:-p1 SUB_FILES= pass Added: head/sysutils/password-store/files/extra-patch-wayland-copy-paste.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/password-store/files/extra-patch-wayland-copy-paste.diff Fri Jul 24 04:07:14 2020 (r542998) @@ -0,0 +1,110 @@ +From b0b784b1a57c0b06936e6f5d6560712b4b810cd3 Mon Sep 17 00:00:00 2001 +From: Brett Cornwall +Date: Wed, 27 Feb 2019 00:08:33 -0700 +Subject: clip: Add support for wl-clipboard + +--- + README | 4 +++- + man/pass.1 | 5 +++++ + src/password-store.sh | 26 +++++++++++++++++++++----- + 3 files changed, 29 insertions(+), 6 deletions(-) + +diff --git a/README b/README +index 6b59965..1a46242 100644 +--- a/README ++++ b/README +@@ -19,8 +19,10 @@ Depends on: + http://www.gnupg.org/ + - git + http://www.git-scm.com/ +-- xclip ++- xclip (for X11 environments) + http://sourceforge.net/projects/xclip/ ++- wl-clipboard (for wlroots Wayland-based environments) ++ https://github.com/bugaevc/wl-clipboard + - tree >= 1.7.0 + http://mama.indstate.edu/users/ice/tree/ + - GNU getopt +diff --git a/man/pass.1 b/man/pass.1 +index 01a3fbe..a555dcb 100644 +--- a/man/pass.1 ++++ b/man/pass.1 +@@ -99,6 +99,8 @@ Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP + is specified, do not print the password but instead copy the first (or otherwise specified) + line to the clipboard using + .BR xclip (1) ++or ++.BR wl-clipboard(1) + and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. If \fI--qrcode\fP + or \fI-q\fP is specified, do not print the password but instead display a QR code using + .BR qrencode (1) +@@ -132,6 +134,8 @@ in generating passwords can be changed with the \fIPASSWORD_STORE_CHARACTER_SET\ + If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy + it to the clipboard using + .BR xclip (1) ++or ++.BR wl-clipboard(1) + and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. If \fI--qrcode\fP + or \fI-q\fP is specified, do not print the password but instead display a QR code using + .BR qrencode (1) +@@ -466,6 +470,7 @@ The location of the text editor used by \fBedit\fP. + .BR tr (1), + .BR git (1), + .BR xclip (1), ++.BR wl-clipboard (1), + .BR qrencode (1). + + .SH AUTHOR +diff --git a/src/password-store.sh b/src/password-store.sh +index d89d455..284eabf 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -152,16 +152,32 @@ check_sneaky_paths() { + # + + clip() { ++ if [[ -n $WAYLAND_DISPLAY ]]; then ++ local copy_cmd=( wl-copy ) ++ local paste_cmd=( wl-paste -n ) ++ if [[ $X_SELECTION == primary ]]; then ++ copy_cmd+=( --primary ) ++ paste_cmd+=( --primary ) ++ fi ++ local display_name="$WAYLAND_DISPLAY" ++ elif [[ -n $DISPLAY ]]; then ++ local copy_cmd=( xclip -selection "$X_SELECTION" ) ++ local paste_cmd=( xclip -o -selection "$X_SELECTION" ) ++ local display_name="$DISPLAY" ++ else ++ die "Error: No X11 or Wayland display detected" ++ fi ++ local sleep_argv0="password store sleep on display $display_name" ++ + # This base64 business is because bash cannot store binary data in a shell + # variable. Specifically, it cannot store nulls nor (non-trivally) store + # trailing new lines. +- local sleep_argv0="password store sleep on display $DISPLAY" + pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 +- local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | $BASE64)" +- echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" ++ local before="$("${paste_cmd[@]}" 2>/dev/null | $BASE64)" ++ echo -n "$1" | "${copy_cmd[@]}" || die "Error: Could not copy data to the clipboard" + ( + ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) +- local now="$(xclip -o -selection "$X_SELECTION" | $BASE64)" ++ local now="$("${paste_cmd[@]}" | $BASE64)" + [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" + + # It might be nice to programatically check to see if klipper exists, +@@ -173,7 +189,7 @@ clip() { + # so we axe it here: + qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null + +- echo "$before" | $BASE64 -d | xclip -selection "$X_SELECTION" ++ echo "$before" | $BASE64 -d | "${copy_cmd[@]}" + ) >/dev/null 2>&1 & disown + echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." + } +-- +cgit v1.2.3-4-ga26e +