blob: c1c9e679f22cd6399c5b8a55507953c79cdf37e6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
{ lib, callPackage, buildGoPackage, fetchFromGitHub, makeWrapper, gnupg }:
let
# For backwards compatibility with v2 of the browser extension, we embed v2
# of the native host in v3. Because the extension will auto-update when it
# is released, this code can be removed from that point on.
# Don't forget to remove v2 references down below and the v2 files in this
# folder
v2 = callPackage ./2.nix {};
in buildGoPackage rec {
pname = "browserpass";
version = "3.0.1";
src = fetchFromGitHub {
owner = "browserpass";
repo = "browserpass-native";
rev = version;
sha256 = "1i3xxysiiapz9y2v0gp13inx7j0d7n0khpmcsy9k95pzn53526dx";
};
nativeBuildInputs = [ makeWrapper ];
goPackagePath = "github.com/browserpass/browserpass-native";
goDeps = ./deps.nix;
postPatch = ''
# Because this Makefile will be installed to be used by the user, patch
# variables to be valid by default
substituteInPlace Makefile \
--replace "PREFIX ?= /usr" ""
'';
DESTDIR = placeholder "bin";
postConfigure = ''
cd "go/src/$goPackagePath"
make configure
'';
buildPhase = ''
make
'';
installPhase = ''
make install
wrapProgram $bin/bin/browserpass \
--suffix PATH : ${lib.makeBinPath [ gnupg ]}
# This path is used by our firefox wrapper for finding native messaging hosts
mkdir -p $bin/lib/mozilla/native-messaging-hosts
ln -s $bin/lib/browserpass/hosts/firefox/*.json $bin/lib/mozilla/native-messaging-hosts
# These can be removed too, see comment up top
ln -s ${lib.getBin v2}/etc $bin/etc
ln -s ${lib.getBin v2}/lib/mozilla/native-messaging-hosts/* $bin/lib/mozilla/native-messaging-hosts
'';
meta = with lib; {
description = "Browserpass native client app";
homepage = https://github.com/browserpass/browserpass-native;
license = licenses.isc;
platforms = platforms.all;
maintainers = with maintainers; [ rvolosatovs infinisil ];
};
}
|