-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup
68 lines (61 loc) · 1.66 KB
/
backup
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
63
64
65
66
67
68
{
pname,
version,
src,
libayatana-appindicator,
sysproxy-hash,
webui,
pkg-config,
rustPlatform,
makeDesktopItem,
meta,
webkitgtk_4_0,
openssl,
}:
rustPlatform.buildRustPackage {
inherit version src meta;
pname = "${pname}-unwrapped";
sourceRoot = "${src.name}/src-tauri";
cargoLock = {
lockFile = ./Cargo-tauri.lock;
outputHashes = {
"sysproxy-0.3.0" = sysproxy-hash;
};
};
env = {
OPENSSL_NO_VENDOR = 1;
};
postPatch = ''
substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
--replace "libayatana-appindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
substituteInPlace ./tauri.conf.json \
--replace-fail '"distDir": "../dist",' '"distDir": "${webui}",' \
--replace-fail '"beforeBuildCommand": "pnpm run web:build"' '"beforeBuildCommand": ""'
sed -i -e '/externalBin/d' -e '/resources/d' tauri.conf.json
'';
nativeBuildInputs = [
pkg-config
rustPlatform.cargoSetupHook
];
buildInputs = [
openssl
webkitgtk_4_0
];
postInstall = ''
install -DT icons/[email protected] $out/share/icons/hicolor/128x128@2/apps/clash-verge.png
install -DT icons/128x128.png $out/share/icons/hicolor/128x128/apps/clash-verge.png
install -DT icons/32x32.png $out/share/icons/hicolor/32x32/apps/clash-verge.png
'';
desktopItems = [
(makeDesktopItem {
name = "clash-verge-rev";
exec = "clash-verge %u";
icon = "clash-verge-rev";
desktopName = "Clash Verge Rev";
genericName = meta.description;
mimeTypes = [ "x-scheme-handler/clash" ];
type = "Application";
terminal = false;
})
];
}