This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 298
/
PKGBUILD
99 lines (82 loc) · 3.78 KB
/
PKGBUILD
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
# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Steef Hegeman <mail@steefhegeman.com>
# Contributor: Luca Weiss <luca (at) z3ntu (dot) xyz>
# Contributor: Julian Schacher <jspp@posteo.net>
_electron=electron22
pkgbase=element.io
pkgname=(element-web element-desktop)
pkgver=1.11.31
pkgrel=2
pkgdesc="Glossy Matrix collaboration client — "
arch=(x86_64)
url="https://element.io"
license=(Apache)
makedepends=(npm git yarn python rust tcl ${_electron} nodejs-lts-gallium libxcrypt-compat sqlcipher)
_url="https://github.com/vector-im/element"
source=(element-web-${pkgver}.tar.gz::${_url}-web/archive/v${pkgver}.tar.gz
element-web-${pkgver}.tar.gz.asc::${_url}-web/releases/download/v${pkgver}/v${pkgver}-src.tar.gz.asc
element-desktop-${pkgver}.tar.gz::${_url}-desktop/archive/v${pkgver}.tar.gz
element-desktop-${pkgver}.tar.gz.asc::${_url}-desktop/releases/download/v${pkgver}/v${pkgver}-src.tar.gz.asc
autolaunch.patch
io.element.Element.desktop
element-desktop.sh)
sha256sums=('6597d59f12a0f878fa363d6253a506583f686284d81a50baceb2965a4e0cce18'
'SKIP'
'5152bcdab011deb7e5d7c713edd268bf4266dedde87ff735ad146e9eb12e205b'
'SKIP'
'268485f35103d00a89be7f5c84703e3d393350c71f4f90932f7bcb5ea2fd094f'
'0103f28a32fe31f698836516783c1c70a76a0117b5df7fd0af5c422c224220f9'
'c1bd9ace215e3ec9af14d7f28b163fc8c8b42e23a2cf04ce6f4ce2fcc465feba')
validpgpkeys=(712BFBEE92DCA45252DB17D7C7BE97EFA179B100) # Element Releases <releases@riot.im>
prepare() {
# Specify electron version in launcher
sed -i "s|@ELECTRON@|${_electron}|" element-desktop.sh
cd element-web-${pkgver}
yarn install --no-fund
cd ../element-desktop-${pkgver}
patch -p1 < ../autolaunch.patch
sed -i 's|"target": "deb"|"target": "dir"|' package.json
sed -i 's|"https://packages.element.io/desktop/update/"|null|' element.io/release/config.json
yarn install --no-fund
}
build() {
export NODE_OPTIONS=--openssl-legacy-provider
cd element-web-${pkgver}
VERSION=${pkgver} yarn build --offline
cd ../element-desktop-${pkgver}
export SQLCIPHER_STATIC=1
yarn run build:native
yarn run build
}
package_element-web() {
pkgdesc+="web version."
replaces=(riot-web vector-web)
cd element-web-${pkgver}
install -d "${pkgdir}"/{usr/share/webapps,etc/webapps}/element
cp -r webapp/* "${pkgdir}"/usr/share/webapps/element/
install -Dm644 config.sample.json -t "${pkgdir}"/etc/webapps/element/
ln -s /etc/webapps/element/config.json "${pkgdir}"/usr/share/webapps/element/
echo "${pkgver}" > "${pkgdir}"/usr/share/webapps/element/version
}
package_element-desktop() {
pkgdesc+="desktop version."
replaces=(riot-desktop)
depends=("element-web=${pkgver}" ${_electron} libsecret sqlcipher)
backup=('etc/element/config.json')
cd element-desktop-${pkgver}
install -d "${pkgdir}"{/usr/lib/element/,/etc/webapps/element}
# Install the app content, replace the webapp with a symlink to the system package
cp -r dist/linux-unpacked/resources/* "${pkgdir}"/usr/lib/element/
ln -s /usr/share/webapps/element "${pkgdir}"/usr/lib/element/webapp
# Config file
ln -s /etc/element/config.json "${pkgdir}"/etc/webapps/element/config.json
install -Dm644 element.io/release/config.json -t "${pkgdir}"/etc/element
# Required extras
install -Dm644 ../io.element.Element.desktop -t "${pkgdir}"/usr/share/applications/
install -Dm755 ../${pkgname}.sh "${pkgdir}"/usr/bin/${pkgname}
# Icons
install -Dm644 ../element-web-${pkgver}/res/themes/element/img/logos/element-logo.svg "${pkgdir}"/usr/share/icons/hicolor/scalable/apps/io.element.Element.svg
for i in 16 24 48 64 96 128 256 512; do
install -Dm644 build/icons/${i}x${i}.png "${pkgdir}"/usr/share/icons/hicolor/${i}x${i}/apps/io.element.Element.png
done
}