nixpkgs/pkgs/applications/video/plex-mpv-shim/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

72 lines
1.7 KiB
Nix

{
lib,
buildPythonApplication,
fetchFromGitHub,
fetchpatch,
python,
mpv,
requests,
python-mpv-jsonipc,
pystray,
tkinter,
wrapGAppsHook3,
gobject-introspection,
mpv-shim-default-shaders,
}:
buildPythonApplication rec {
pname = "plex-mpv-shim";
version = "1.11.0";
src = fetchFromGitHub {
owner = "iwalton3";
repo = pname;
rev = "refs/tags/v${version}";
sha256 = "sha256-hUGKOJEDZMK5uhHoevFt1ay6QQEcoN4F8cPxln5uMRo=";
};
patches = [
# pull in upstream commit to fix python-mpv dependency name -- remove when version > 1.11.0
(fetchpatch {
url = "https://github.com/iwalton3/plex-mpv-shim/commit/d8643123a8ec79216e02850b08f63b06e4e0a2ea.diff";
hash = "sha256-nc+vwYnAtMjVzL2fIQeTAqhf3HBseL+2pFEtv8zNUXo=";
})
];
nativeBuildInputs = [
wrapGAppsHook3
gobject-introspection
];
propagatedBuildInputs = [
mpv
requests
python-mpv-jsonipc
pystray
tkinter
];
# needed for pystray to access appindicator using GI
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
dontWrapGApps = true;
postInstall = ''
# put link to shaders where upstream package expects them
ln -s ${mpv-shim-default-shaders}/share/mpv-shim-default-shaders $out/${python.sitePackages}/plex_mpv_shim/default_shader_pack
'';
# does not contain tests
doCheck = false;
meta = with lib; {
homepage = "https://github.com/iwalton3/plex-mpv-shim";
description = "Allows casting of videos to MPV via the Plex mobile and web app";
maintainers = with maintainers; [ devusb ];
license = licenses.mit;
platforms = platforms.linux;
mainProgram = "plex-mpv-shim";
};
}