-
Notifications
You must be signed in to change notification settings - Fork 14
/
snapcraft.yaml
203 lines (170 loc) · 8.02 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
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: 7.36.1
base: core24
grade: stable
confinement: strict
compression: lzo
platforms:
amd64:
arm64:
parts:
nodejs:
plugin: dump
source: https://github.com/asdf-vm/asdf.git
source-tag: v0.13.1
build-packages:
- jq
- curl
override-build: |
source "./asdf.sh"
UPSTREAM_URL="https://raw.githubusercontent.com/signalapp/Signal-Desktop/v${SNAPCRAFT_PROJECT_VERSION}"
LINUX_CI_STEPS="$(curl -s "${UPSTREAM_URL}/.github/workflows/ci.yml")"
NODE_VERSION="$(curl "${UPSTREAM_URL}/package.json" | jq -r '.engines.node')"
NPM_VERSION="$(echo "$LINUX_CI_STEPS" | grep -m1 -Po "npm install -g npm@\K[^ ]+")"
# Install the correct version of nodejs required by Signal-Desktop
asdf plugin add nodejs
asdf install nodejs "$NODE_VERSION"
asdf global nodejs "$NODE_VERSION"
# Configure NPM proxy
npm config set -g registry https://registry.npmjs.org/
npm config set -g proxy "${http_proxy:-}"
npm config set -g https-proxy "${http_proxy:-}"
# Install pinned npm version from Signal's CI
npm install -g "npm@${NPM_VERSION}"
# NodeJS dependency which uses a non-proxy aware fetch during its build.
# The purpose of this part is to download the module and fetch the required file
# using curl, which does respect the proxy, which prevents the module from trying
# to download it with the non-proxy aware fetch.
better-sqlite3:
after:
- nodejs
plugin: dump
source: https://registry.npmjs.org/@signalapp/better-sqlite3/-/better-sqlite3-9.0.8.tgz
build-packages:
- curl
override-build: |
# Parse the components of the URL that the module would try to download if not present
base_uri="$(grep -Po "BASE_URI = \`\K[^\`]+" deps/download.js)"
sqlcipher_version="$(grep -Po "SQLCIPHER_VERSION = '\K[^']+" deps/download.js)"
hash="$(grep -Po "HASH = '\K[^']+" deps/download.js)"
extension_version="$(grep -Po "EXTENSION_VERSION = '\K[^']+" deps/download.js)"
# Download the file using curl, which respects the proxy configuration
curl -s -o deps/sqlcipher.tar.gz "${base_uri}/sqlcipher-v2-${sqlcipher_version}--${extension_version}-${hash}.tar.gz"
# Use the version of nodejs we configured before and install node deps
source "$(pwd)/../../nodejs/build/asdf.sh"
npm install
signal-desktop:
after:
- 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
build-environment:
- SIGNAL_ENV: "production"
override-build: |
# Setup proxy access where needed
if [[ -n "${http_proxy:-}" ]]; then
export HTTP_PROXY="${http_proxy:-}"
export HTTPS_PROXY="${http_proxy:-}"
export ELECTRON_GET_USE_PROXY=1
export GLOBAL_AGENT_HTTP_PROXY="${http_proxy:-}"
export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy:-}"
fi
# Use the version of nodejs we configured before
source "$(pwd)/../../nodejs/build/asdf.sh"
git lfs install
# Update the package.json so the build uses the patched libraries
cat package.json \
| jq -r --arg f "file:${PWD}/../../better-sqlite3/build" '.dependencies."@signalapp/better-sqlite3"=$f' \
| sponge package.json
# Build the sticker-creator
pushd sticker-creator
npm ci --legacy-peer-deps
npm run build
popd
# Add a patch that fixes the rendering of images on arm64 builds.
# See: https://github.com/snapcrafters/signal-desktop/issues/279#issuecomment-2372021170
cp $CRAFT_PROJECT_DIR/snap/patches/* patches/
# Install the dependencies for the Signal-Desktop application.
npm install --legacy-peer-deps
# This is the equivalent of 'npm run 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.
npm run build-protobuf
npm run build:esbuild
npm run build:icu-types
npm run build:compact-locales
npm run sass
npm run get-expire-time
npm run copy-components
# This is the equivalent of 'npm run build-linux' which also runs 'npm run generate'
# which is broken (as described above).
npm run build:esbuild:prod
npm run build:release -- --linux dir
# 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:
- libnss3
- libnss-sss
prime:
- -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
apps:
signal-desktop:
extensions: [gnome]
command: usr/bin/signal-desktop-wrapper
plugs:
- browser-support
- camera
- home
- network
- audio-playback
- audio-record
- removable-media
- unity7
- screen-inhibit-control
environment:
TMPDIR: $XDG_RUNTIME_DIR
# Included temporarily until https://github.com/snapcore/snapcraft-desktop-integration/issues/28
# is resolved.
NOTIFY_IGNORE_PORTAL: 1