From c9e991bd649c231e673bef17dd8820b71fb90f64 Mon Sep 17 00:00:00 2001 From: Alexandre Macabies Date: Sun, 1 Aug 2021 00:44:02 +0200 Subject: [PATCH] mpvScripts.simple-mpv-webui: 1.0.0 -> 2.1.0 This also adds a test. The current packaged version (1.0.0) is broken, it cannot find relevant files. --- nixos/tests/all-tests.nix | 1 + nixos/tests/mpv.nix | 28 +++++++++++++++++++ .../video/mpv/scripts/simple-mpv-webui.nix | 6 ++-- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 nixos/tests/mpv.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ae2aff2226b..1a71e8f86b9 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -259,6 +259,7 @@ in morty = handleTest ./morty.nix {}; mosquitto = handleTest ./mosquitto.nix {}; mpd = handleTest ./mpd.nix {}; + mpv = handleTest ./mpv.nix {}; mumble = handleTest ./mumble.nix {}; musescore = handleTest ./musescore.nix {}; munin = handleTest ./munin.nix {}; diff --git a/nixos/tests/mpv.nix b/nixos/tests/mpv.nix new file mode 100644 index 00000000000..bcfc17cf332 --- /dev/null +++ b/nixos/tests/mpv.nix @@ -0,0 +1,28 @@ +import ./make-test-python.nix ({ lib, ... }: + +with lib; + +let + port = toString 4321; +in +{ + name = "mpv"; + meta.maintainers = with maintainers; [ zopieux ]; + + nodes.machine = + { pkgs, ... }: + { + environment.systemPackages = [ + pkgs.curl + (pkgs.mpv-with-scripts.override { + scripts = [ pkgs.mpvScripts.simple-mpv-webui ]; + }) + ]; + }; + + testScript = '' + machine.execute("set -m; mpv --script-opts=webui-port=${port} --idle=yes &") + machine.wait_for_open_port(${port}) + assert "simple-mpv-webui" in machine.succeed("curl -s localhost:${port}") + ''; +}) diff --git a/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix b/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix index 99b731757ff..01f2c3a099f 100644 --- a/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix +++ b/pkgs/applications/video/mpv/scripts/simple-mpv-webui.nix @@ -2,13 +2,13 @@ , fetchFromGitHub }: stdenvNoCC.mkDerivation rec { pname = "simple-mpv-ui"; - version = "1.0.0"; + version = "2.1.0"; src = fetchFromGitHub { owner = "open-dynaMIX"; repo = "simple-mpv-webui"; rev = "v${version}"; - sha256 = "1glrnnl1slcl0ri0zs4j64lc9aa52p9ffh6av0d81fk95nm98917"; + sha256 = "1z0y8sdv5mbxznxqh43w5592ym688vkvqg7w26p8cinrhf09pbw8"; }; dontBuild = true; @@ -21,7 +21,7 @@ stdenvNoCC.mkDerivation rec { meta = with lib; { description = "A web based user interface with controls for the mpv mediaplayer"; homepage = "https://github.com/open-dynaMIX/simple-mpv-webui"; - maintainers = [ maintainers.cript0nauta ]; + maintainers = with maintainers; [ cript0nauta zopieux ]; longDescription = '' You can access the webui when accessing http://127.0.0.1:8080 or http://[::1]:8080 in your webbrowser. By default it listens on