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 ];
|
|
|
|
|
2019-04-28 19:05:24 +01:00
|
|
|
modSha256 = "13yw7idgw8l48yvm4jjha0kbx6q22m2zp13y006mikavynqsr5kj";
|
2019-03-31 22:13:44 +01:00
|
|
|
|
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";
|
|
|
|
homepage = https://github.com/browserpass/browserpass-native;
|
|
|
|
license = licenses.isc;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ rvolosatovs infinisil ];
|
2017-04-10 22:21:20 +01:00
|
|
|
};
|
2017-04-22 14:13:02 +01:00
|
|
|
}
|