pass: 1.6.5 -> 1.7

This commit is contained in:
Franz Pletz 2017-02-26 19:36:04 +01:00
parent 6ad3d089f1
commit edcbb6da11
No known key found for this signature in database
GPG Key ID: 846FDED7792617B4
3 changed files with 12 additions and 61 deletions

View File

@ -1,28 +1,27 @@
{ stdenv, fetchurl
, coreutils, gnused, getopt, pwgen, git, tree, gnupg, which, procps
{ stdenv, lib, fetchurl
, coreutils, gnused, getopt, git, tree, gnupg, which, procps, qrencode
, makeWrapper
, xclip ? null, xdotool ? null, dmenu ? null
, x11Support ? !stdenv.isDarwin
}:
with lib;
assert x11Support -> xclip != null
&& xdotool != null
&& dmenu != null;
stdenv.mkDerivation rec {
version = "1.6.5";
version = "1.7";
name = "password-store-${version}";
src = fetchurl {
url = "http://git.zx2c4.com/password-store/snapshot/${name}.tar.xz";
sha256 = "05bk3lrp5jwg0v338lvylp7glpliydzz4jf5pjr6k3kagrv3jyik";
sha256 = "002mw7j0m33bw483rllzhcf41wp3ixka8yma6kqrfaj57jyw66hn";
};
patches =
[ ./program-name.patch
./set-correct-program-name-for-sleep.patch
] ++ stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch;
patches = stdenv.lib.optional stdenv.isDarwin ./no-darwin-getopt.patch;
buildInputs = [ makeWrapper ];
@ -30,7 +29,7 @@ stdenv.mkDerivation rec {
description = "Stores, retrieves, generates, and synchronizes passwords securely";
homepage = http://www.passwordstore.org/;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ lovek323 the-kenny ];
maintainers = with maintainers; [ lovek323 the-kenny fpletz ];
platforms = platforms.unix;
longDescription = ''
@ -56,10 +55,8 @@ stdenv.mkDerivation rec {
# himself.
mkdir -p "$out/share/emacs/site-lisp"
cp "contrib/emacs/password-store.el" "$out/share/emacs/site-lisp/"
${if x11Support then ''
cp "contrib/dmenu/passmenu" "$out/bin/"
'' else ""}
'' + optionalString x11Support ''
cp "contrib/dmenu/passmenu" "$out/bin/"
'';
wrapperPath = with stdenv.lib; makeBinPath ([
@ -68,16 +65,16 @@ stdenv.mkDerivation rec {
git
gnupg
gnused
pwgen
tree
which
qrencode
] ++ stdenv.lib.optional stdenv.isLinux procps
++ ifEnable x11Support [ dmenu xclip xdotool ]);
postFixup = ''
# Fix program name in --help
substituteInPlace $out/bin/pass \
--replace "\$program" "pass"
--replace 'PROGRAM="''${0##*/}"' "PROGRAM=pass"
# Ensure all dependencies are in PATH
wrapProgram $out/bin/pass \

View File

@ -1,13 +0,0 @@
diff --git a/src/password-store.sh b/src/password-store.sh
index 6313384..6607a98 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -573,7 +573,7 @@ cmd_git() {
# END subcommand functions
#
-PROGRAM="${0##*/}"
+PROGRAM="pass"
COMMAND="$1"
case "$1" in

View File

@ -1,33 +0,0 @@
From 6ad29ae97263060c9ec95856e0d8ab18409108c0 Mon Sep 17 00:00:00 2001
From: Franz Pletz <fpletz@fnordicwalking.de>
Date: Sat, 3 Sep 2016 05:45:36 +0200
Subject: [PATCH] Set correct program name for sleep
---
src/password-store.sh | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/password-store.sh b/src/password-store.sh
index 63be840..ca47df3 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -133,11 +133,14 @@ clip() {
# 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
+ pkill -P $(pgrep -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"
(
- ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
+ # Execute sleep as a child process of bash because it may be
+ # a symlink to a single binary version of coreutils or busybox
+ # which depends on argv0 correctly set to "sleep"
+ ( exec -a "$sleep_argv0" bash <(echo sleep "$CLIP_TIME") )
local now="$(xclip -o -selection "$X_SELECTION" | base64)"
[[ $now != $(echo -n "$1" | base64) ]] && before="$now"
--
2.9.3