2019-06-16 20:59:06 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, gnupg }:
|
2019-04-28 19:05:24 +01:00
|
|
|
buildGoModule rec {
|
2019-03-31 22:13:44 +01:00
|
|
|
pname = "browserpass";
|
2019-04-14 20:16:17 +01:00
|
|
|
version = "3.0.6";
|
2017-11-05 13:38:03 +00:00
|
|
|
|
2017-06-13 00:03:02 +01:00
|
|
|
src = fetchFromGitHub {
|
2019-03-31 22:13:44 +01:00
|
|
|
owner = "browserpass";
|
|
|
|
repo = "browserpass-native";
|
2017-06-13 00:03:02 +01:00
|
|
|
rev = version;
|
2019-04-14 20:16:17 +01:00
|
|
|
sha256 = "0q3bsla07zjl6i69nj1axbkg2ia89pvh0jg6nlqgbm2kpzzbn0pz";
|
2017-04-10 22:21:20 +01:00
|
|
|
};
|
|
|
|
|
2019-03-31 22:13:44 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2020-05-01 02:59:00 +01:00
|
|
|
vendorSha256 = "1wcbn0ip596f2dp68y6jmxgv20l0dgrcxg5cwclkawigj05416zj";
|
2019-03-31 22:13:44 +01:00
|
|
|
|
2020-08-04 01:26:27 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2018-04-16 15:49:01 +01:00
|
|
|
postPatch = ''
|
2019-03-31 22:13:44 +01:00
|
|
|
# Because this Makefile will be installed to be used by the user, patch
|
|
|
|
# variables to be valid by default
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "PREFIX ?= /usr" ""
|
2019-04-14 20:16:17 +01:00
|
|
|
sed -i -e 's/SED :=.*/SED := sed/' Makefile
|
|
|
|
sed -i -e 's/INSTALL :=.*/INSTALL := install/' Makefile
|
2018-04-16 15:49:01 +01:00
|
|
|
'';
|
|
|
|
|
2019-04-28 19:05:24 +01:00
|
|
|
DESTDIR = placeholder "out";
|
2019-03-31 22:13:44 +01:00
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
make configure
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
make install
|
|
|
|
|
2019-04-28 19:05:24 +01:00
|
|
|
wrapProgram $out/bin/browserpass \
|
2019-03-31 22:13:44 +01:00
|
|
|
--suffix PATH : ${lib.makeBinPath [ gnupg ]}
|
2017-04-10 22:21:20 +01:00
|
|
|
|
2019-03-31 22:13:44 +01:00
|
|
|
# This path is used by our firefox wrapper for finding native messaging hosts
|
2019-04-28 19:05:24 +01:00
|
|
|
mkdir -p $out/lib/mozilla/native-messaging-hosts
|
|
|
|
ln -s $out/lib/browserpass/hosts/firefox/*.json $out/lib/mozilla/native-messaging-hosts
|
2017-04-10 22:21:20 +01:00
|
|
|
'';
|
|
|
|
|
2019-03-31 22:13:44 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Browserpass native client app";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/browserpass/browserpass-native";
|
2019-03-31 22:13:44 +01:00
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ rvolosatovs infinisil ];
|
2017-04-10 22:21:20 +01:00
|
|
|
};
|
2020-07-31 04:58:04 +01:00
|
|
|
}
|