From edcbb6da11f5dc608aecc2c0ae81c27bf0c0f1d0 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Sun, 26 Feb 2017 19:36:04 +0100 Subject: [PATCH] pass: 1.6.5 -> 1.7 --- pkgs/tools/security/pass/default.nix | 27 +++++++-------- pkgs/tools/security/pass/program-name.patch | 13 -------- .../set-correct-program-name-for-sleep.patch | 33 ------------------- 3 files changed, 12 insertions(+), 61 deletions(-) delete mode 100644 pkgs/tools/security/pass/program-name.patch delete mode 100644 pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch diff --git a/pkgs/tools/security/pass/default.nix b/pkgs/tools/security/pass/default.nix index b0137619f0c1..58a7cc30059a 100644 --- a/pkgs/tools/security/pass/default.nix +++ b/pkgs/tools/security/pass/default.nix @@ -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 \ diff --git a/pkgs/tools/security/pass/program-name.patch b/pkgs/tools/security/pass/program-name.patch deleted file mode 100644 index db01942f638d..000000000000 --- a/pkgs/tools/security/pass/program-name.patch +++ /dev/null @@ -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 diff --git a/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch b/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch deleted file mode 100644 index f00307307eb5..000000000000 --- a/pkgs/tools/security/pass/set-correct-program-name-for-sleep.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 6ad29ae97263060c9ec95856e0d8ab18409108c0 Mon Sep 17 00:00:00 2001 -From: Franz Pletz -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 -