about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ff/ff2mpv-go/package.nix
blob: 71e0f98a478dc315b903e4da78291066847a1cca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib
, buildGoModule
, fetchgit
, mpv
}:
buildGoModule rec {
  pname = "ff2mpv-go";
  version = "1.0.1";

  src = fetchgit {
    url = "https://git.clsr.net/util/ff2mpv-go/";
    rev = "v${version}";
    hash = "sha256-e/AuOA3isFTyBf97Zwtr16yo49UdYzvktV5PKB/eH/s=";
  };

  vendorHash = null;

  postPatch = ''
    substituteInPlace ff2mpv.go --replace '"mpv"' '"${lib.getExe mpv}"'
  '';

  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;
    maintainers = with maintainers; [ ambroisie ];
    mainProgram = "ff2mpv-go";
  };
}