blob: cbe24d031ddb3e7dc8e8f2ff2e4f563b5a696ab6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
{
lib,
rustPlatform,
fetchFromGitHub,
}:
let
firefoxPaths = [
"lib/mozilla/native-messaging-hosts"
# wrapFirefox only links lib/mozilla path, so this is ineffective
# Still the above path works, despite documentation stating otherwise
# See: https://librewolf.net/docs/faq/#how-do-i-get-native-messaging-to-work
# "lib/librewolf/native-messaging-hosts"
];
chromiumPaths = [
"etc/chromium/native-messaging-hosts"
"etc/opt/vivaldi/native-messaging-hosts"
"etc/opt/chrome/native-messaging-hosts"
"etc/opt/edge/native-messaging-hosts"
];
in
rustPlatform.buildRustPackage (finalAttrs: {
pname = "ff2mpv-rust";
version = "1.1.7";
src = fetchFromGitHub {
owner = "ryze312";
repo = "ff2mpv-rust";
rev = finalAttrs.version;
hash = "sha256-kJpKcwwwGjFYE7R4ZhkEGK44QqxsUEB/Scj0RoySta4=";
};
cargoHash = "sha256-O8OAynSdZdtqNS+wAQ1oAs2HjueC41O8RFqESRHr+6o=";
postInstall = ''
$out/bin/ff2mpv-rust manifest > manifest.json
$out/bin/ff2mpv-rust manifest_chromium > manifest_chromium.json
for path in ${toString firefoxPaths}
do
mkdir -p "$out/$path"
cp manifest.json "$out/$path/ff2mpv.json"
done
for path in ${toString chromiumPaths}
do
mkdir -p "$out/$path"
cp manifest_chromium.json "$out/$path/ff2mpv.json"
done
'';
meta = {
description = "Native messaging host for ff2mpv written in Rust";
homepage = "https://github.com/ryze312/ff2mpv-rust";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ ryze ];
mainProgram = "ff2mpv-rust";
};
})
|