nixpkgs-suyu/pkgs/applications/video/mpv/scripts/uosc.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

57 lines
1.6 KiB
Nix
Raw Normal View History

2023-11-29 14:40:21 +01:00
{ lib
, fetchFromGitHub
, fetchpatch
, makeFontsConf
, buildLua
, buildGoModule
}:
2023-03-07 01:53:20 +01:00
buildLua (finalAttrs: {
2023-03-07 01:53:20 +01:00
pname = "uosc";
2023-11-29 14:40:21 +01:00
version = "5.1.1";
scriptPath = "src/uosc";
2023-03-07 01:53:20 +01:00
src = fetchFromGitHub {
owner = "tomasklaen";
repo = "uosc";
rev = finalAttrs.version;
2023-11-29 14:40:21 +01:00
hash = "sha256-+4k8T1yX3IRXK3XkUShsuJSH9w1Zla7CaRENcIqX4iM=";
2023-03-07 01:53:20 +01:00
};
2023-11-29 14:40:21 +01:00
tools = buildGoModule {
pname = "uosc-bin";
inherit (finalAttrs) version src;
vendorHash = "sha256-nkY0z2GiDxfNs98dpe+wZNI3dAXcuHaD/nHiZ2XnZ1Y=";
};
2023-03-07 01:53:20 +01:00
2023-11-29 14:40:21 +01:00
# Patch lua script to get the path to its `ziggy` binary form the environment
patches = [
# uosc#814: Support overriding `ziggy_path` via environment variable
(fetchpatch {
url = "https://github.com/tomasklaen/uosc/commit/4fdf68a1bcb510824d66f35ecc7672a6452a44b2.patch";
hash = "sha256-igUqFf8e7LVIIjGxACdIWAeZxjF/yqaCL4QRXrzNQXk=";
})
];
2023-03-07 01:53:20 +01:00
# the script uses custom "texture" fonts as the background for ui elements.
# In order for mpv to find them, we need to adjust the fontconfig search path.
2023-11-29 14:40:21 +01:00
postInstall = "cp -r src/fonts $out/share";
2023-03-07 01:53:20 +01:00
passthru.extraWrapperArgs = [
"--set"
"FONTCONFIG_FILE"
(toString (makeFontsConf {
fontDirectories = [ "${finalAttrs.finalPackage}/share/fonts" ];
}))
2023-11-29 14:40:21 +01:00
"--set"
"MPV_UOSC_ZIGGY"
(lib.getExe' finalAttrs.tools "ziggy")
2023-03-07 01:53:20 +01:00
];
meta = with lib; {
description = "Feature-rich minimalist proximity-based UI for MPV player";
homepage = "https://github.com/tomasklaen/uosc";
license = licenses.gpl3Only;
maintainers = with lib.maintainers; [ apfelkuchen6 ];
};
})