Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jellyfin-mpv-shim: init at 1.4.1 #81817

Merged
merged 5 commits into from Mar 11, 2020
Merged

Conversation

jojosch
Copy link
Member

@jojosch jojosch commented Mar 5, 2020

Motivation for this change

Tested using Jellyfin 10.4.3 and mpv 0.32.0 under sway 1.4.

Needed to update python-mpv-jsonipc to 1.1.7 and added jellyfin-apiclient-python at 1.4.0.

When running the checks a [Errno 13] Permission denied: '/homeless-shelter' error occurs. I grepped in nixpkgs where other packages just set HOME=$TMPDIR - is this acceptable?

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
/nix/store/x4vkx44zvd2q3g9vlmmb8qrz831fifbd-jellyfin-mpv-shim-1.4.1	 443.1M
/nix/store/rxh4y34gh2gfc3rlb5wrirxzzkx7aa5k-python3.7-jellyfin-apiclient-python-1.4.0	  109.7M
/nix/store/5iv2ldpp410l80spdkl8zkgmbinzdkm9-python3.7-python-mpv-jsonipc-1.1.6	  109.9M
/nix/store/7g0z4prrd163p1ajmw97s2vhs34qnizd-python3.7-python-mpv-jsonipc-1.1.7	  109.9M

@jonringer
Copy link
Contributor

When running the checks a [Errno 13] Permission denied: '/homeless-shelter' error occurs. I grepped in nixpkgs where other packages just set HOME=$TMPDIR - is this acceptable?

Yes

export HOME=$TMPDIR
'';

propagatedBuildInputs = [ mpv python-mpv-jsonipc jellyfin-apiclient-python ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use 1 entry per line and order alphabetically. Also add pillow and tkinter, which are needed by executable

Suggested change
propagatedBuildInputs = [ mpv python-mpv-jsonipc jellyfin-apiclient-python ];
propagatedBuildInputs = [
jellyfin-apiclient-python
mpv
pillow
python-mpv-jsonipc
tkinter
];

still might not work right:

Traceback (most recent call last):
  File "/nix/store/fara2bdicvvi0p8bmrgcz6s8d6yicijc-python3-3.7.6/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/nix/store/p4jgrxxkkx7n5q92m32fpgc24p602r9k-jellyfin-mpv-shim-1.4.1/lib/python3.7/site-packages/jellyfin_mpv_shim/gui_mgr.py", line 380, in run
    from pystray import Icon, MenuItem, Menu
ModuleNotFoundError: No module named 'pystray'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added and reordered the buildInputs.

I based this one on the plex-mpv-shim (#77884) which is also missing the GUI functionality:

[ WARNING] Cannot load GUI. Falling back to command line interface.
Traceback (most recent call last):
  File "/nix/store/faddcn3zaqj0q6zcanf6h6lglbp97dhm-plex-mpv-shim-1.7.12/lib/python3.7/site-packages/plex_mpv_shim/mpv_shim.py", line 39, in main
    from .gui_mgr import userInterface
  File "/nix/store/faddcn3zaqj0q6zcanf6h6lglbp97dhm-plex-mpv-shim-1.7.12/lib/python3.7/site-packages/plex_mpv_shim/gui_mgr.py", line 1, in <module>
    from pystray import Icon, MenuItem, Menu
ModuleNotFoundError: No module named 'pystray'

I will try to package the missing dependencies to enable the GUI.

Comment on lines 16 to 17
checkPhase = ''
# error: [Errno 13] Permission denied: '/homeless-shelter'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments should try to stay outside of hooks. changing a comment inside of code will cause a rebuild.

Suggested change
checkPhase = ''
# error: [Errno 13] Permission denied: '/homeless-shelter'
# error: [Errno 13] Permission denied: '/homeless-shelter'
checkPhase = ''

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved the comment outside of the hook

sha256 = "0bii85b08fa6sj57x9l8z5rhwlrz36mhf7nck950wzxfgkid2fdv";
};

checkPhase = ''
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alos, this will overwrite the normal checkPhase, so no tests are actually being ran

Suggested change
checkPhase = ''
preCheck = ''

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@jojosch
Copy link
Member Author

jojosch commented Mar 10, 2020

I added jinja2 and pywebview because they are required for the "Display Mirroring" functionality of jellyfin-mpv-shim.

But this is currently not working, because pywebview needs some GTK/QT dependencies - but i am not very familiar in this area. (ref: https://pywebview.flowrl.com/guide/installation.html#linux)


Without pywebview at least the GUI configuration wizard and the base functionality (without "Display Mirroring") is working.

Copy link
Contributor

@jonringer jonringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff LGTM
commits LGTM
application opens fine

[7 built, 0.0 MiB DL]
https://github.com/NixOS/nixpkgs/pull/81817
12 package built:
jellyfin-mpv-shim plex-mpv-shim python27Packages.pystray python27Packages.pywebview python37Packages.jellyfin-apiclient-python python37Packages.pystray python37Packages.python-mpv-jsonipc python37Packages.pywebview python38Packages.jellyfin-apiclient-python python38Packages.pystray python38Packages.python-mpv-jsonipc python38Packages.pywebview

@jonringer jonringer merged commit aac3717 into NixOS:master Mar 11, 2020
@jojosch jojosch deleted the jellyfin-mpv-shim branch March 11, 2020 21:34
@matthew-piziak
Copy link
Contributor

When I install and run plex-mpv-shim from unstable, I get the following error:

2020-03-27 14:52:17,744 [    INFO] Loaded settings from json: /home/matt/.config/plex-mpv-shim/conf.json
2020-03-27 14:52:17,744 [ WARNING] Cannot load GUI. Falling back to command line interface.
Traceback (most recent call last):
  File "/nix/store/0w18z9pf1qrq9lkhy7r5f0fhscms4c58-plex-mpv-shim-1.7.12/lib/python3.7/site-packages/plex_mpv_shim/mpv_shim.py", line 39, in main
    from .gui_mgr import userInterface
  File "/nix/store/0w18z9pf1qrq9lkhy7r5f0fhscms4c58-plex-mpv-shim-1.7.12/lib/python3.7/site-packages/plex_mpv_shim/gui_mgr.py", line 1, in <module>
    from pystray import Icon, MenuItem, Menu
ModuleNotFoundError: No module named 'pystray'
2020-03-27 14:52:18,116 [    INFO] Started GDM service
2020-03-27 14:52:18,119 [    INFO] Started HTTP server

@jonringer
Copy link
Contributor

this is for the jellyfin package, and the issue is with the plex-mpv-shim package please open an issue

@matthew-piziak
Copy link
Contributor

Whoops, sorry @jonringer, I got my tabs mixed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants