-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsnapcraft.yaml
250 lines (217 loc) · 9.06 KB
/
snapcraft.yaml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: signal-desktop
title: Signal Desktop
summary: Speak Freely - Private Messenger
description: |
**Note: To use the Signal desktop app, you must first install Signal on your phone.**
Millions of people use Signal every day for free and instantaneous communication anywhere in the world. Send and receive high-fidelity messages, participate in HD voice/video calls, and explore a growing set of new features that help you stay connected. Signal's advanced privacy-preserving technology is always enabled, so you can focus on sharing the moments that matter with the people who matter to you.
- Say anything - State-of-the-art end-to-end encryption (powered by the open source Signal Protocol™) keeps your conversations secure. Privacy isn't an optional mode; it's just the way that Signal works. Every message, every call, every time.
- Go fast - Messages are delivered quickly and reliably, even on slow networks. Signal is optimized to operate in the most constrained environment possible.
- Feel free - Signal is a completely independent 501c3 nonprofit. Development is supported by users like you. No advertisements. No trackers. No kidding.
- Be yourself - You can use your existing phone number and address book to securely communicate with your friends.
- Speak up - Whether they live across town or across the ocean, Signal's enhanced audio and video quality will make your friends and family feel closer.
- Whisper in the shadows - Switch to the dark theme if you refuse to see the light.
**Minimize to tray**
Per the request of the Signal developers, this snap does not use the system tray by default. This is disabled by default per the request of the Signal developers, because system tray support is not stable. Set to `false`, Signal will stop when you close it and will not have a system tray icon. You can enable it by running the following command.
```
snap set signal-desktop tray-icon=true
```
**Are you having issues?**
Let us know by creating a new issue here: https://github.com/snapcrafters/signal-desktop/issues
**Authors**
This snap is maintained by the Snapcrafters community, and is not necessarily endorsed or officially maintained by the upstream developers.
website: https://signal.org/
contact: https://github.com//snapcrafters/signal-desktop/issues
issues: https://github.com//snapcrafters/signal-desktop/issues
source-code: https://github.com//snapcrafters/signal-desktop
license: AGPL-3.0-only
adopt-info: signal-desktop
icon: snap/gui/signal-desktop.png
version: 6.41.0
base: core22
grade: stable
confinement: strict
compression: lzo
architectures:
- amd64
- arm64
parts:
# NodeJS dependency which uses a non-proxy aware fetch during its build.
# The purpose of this part is to introduce proxy awareness so the build succeeds in LP.
ringrtc:
plugin: dump
source: https://registry.npmjs.org/@signalapp/ringrtc/-/ringrtc-2.34.4.tgz
override-build: |
# Patch the file; inject a proxy agent at the top of the file
cat <<-EOF > scripts/fetch-prebuild.js
const { HttpsProxyAgent } = require('https-proxy-agent');
const agent = new HttpsProxyAgent('${https_proxy:-}');
$(cat scripts/fetch-prebuild.js)
EOF
# Ensure the fetch actually uses the agent
sed -i 's|https.get(URL, async res|https.get(URL, { agent }, async res|g' scripts/fetch-prebuild.js
# NodeJS dependency which uses a non-proxy aware fetch during its build.
# The purpose of this part is to introduce proxy awareness so the build succeeds in LP.
better-sqlite3:
plugin: dump
source: https://registry.npmjs.org/@signalapp/better-sqlite3/-/better-sqlite3-8.6.0.tgz
override-build: |
# Patch the file; inject a proxy agent at the top of the file
cat <<-EOF > deps/download.js
const { HttpsProxyAgent } = require('https-proxy-agent');
const agent = new HttpsProxyAgent('${https_proxy:-}');
$(cat deps/download.js)
EOF
# Ensure the fetch actually uses the agent
sed -i 's|https.get(URL, async (res)|https.get(URL, { agent }, async (res)|g' deps/download.js
nodejs:
plugin: dump
source: https://github.com/asdf-vm/asdf.git
source-tag: v0.13.1
build-environment:
- NODE_VERSION: 18.15.0
override-build: |
source "./asdf.sh"
# Install the correct version of nodejs required by Signal-Desktop
asdf plugin add nodejs
asdf install nodejs "$NODE_VERSION"
asdf global nodejs "$NODE_VERSION"
# Install and configure Yarn
npm install -g yarn
yarn config set python /usr/bin/python3
yarn config set proxy "${http_proxy:-}"
yarn config set https-proxy "${https_proxy:-}"
signal-desktop:
after:
- ringrtc
- better-sqlite3
- nodejs
plugin: dump
source: https://github.com/signalapp/Signal-Desktop
source-type: git
source-tag: v$SNAPCRAFT_PROJECT_VERSION
build-packages:
- git-lfs
- jq
- moreutils
- python3
- wget
build-environment:
- SIGNAL_ENV: "production"
- USE_SYSTEM_FPM: "true"
override-build: |
# Use the version of nodejs/yarn we configured before
source "$(pwd)/../../nodejs/build/asdf.sh"
git lfs install
# Disable yarn auto clean functionality
rm .yarnclean
# Don't try to build a deb (this fails on arm64)
cat package.json | jq '.build.linux.target = ["dir"]' | sponge package.json
# If we're in a proxy environment, we need to patch some packages
if [[ -n "${http_proxy:-}" ]]; then
# Setup proxy access
export ELECTRON_GET_USE_PROXY=1
export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
# The patch applied uses this package to ensure proxy is used
yarn global add https-proxy-agent
# Update the package.json so the build uses the patched libraries
cat package.json \
| jq -r --arg f "file:${PWD}/../../ringrtc/build" '.dependencies."@signalapp/ringrtc"=$f' \
| sponge package.json
cat package.json \
| jq -r --arg f "file:${PWD}/../../better-sqlite3/build" '.dependencies."@signalapp/better-sqlite3"=$f' \
| sponge package.json
fi
# Install the dependencies for the Signal-Desktop application.
# We cannot use `--frozen-lockfile` due to the patching above.
yarn install
# This is the equivalent of 'yarn generate'. The upstream package.json
# uses npm-run-all to run multiple things, which has a bug that prevents
# this from succeeding in the snapcraft build env, so this just breaks
# that apart into its component parts.
yarn build-protobuf
yarn build:esbuild
yarn sass
yarn get-expire-time
yarn copy-components
# This is the equivalent of 'yarn build-linux' which also runs 'yarn generate'
# which is broken (as described above).
yarn build:esbuild:prod
yarn build:release --publish=never
yarn build:electron --config.directories.output=release
# Stage the built release. Directory is called 'linux-unpacked' for amd64,
# and 'linux-arm64-unpacked' for arm64.
mkdir -p "${CRAFT_PART_INSTALL}/opt"
mv release/linux-*unpacked "${CRAFT_PART_INSTALL}/opt/Signal"
stage-packages:
- libxss1
- libnspr4
- libnss3
- libvips42
prime:
- opt
- usr/share
- usr/lib/*/libxss*
- usr/lib/*/*nss*
- usr/lib/*/libvips*
- usr/lib/*/libI*
- usr/lib/*/libMagic*
- usr/lib/*/libcfit*
- usr/lib/*/libcgif*
- usr/lib/*/libexif*
- usr/lib/*/libfftw*
- usr/lib/*/libgsf*
- usr/lib/*/libheif*
- usr/lib/*/libimage*
- usr/lib/*/libmat*
- usr/lib/*/libopensli*
- usr/lib/*/libwebp*
- usr/lib/*/libHalf*
- usr/lib/*/libaom*
- usr/lib/*/libdav1d*
- usr/lib/*/libx265*
- usr/lib/*/libhdf*
- usr/lib/*/libsz*
- usr/lib/*/liblqr*
- usr/lib/*/libaec*
- usr/lib/*/libde265*
- usr/lib/*/libnuma*
- -opt/Signal/chrome-sandbox
- -opt/Signal/resources/app.asar.unpacked/node_modules/sharp/vendor/lib
- -opt/Signal/resources/app.asar.unpacked/node_modules/sharp/vendor/include
local-parts:
plugin: dump
source: ./snap/local
source-type: local
cleanup:
after: [signal-desktop]
plugin: nil
build-snaps: [gnome-42-2204]
override-prime: |
set -eux
cd /snap/gnome-42-2204/current
find . -type f,l -exec rm -f $CRAFT_PRIME/{} \;
for CRUFT in bug lintian man; do
rm -rf $CRAFT_PRIME/usr/share/$CRUFT
done
find $CRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete
apps:
signal-desktop:
extensions: [gnome]
command: usr/bin/signal-desktop-wrapper
plugs:
- browser-support
- camera
- home
- network
- opengl
- audio-playback
- audio-record
- removable-media
- unity7
- desktop
- desktop-legacy
- screen-inhibit-control
environment:
GTK_USE_PORTAL: "1"
TMPDIR: $XDG_RUNTIME_DIR