Unverified Commit 83799237 authored by Guillaume Girol's avatar Guillaume Girol Committed by GitHub
Browse files

Merge pull request #276742 from ambroisie/fix-ff2mpv-go-custom-mpv

ff2mpv-go: use 'PATH' to invoke 'mpv'
parents 13eba5bd c1272a15
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
{ lib
, buildGoModule
, fetchgit
, makeWrapper
, mpv
}:
buildGoModule rec {
@@ -13,17 +14,21 @@ buildGoModule rec {
    hash = "sha256-e/AuOA3isFTyBf97Zwtr16yo49UdYzvktV5PKB/eH/s=";
  };

  vendorHash = null;
  nativeBuildInputs = [
    makeWrapper
  ];

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

  postInstall = ''
    mkdir -p "$out/lib/mozilla/native-messaging-hosts"
    $out/bin/ff2mpv-go --manifest > "$out/lib/mozilla/native-messaging-hosts/ff2mpv.json"
  '';

  postFixup = ''
    wrapProgram $out/bin/ff2mpv-go --suffix PATH ":" ${lib.makeBinPath [ mpv ]}
  '';

  meta = with lib; {
    description = "Native messaging host for ff2mpv written in Go";
    homepage = "https://git.clsr.net/util/ff2mpv-go/";