-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
130 lines (121 loc) · 3.74 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
name: deltachat-desktop
base: core24
adopt-info: main
summary: Delta Chat is a messaging app that works over e-mail
description: |
Delta Chat is a new chat app that sends messages via e-mails, encrypted if possible, with Autocrypt.
You do not have to sign up anywhere, just use your existing e-mail account with Delta Chat.
Source: https://download.delta.chat/desktop/
Snap-Source: https://github.com/nbuechner/deltachat-snap
grade: stable
confinement: strict
compression: xz
platforms:
amd64:
build-on: amd64
build-for: amd64
arm64:
build-on: arm64
build-for: arm64
apps:
deltachat-desktop:
command-chain: ["./check.sh"]
command: ./deltachat-desktop --disable-gpu --no-sandbox
plugs:
- home
- x11
- desktop
- desktop-legacy
- unity7
- removable-media
- network
- audio-record
- audio-playback
- shared-memory
- camera
- wayland
extensions: [ gnome ]
environment:
TMPDIR: $XDG_RUNTIME_DIR
#DISABLE_WAYLAND: 1
WM_CLASS: DeltaChat
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libunity
plugs:
shared-memory:
private: true
parts:
main:
source: .
plugin: dump
override-build: |
set +u # core20 base does not allow unbound variables !
# workaround for build.snapcraft.io builds
# https://bugs.launchpad.net/bugs/1886861
if [ -n "$http_proxy" ]; then
export ELECTRON_GET_USE_PROXY=1
export GLOBAL_AGENT_HTTP_PROXY="${http_proxy}"
export GLOBAL_AGENT_HTTPS_PROXY="${http_proxy}"
fi
export DISTDIR="linux-unpacked"
export WDIR=$(pwd)
version=$(wget -qO- https://api.github.com/repos/deltachat/deltachat-desktop/releases/latest | jq -r '.tag_name' | cut -c2-)
export VERSION_INFO_GIT_REF=$version
wget -qO source.tgz https://github.com/deltachat/deltachat-desktop/archive/refs/tags/v${version}.tar.gz
tar xf source.tgz
rm -f source.tgz
if [ $(uname -i) == 'aarch64' ]; then
if [ ! -f "/usr/local/bin/cargo" ]; then
RUSTVER="1.76.0"
wget -qO rust.tar.gz https://buechner.me/dist/rust-${RUSTVER}-aarch64-unknown-linux-gnu.tar.gz
rm -Rf rust-${RUSTVER}-aarch64-unknown-linux-gnu
tar xpf rust.tar.gz
cd rust-${RUSTVER}-aarch64-unknown-linux-gnu
./install.sh
cd ..
rm -Rf rust-${RUSTVER}-aarch64-unknown-linux-gnu
rm -f rust.tar.gz
export PATH=$PATH:/usr/local/bin/
fi
export DISTDIR="linux-arm64-unpacked"
fi
cd deltachat-desktop-${version}
npm install -g pnpm@latest
pnpm install
pnpm -w build:electron
cd packages/target-electron
pnpm build4production
pnpm pack:generate_config
pnpm run pack:patch-node-modules
pnpm run pack:linux:dir
cp -rv dist/${DISTDIR}/* $SNAPCRAFT_PART_INSTALL/
chmod 4755 $SNAPCRAFT_PART_INSTALL/chrome-sandbox
chown root:root $SNAPCRAFT_PART_INSTALL/chrome-sandbox
cp -f $WDIR/local/check.sh $SNAPCRAFT_PART_INSTALL/
chmod a+rx $SNAPCRAFT_PART_INSTALL/*.sh
craftctl set version="$version"
build-environment:
- PATH: "$PATH:$SNAPCRAFT_PART_BUILD/node_modules/.bin"
build-snaps:
- node/20/stable
stage-packages:
- libgtk-3-0
- libnotify4
- libnss3
- libxss1
- libxtst6
- xdg-utils
- libatspi2.0-0
- libuuid1
- libsecret-1-0
- libunity9
- zenity
build-packages:
- curl
- jq
- wget
layout:
/usr/share/zenity:
bind: $SNAP/usr/share/zenity
lint:
ignore:
- library