pkgs: add ff2mpv-go

This commit is contained in:
Bruno BELANYI 2021-05-11 18:46:43 +02:00
parent 2c8770ad70
commit 4d0ab2e5a6
2 changed files with 32 additions and 0 deletions

View file

@ -4,6 +4,8 @@ rec {
diff-flake = pkgs.callPackage ./diff-flake { }; diff-flake = pkgs.callPackage ./diff-flake { };
ff2mpv-go = pkgs.callPackage ./ff2mpv-go { };
havm = pkgs.callPackage ./havm { }; havm = pkgs.callPackage ./havm { };
i3-get-window-criteria = pkgs.callPackage ./i3-get-window-criteria { }; i3-get-window-criteria = pkgs.callPackage ./i3-get-window-criteria { };

View file

@ -0,0 +1,30 @@
{ buildGoModule, fetchgit, lib, mpv }:
buildGoModule rec {
pname = "ff2mpv-go";
version = "1.0.1";
src = fetchgit {
url = "https://git.clsr.net/util/ff2mpv-go/";
rev = "v${version}";
sha256 = "sha256-e/AuOA3isFTyBf97Zwtr16yo49UdYzvktV5PKB/eH/s=";
};
vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
postPatch = ''
sed -i -e 's,"mpv","${mpv}/bin/mpv",' ff2mpv.go
'';
postInstall = ''
mkdir -p "$out/lib/mozilla/native-messaging-hosts"
$out/bin/ff2mpv-go --manifest > "$out/lib/mozilla/native-messaging-hosts/ff2mpv.json"
'';
meta = with lib; {
description = ''
Native messaging host for ff2mpv written in Go.
'';
homepage = "https://git.clsr.net/util/ff2mpv-go/";
license = licenses.publicDomain;
};
}