diff options
author | arcnmx <arcnmx@users.noreply.github.com> | 2019-07-27 11:45:46 -0700 |
---|---|---|
committer | arcnmx <arcnmx@users.noreply.github.com> | 2019-09-08 08:48:19 -0700 |
commit | c33a44a88596df9c8a6f8a9c400b45005c9a199e (patch) | |
tree | 35eaea132d83e62d49049b9d19b8abf8be3085de /pkgs/tools/networking | |
parent | 98d9589819218971a95fd64c172fe5996a9734f5 (diff) |
bukubrow: 2.4.0 -> 5.0.0
Diffstat (limited to 'pkgs/tools/networking')
-rw-r--r-- | pkgs/tools/networking/bukubrow/default.nix | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/pkgs/tools/networking/bukubrow/default.nix b/pkgs/tools/networking/bukubrow/default.nix index aee1b5c0e1d9..e83e72cbfb44 100644 --- a/pkgs/tools/networking/bukubrow/default.nix +++ b/pkgs/tools/networking/bukubrow/default.nix @@ -1,34 +1,46 @@ -{ stdenv, rustPlatform, fetchFromGitHub, sqlite }: +{ stdenv, rustPlatform, fetchFromGitHub, sqlite }: let -rustPlatform.buildRustPackage rec { - pname = "bukubrow"; - version = "2.4.0"; +manifest = { + description = "Bukubrow extension host application"; + name = "com.samhh.bukubrow"; + path = "@out@/bin/bukubrow"; + type = "stdio"; +}; + +in rustPlatform.buildRustPackage rec { + pname = "bukubrow-host"; + version = "5.0.0"; src = fetchFromGitHub { owner = "SamHH"; - repo = "bukubrow"; - rev = version; - sha256 = "1wrwav7am73bmgbpwh1pi0b8k7vhydqvw91hmmhnvbjhrhbns7s5"; + repo = pname; + rev = "v${version}"; + sha256 = "1a3gqxj6d1shv3w0v9m8x2xr0bvcynchy778yqalxkc3x4vr0nbn"; }; - sourceRoot = "source/binary"; - cargoSha256 = "0553awiba24a3a8xwjhlwf8yzbs44lnirjvcxnvsgah7dc44r0gj"; + cargoSha256 = "06nh99cvg3y4f98fs0j5bkidzq6fg46wk47z5jfzz5lf72ha54lk"; buildInputs = [ sqlite ]; + passAsFile = [ "firefoxManifest" "chromeManifest" ]; + firefoxManifest = builtins.toJSON (manifest // { + allowed_extensions = [ "bukubrow@samhh.com" ]; + }); + chromeManifest = builtins.toJSON (manifest // { + allowed_origins = [ "chrome-extension://ghniladkapjacfajiooekgkfopkjblpn/" ]; + }); + postBuild = '' + substituteAll $firefoxManifestPath firefox.json + substituteAll $chromeManifestPath chrome.json + ''; postInstall = '' - mkdir -p $out/etc $out/lib/mozilla/native-messaging-hosts - - host_file="$out/bin/bukubrow" - sed -e "s!%%replace%%!$host_file!" browser-hosts/firefox.json > "$out/etc/firefox-host.json" - sed -e "s!%%replace%%!$host_file!" browser-hosts/chrome.json > "$out/etc/chrome-host.json" - - ln -s $out/etc/firefox-host.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json + install -Dm0644 firefox.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json + install -Dm0644 chrome.json $out/etc/chromium/native-messaging-hosts/com.samhh.bukubrow.json ''; meta = with stdenv.lib; { description = "Bukubrow is a WebExtension for Buku, a command-line bookmark manager"; - homepage = https://github.com/SamHH/bukubrow; + homepage = https://github.com/SamHH/bukubrow-host; license = licenses.gpl3; platforms = platforms.all; maintainers = with maintainers; [ infinisil ]; |