Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

browserpass: 2.0.22 -> 3.0.1

See https://github.com/browserpass/browserpass-native/issues/31

This is fully backwards compatible.

(cherry picked from commit 6104fba188a084c3f7230ec39da43146d4203786)

+202 -44
+43
pkgs/tools/security/browserpass/2.nix
··· 1 + # This file was generated by https://github.com/kamilchm/go2nix v1.2.1 2 + { stdenv, buildGoPackage, fetchFromGitHub, gnupg }: 3 + 4 + buildGoPackage rec { 5 + name = "browserpass-${version}"; 6 + version = "2.0.22"; 7 + 8 + goPackagePath = "github.com/dannyvankooten/browserpass"; 9 + 10 + goDeps = ./2deps.nix; 11 + 12 + src = fetchFromGitHub { 13 + repo = "browserpass"; 14 + owner = "dannyvankooten"; 15 + rev = version; 16 + sha256 = "05cacrx08k99c5zra7ksdik9xxn3vih3x6in7536zs5gm55mkbfx"; 17 + }; 18 + 19 + postPatch = '' 20 + substituteInPlace browserpass.go \ 21 + --replace /usr/local/bin/gpg ${gnupg}/bin/gpg 22 + ''; 23 + 24 + postInstall = '' 25 + host_file="$bin/bin/browserpass" 26 + mkdir -p "$bin/etc" 27 + 28 + sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/chrome/host.json > chrome-host.json 29 + sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/firefox/host.json > firefox-host.json 30 + 31 + install chrome-host.json $bin/etc/ 32 + install -D firefox-host.json $bin/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json 33 + install go/src/${goPackagePath}/chrome/policy.json $bin/etc/chrome-policy.json 34 + ''; 35 + 36 + meta = with stdenv.lib; { 37 + description = "A Chrome & Firefox extension for zx2c4's pass"; 38 + homepage = https://github.com/dannyvankooten/browserpass; 39 + license = licenses.mit; 40 + platforms = with platforms; linux ++ darwin ++ openbsd; 41 + maintainers = with maintainers; [ rvolosatovs ]; 42 + }; 43 + }
+39
pkgs/tools/security/browserpass/2deps.nix
··· 1 + # This file was generated by https://github.com/kamilchm/go2nix v1.2.1 2 + [ 3 + { 4 + goPackagePath = "github.com/gokyle/twofactor"; 5 + fetch = { 6 + type = "git"; 7 + url = "https://github.com/gokyle/twofactor"; 8 + rev = "eaad1884d40f9cabff98a57a524c17afd00c9fe7"; 9 + sha256 = "07kvga6f2b56kpy52a3xk16garvlqz950s350dax97x7cayba95g"; 10 + }; 11 + } 12 + { 13 + goPackagePath = "github.com/mattn/go-zglob"; 14 + fetch = { 15 + type = "git"; 16 + url = "https://github.com/mattn/go-zglob"; 17 + rev = "4959821b481786922ac53e7ef25c61ae19fb7c36"; 18 + sha256 = "0rwkdw143kphpmingsrw1zp030zf3p08f64h347jpdm4lz8z5449"; 19 + }; 20 + } 21 + { 22 + goPackagePath = "github.com/sahilm/fuzzy"; 23 + fetch = { 24 + type = "git"; 25 + url = "https://github.com/sahilm/fuzzy"; 26 + rev = "a154b19bb758dcdd6ede58dc11ea53c2950527b2"; 27 + sha256 = "0jkw6474d5ik2fq2zznqxj4y3p42z47r7mbg856ln5wyara2sg0l"; 28 + }; 29 + } 30 + { 31 + goPackagePath = "rsc.io/qr"; 32 + fetch = { 33 + type = "git"; 34 + url = "https://github.com/rsc/qr"; 35 + rev = "48b2ede4844e13f1a2b7ce4d2529c9af7e359fc5"; 36 + sha256 = "1npxy32glnkvsp0871972jzjzgkwaqmbv6jsj9wgqsa1s2jr004p"; 37 + }; 38 + } 39 + ]
+51 -29
pkgs/tools/security/browserpass/default.nix
··· 1 - # This file was generated by https://github.com/kamilchm/go2nix v1.2.1 2 - { stdenv, buildGoPackage, fetchFromGitHub, gnupg }: 3 - 4 - buildGoPackage rec { 5 - name = "browserpass-${version}"; 6 - version = "2.0.22"; 7 - 8 - goPackagePath = "github.com/dannyvankooten/browserpass"; 9 - 10 - goDeps = ./deps.nix; 1 + { lib, callPackage, buildGoPackage, fetchFromGitHub, makeWrapper, gnupg }: 2 + let 3 + # For backwards compatibility with v2 of the browser extension, we embed v2 4 + # of the native host in v3. Because the extension will auto-update when it 5 + # is released, this code can be removed from that point on. 6 + # Don't forget to remove v2 references down below and the v2 files in this 7 + # folder 8 + v2 = callPackage ./2.nix {}; 9 + in buildGoPackage rec { 10 + pname = "browserpass"; 11 + version = "3.0.1"; 11 12 12 13 src = fetchFromGitHub { 13 - repo = "browserpass"; 14 - owner = "dannyvankooten"; 14 + owner = "browserpass"; 15 + repo = "browserpass-native"; 15 16 rev = version; 16 - sha256 = "05cacrx08k99c5zra7ksdik9xxn3vih3x6in7536zs5gm55mkbfx"; 17 + sha256 = "1i3xxysiiapz9y2v0gp13inx7j0d7n0khpmcsy9k95pzn53526dx"; 17 18 }; 18 19 20 + nativeBuildInputs = [ makeWrapper ]; 21 + 22 + goPackagePath = "github.com/browserpass/browserpass-native"; 23 + goDeps = ./deps.nix; 24 + 19 25 postPatch = '' 20 - substituteInPlace browserpass.go \ 21 - --replace /usr/local/bin/gpg ${gnupg}/bin/gpg 26 + # Because this Makefile will be installed to be used by the user, patch 27 + # variables to be valid by default 28 + substituteInPlace Makefile \ 29 + --replace "PREFIX ?= /usr" "" 22 30 ''; 23 31 24 - postInstall = '' 25 - host_file="$bin/bin/browserpass" 26 - mkdir -p "$bin/etc" 32 + DESTDIR = placeholder "bin"; 27 33 28 - sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/chrome/host.json > chrome-host.json 29 - sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/firefox/host.json > firefox-host.json 34 + postConfigure = '' 35 + cd "go/src/$goPackagePath" 36 + make configure 37 + ''; 30 38 31 - install chrome-host.json $bin/etc/ 32 - install -D firefox-host.json $bin/lib/mozilla/native-messaging-hosts/com.dannyvankooten.browserpass.json 33 - install go/src/${goPackagePath}/chrome/policy.json $bin/etc/chrome-policy.json 39 + buildPhase = '' 40 + make 34 41 ''; 35 42 36 - meta = with stdenv.lib; { 37 - description = "A Chrome & Firefox extension for zx2c4's pass"; 38 - homepage = https://github.com/dannyvankooten/browserpass; 39 - license = licenses.mit; 40 - platforms = with platforms; linux ++ darwin ++ openbsd; 41 - maintainers = with maintainers; [ rvolosatovs ]; 43 + installPhase = '' 44 + make install 45 + 46 + wrapProgram $bin/bin/browserpass \ 47 + --suffix PATH : ${lib.makeBinPath [ gnupg ]} 48 + 49 + # This path is used by our firefox wrapper for finding native messaging hosts 50 + mkdir -p $bin/lib/mozilla/native-messaging-hosts 51 + ln -s $bin/lib/browserpass/hosts/firefox/*.json $bin/lib/mozilla/native-messaging-hosts 52 + 53 + # These can be removed too, see comment up top 54 + ln -s ${lib.getBin v2}/etc $bin/etc 55 + ln -s ${lib.getBin v2}/lib/mozilla/native-messaging-hosts/* $bin/lib/mozilla/native-messaging-hosts 56 + ''; 57 + 58 + meta = with lib; { 59 + description = "Browserpass native client app"; 60 + homepage = https://github.com/browserpass/browserpass-native; 61 + license = licenses.isc; 62 + platforms = platforms.all; 63 + maintainers = with maintainers; [ rvolosatovs infinisil ]; 42 64 }; 43 65 }
+69 -15
pkgs/tools/security/browserpass/deps.nix
··· 1 - # This file was generated by https://github.com/kamilchm/go2nix v1.2.1 1 + # file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) 2 2 [ 3 3 { 4 - goPackagePath = "github.com/gokyle/twofactor"; 4 + goPackagePath = "github.com/davecgh/go-spew"; 5 + fetch = { 6 + type = "git"; 7 + url = "https://github.com/davecgh/go-spew"; 8 + rev = "v1.1.1"; 9 + sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y"; 10 + }; 11 + } 12 + { 13 + goPackagePath = "github.com/konsorten/go-windows-terminal-sequences"; 5 14 fetch = { 6 15 type = "git"; 7 - url = "https://github.com/gokyle/twofactor"; 8 - rev = "eaad1884d40f9cabff98a57a524c17afd00c9fe7"; 9 - sha256 = "07kvga6f2b56kpy52a3xk16garvlqz950s350dax97x7cayba95g"; 16 + url = "https://github.com/konsorten/go-windows-terminal-sequences"; 17 + rev = "v1.0.2"; 18 + sha256 = "09mn209ika7ciy87xf2x31dq5fnqw39jidgaljvmqxwk7ff1hnx7"; 10 19 }; 11 20 } 12 21 { ··· 14 23 fetch = { 15 24 type = "git"; 16 25 url = "https://github.com/mattn/go-zglob"; 17 - rev = "4959821b481786922ac53e7ef25c61ae19fb7c36"; 18 - sha256 = "0rwkdw143kphpmingsrw1zp030zf3p08f64h347jpdm4lz8z5449"; 26 + rev = "v0.0.1"; 27 + sha256 = "1sncdyq5fbd42al4amyy91h7vlzm3wm6c9vl8za2pjgfgsd581fz"; 19 28 }; 20 29 } 21 30 { 22 - goPackagePath = "github.com/sahilm/fuzzy"; 31 + goPackagePath = "github.com/pmezard/go-difflib"; 23 32 fetch = { 24 33 type = "git"; 25 - url = "https://github.com/sahilm/fuzzy"; 26 - rev = "a154b19bb758dcdd6ede58dc11ea53c2950527b2"; 27 - sha256 = "0jkw6474d5ik2fq2zznqxj4y3p42z47r7mbg856ln5wyara2sg0l"; 34 + url = "https://github.com/pmezard/go-difflib"; 35 + rev = "v1.0.0"; 36 + sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw"; 28 37 }; 29 38 } 30 39 { 31 - goPackagePath = "rsc.io/qr"; 40 + goPackagePath = "github.com/rifflock/lfshook"; 32 41 fetch = { 33 42 type = "git"; 34 - url = "https://github.com/rsc/qr"; 35 - rev = "48b2ede4844e13f1a2b7ce4d2529c9af7e359fc5"; 36 - sha256 = "1npxy32glnkvsp0871972jzjzgkwaqmbv6jsj9wgqsa1s2jr004p"; 43 + url = "https://github.com/rifflock/lfshook"; 44 + rev = "b9218ef580f5"; 45 + sha256 = "0wxqjcjfg8c0klmdgmbw3ckagby3wg9rkga9ihd4fsf05x5scxrc"; 46 + }; 47 + } 48 + { 49 + goPackagePath = "github.com/sirupsen/logrus"; 50 + fetch = { 51 + type = "git"; 52 + url = "https://github.com/sirupsen/logrus"; 53 + rev = "v1.4.0"; 54 + sha256 = "1y1qjcg19z7q9sy32rhc148kdql2aw7xkcm9d6r1blrl0mdgpx0w"; 55 + }; 56 + } 57 + { 58 + goPackagePath = "github.com/stretchr/objx"; 59 + fetch = { 60 + type = "git"; 61 + url = "https://github.com/stretchr/objx"; 62 + rev = "v0.1.1"; 63 + sha256 = "0iph0qmpyqg4kwv8jsx6a56a7hhqq8swrazv40ycxk9rzr0s8yls"; 64 + }; 65 + } 66 + { 67 + goPackagePath = "github.com/stretchr/testify"; 68 + fetch = { 69 + type = "git"; 70 + url = "https://github.com/stretchr/testify"; 71 + rev = "v1.3.0"; 72 + sha256 = "0wjchp2c8xbgcbbq32w3kvblk6q6yn533g78nxl6iskq6y95lxsy"; 73 + }; 74 + } 75 + { 76 + goPackagePath = "golang.org/x/crypto"; 77 + fetch = { 78 + type = "git"; 79 + url = "https://go.googlesource.com/crypto"; 80 + rev = "c2843e01d9a2"; 81 + sha256 = "01xgxbj5r79nmisdvpq48zfy8pzaaj90bn6ngd4nf33j9ar1dp8r"; 82 + }; 83 + } 84 + { 85 + goPackagePath = "golang.org/x/sys"; 86 + fetch = { 87 + type = "git"; 88 + url = "https://go.googlesource.com/sys"; 89 + rev = "fead79001313"; 90 + sha256 = "12vwl6sv6w7q0dyvynjhbp67242rhh77d6nlsb22ajr8rf17c63i"; 37 91 }; 38 92 } 39 93 ]