4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
66 lines
1.5 KiB
Nix
66 lines
1.5 KiB
Nix
{ lib, stdenv, buildPythonApplication, fetchFromGitHub, callPackage
|
|
, mpv, python-mpv-jsonipc, jellyfin-apiclient-python
|
|
, pillow, tkinter, pystray, jinja2, pywebview }:
|
|
|
|
let
|
|
shaderPack = callPackage ./shader-pack.nix {};
|
|
in
|
|
buildPythonApplication rec {
|
|
pname = "jellyfin-mpv-shim";
|
|
version = "1.7.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "iwalton3";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "0alrh5h3f8pq9mrq09jmpqa0yslxsjqwij6kwn24ggbwc10zkq75";
|
|
fetchSubmodules = true; # needed for display_mirror css file
|
|
};
|
|
|
|
patches = [
|
|
./disable-desktop-client.patch
|
|
./disable-update-check.patch
|
|
];
|
|
|
|
# override $HOME directory:
|
|
# error: [Errno 13] Permission denied: '/homeless-shelter'
|
|
#
|
|
# remove jellyfin_mpv_shim/win_utils.py:
|
|
# ModuleNotFoundError: No module named 'win32gui'
|
|
preCheck = ''
|
|
export HOME=$TMPDIR
|
|
|
|
rm jellyfin_mpv_shim/win_utils.py
|
|
'';
|
|
|
|
postPatch = ''
|
|
# link the default shader pack
|
|
ln -s ${shaderPack} jellyfin_mpv_shim/default_shader_pack
|
|
'';
|
|
|
|
propagatedBuildInputs = [
|
|
jellyfin-apiclient-python
|
|
mpv
|
|
pillow
|
|
python-mpv-jsonipc
|
|
|
|
# gui dependencies
|
|
pystray
|
|
tkinter
|
|
|
|
# display_mirror dependencies
|
|
jinja2
|
|
pywebview
|
|
];
|
|
|
|
# no tests
|
|
doCheck = false;
|
|
pythonImportsCheck = [ "jellyfin_mpv_shim" ];
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
|
|
description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
|
|
license = licenses.gpl3;
|
|
maintainers = with maintainers; [ jojosch ];
|
|
};
|
|
}
|