Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions pkgs/by-name/mp/mpv-handler/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
lib,
rustPlatform,
fetchFromGitHub,

mpv,

nix-update-script,
}:

rustPlatform.buildRustPackage (finalAttrs: {
pname = "mpv-handler";
version = "0.3.14";

src = fetchFromGitHub {
owner = "akiirui";
repo = "mpv-handler";
tag = "v${finalAttrs.version}";
sha256 = "sha256-QqglGTXUBdClphZYBmxjbw5qJXDPQasR99H3n+5BIRw=";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
sha256 = "sha256-QqglGTXUBdClphZYBmxjbw5qJXDPQasR99H3n+5BIRw=";
hash = "sha256-QqglGTXUBdClphZYBmxjbw5qJXDPQasR99H3n+5BIRw=";

};

useFetchCargoVendor = true;
cargoHash = "sha256-GiGQkEMPzoepjBbGXo2aFjV/pyn+BvToLDNSlASNcnM=";

buildInputs = [ mpv ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [ mpv ];
buildInputs = [ mpv-unwrapped ];

If it doesn't require mpv binary, otherwise

Suggested change
buildInputs = [ mpv ];
nativeBuildInputs = [ makeBinaryWrapper ];
postFixup = ''
wrapProgram $out/bin/mpv-handler \
--prefix PATH : ${lib.makeBinPath [ mpv ]}
'';


postInstall = ''
mkdir -p $out/share/applications
install -Dm644 share/linux/mpv-handler.desktop $out/share/applications/
Comment on lines +28 to +29
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mkdir -p $out/share/applications
install -Dm644 share/linux/mpv-handler.desktop $out/share/applications/
install -Dm644 share/linux/mpv-handler.desktop -t $out/share/applications/

install -Dm644 share/linux/mpv-handler-debug.desktop $out/share/applications/
'';

passthru.updateScript = nix-update-script { };

meta = {
description = "Protocol handler for mpv";
homepage = "https://github.com/akiirui/mpv-handler";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
platforms = lib.platforms.linux;

Upstream builds for macOS, just let rustPlatform.buildRustPackage fill platforms.

maintainers = with lib.maintainers; [ d-brasher ];
mainProgram = "mpv-handler";
};
})