browserpass: switch build source to git HEAD

Precompiled version only supports linux64, git version should also support darwin
This commit is contained in:
pajowu 2017-04-10 23:21:20 +02:00
parent 857a3b872c
commit b70077f551
2 changed files with 28 additions and 29 deletions

View File

@ -11,7 +11,7 @@ with lib;
default = false;
type = types.bool;
description = ''
Wheter to install the NativeMessaging configuration for installed browsers.
Whether to install the NativeMessaging configuration for installed browsers.
'';
};
};

View File

@ -1,35 +1,34 @@
{ stdenv, lib, fetchzip }:
let
userDir = "~/.config/chromium";
in
stdenv.mkDerivation rec {
name = "browserpass-${version}";
# This file was generated by https://github.com/kamilchm/go2nix v1.2.0
{ stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
version = "1.0.2";
buildGoPackage rec {
name = "browserpass-unstable-${version}";
version = "HEAD";
rev = "HEAD";
src = fetchzip {
url = "https://github.com/dannyvankooten/browserpass/releases/download/${version}/browserpass-linux64.zip";
sha256 = "1fj2siczm472xd1n5i5k08cw94q5gpisfqmvrhhwq7zdjvpcrh8y";
stripRoot = false;
};
goPackagePath = "github.com/dannyvankooten/browserpass";
dontBuild = true;
src = fetchgit {
inherit rev;
url = "https://github.com/dannyvankooten/browserpass";
};
installPhase = ''
install -D browserpass-linux64 "$out/bin/browserpass"
postInstall = ''
host_file="$bin/bin/browserpass"
mkdir -p "$bin/etc"
host_file="$out/bin/browserpass"
sed -i -e "s!%%replace%%!$host_file!" chrome-host.json
sed -i -e "s!%%replace%%!$host_file!" firefox-host.json
sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/chrome/host.json > chrome-host.json
sed -e "s!%%replace%%!$host_file!" go/src/${goPackagePath}/firefox/host.json > firefox-host.json
install -D chrome-host.json "$out/etc/chrome-host.json"
install -D firefox-host.json "$out/etc/firefox-host.json"
install -D chrome-host.json $bin/etc/chrome-host.json
install -D firefox-host.json $bin/etc/firefox-host.json
'';
'';
meta = with lib; {
maintainers = with maintainers; [ cstrahan ];
platforms = ["x86_64-linux"];
};
}
meta = {
description = "A Chrome & Firefox extension for zx2c4's pass";
longDescription = "";
homepage = "https://github.com/dannyvankooten/browserpass";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
};
}