forked from flathub/com.tutanota.Tutanota
-
Notifications
You must be signed in to change notification settings - Fork 1
/
manifest-template.js
86 lines (83 loc) · 2.35 KB
/
manifest-template.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/node
const fs = require('fs')
const [hash, url] = process.argv.slice(2)
const manifest = {
"app-id": "com.tutanota.Tutanota",
"runtime": "org.freedesktop.Platform",
"runtime-version": "21.08",
"base": "org.electronjs.Electron2.BaseApp",
"base-version": "21.08",
"sdk": "org.freedesktop.Sdk",
"command": "tutanota-desktop",
"separate-locales": false,
"finish-args": [
"--share=ipc",
"--socket=x11",
"--socket=wayland",
"--socket=pulseaudio",
"--socket=system-bus",
"--socket=session-bus",
"--share=network",
"--filesystem=host",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.freedesktop.secrets",
"--talk-name=org.kde.StatusNotifierWatcher",
"--env=TMPDIR=/var/tmp"
],
"modules": [
"shared-modules/libsecret/libsecret.json",
{
"name": "tutanota",
"buildsystem": "simple",
"sources": [
{
"dest-filename": "tutanota-unpacked-linux.tar.gz",
"type": "file",
"sha256": hash,
"url": url
},
{
"type": "script",
"dest-filename": "tutanota-desktop.sh",
"commands": [
"export TMPDIR=\"$XDG_RUNTIME_DIR/app/${FLATPAK_ID}\"",
"exec zypak-wrapper /app/lib/tutanota/tutanota-desktop \"$@\""
]
}
],
"build-commands": [
"tar -xf tutanota-unpacked-linux.tar.gz",
"rm tutanota-unpacked-linux.tar.gz",
"mkdir -p /app/lib/",
"cp -r linux-unpacked /app/lib/tutanota",
"install -Dm644 linux-unpacked/resources/icons/icon/512.png /app/share/icons/hicolor/512x512/apps/com.tutanota.Tutanota.png",
"install -Dm644 linux-unpacked/resources/icons/icon/64.png /app/share/icons/hicolor/64x64/apps/com.tutanota.Tutanota.png",
"install -Dm755 tutanota-desktop.sh /app/bin/tutanota-desktop",
"rm -rf ./linux-unpacked"
]
},
{
"name": "metadata",
"buildsystem": "simple",
"sources": [
{
"type": "file",
"path": "com.tutanota.Tutanota.appdata.xml"
},
{
"type": "file",
"path": "com.tutanota.Tutanota.desktop"
}
],
"build-commands": [
"install -Dm644 com.tutanota.Tutanota.appdata.xml /app/share/appdata/com.tutanota.Tutanota.appdata.xml",
"install -Dm644 com.tutanota.Tutanota.desktop /app/share/applications/com.tutanota.Tutanota.desktop"
]
}
]
}
try {
fs.unlinkSync('com.tutanota.Tutanota.json')
} catch {
}
fs.writeFileSync('com.tutanota.Tutanota.json', JSON.stringify(manifest, null, 2))