blob: a5e17a07cbc70d15bf9c732107a97b7cf27937c4 (
plain)
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
|
# Maintainer: lsf
# Contributer: Sam Whited <sam@samwhited.com>
# Contributor: Roman Kupriyanov <mr.eshua@gmail.com>
pkgname=jitsi-meet-desktop
pkgver=2.8.9
pkgrel=1
pkgdesc="Jitsi Meet desktop application"
arch=('x86_64' 'aarch64')
url="https://jitsi.org/jitsi-meet/"
license=('Apache')
conflicts=('jitsi-meet-electron-bin'
'jitsi-meet-electron')
replaces=('jitsi-meet-electron')
depends=('gtk3'
'libxss'
'nss')
depends=('electron')
makedepends=('coreutils'
'git'
'npm'
'python2'
'png++'
'libxtst'
'nvm'
)
options=(!strip)
source=("${pkgname}_${pkgver}.tar.gz::https://github.com/jitsi/jitsi-meet-electron/archive/v${pkgver}.tar.gz"
'pipewire_wayland.patch'
'no_targets.patch'
'jitsi-meet-desktop.desktop')
sha256sums=('f54a4c3ae93ffebf36a6d475037498ae9eef652a9f18c5dff82bb5491d3f909a'
'39d54520962f8665e858748335594cca6b504884462b80d79a0d8aa6141129c4'
'ab22749aa1570cc5d6050711011f849ec3f4fa49080231f98957255fa5250e36'
'36a30a15613d53b2a01626a5551315c6970889ce3c2688bce71e26c3333081a4')
case "$CARCH" in
aarch64)
_electronbuilderarch='arm64'
_dist_path="linux-${_electronbuilderarch}-unpacked"
;;
*)
_electronbuilderarch='x64'
_dist_path="linux-unpacked"
;;
esac
prepare() {
cd jitsi-meet-electron-${pkgver}
export npm_config_cache="${srcdir}/npm_cache"
_ensure_local_nvm
nvm install 14
# remove all hardcoded (x64) electron-builder targets
# for some reason, it's not enough to explicitely specify the desired (dir)
# target when calling electron-builder..
patch -Np1 -i ${srcdir}/no_targets.patch
_electron_dist=/usr/lib/electron
_electron_ver=$(cat ${_electron_dist}/version)
sed -r 's#("electron": ").*"#\1'${_electron_ver}'"#' -i package.json
# This patch from https://github.com/jitsi/jitsi-meet-electron/commit/0e0483cbc52a9cad1fef51ed5abb846bd6445b11
# broke jitsi-meet-electron for me on when running on sway with full wayland support via flags
# If you you want to use that feature flag (--WebRTCPipeWireCapturer), I'd recommend putting it in
# ~/.config/electron-flags.conf manually instead of having it applied by default
patch -Np1 -i ${srcdir}/pipewire_wayland.patch
npm install
# npm audit fix
}
build() {
cd jitsi-meet-electron-${pkgver}
export npm_config_cache="$srcdir/npm_cache"
_ensure_local_nvm
nvm use 14
# npm run build
npx webpack --config ./webpack.main.js --mode production
npx webpack --config ./webpack.renderer.js --mode production
npx electron-builder --linux --${_electronbuilderrarch} --dir dist -c.electronDist=${_electron_dist} -c.electronVersion=${_electron_ver}
}
package() {
cd jitsi-meet-electron-${pkgver}/
install -d "${pkgdir}/usr/bin"
install -d "${pkgdir}/opt/${pkgname}"
cp -r "${srcdir}/jitsi-meet-electron-${pkgver}/dist/${_dist_path}"/resources/* "${pkgdir}/opt/${pkgname}"
install -Dm644 -- resources/icon.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
cat << EOF > "$pkgdir"/usr/bin/$pkgname
#!/bin/sh
NODE_ENV=production ELECTRON_IS_DEV=false exec electron /opt/$pkgname/app.asar "\$@"
EOF
chmod +x "$pkgdir"/usr/bin/$pkgname
install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
# # https://wiki.archlinux.org/title/Node.js_package_guidelines#Package_contains_reference_to_$srcdir/$pkgdir
# find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
# local tmppackage="$(mktemp)"
# local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json"
# jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
# mv "$tmppackage" "$pkgjson"
# chmod 644 "$pkgjson"
}
# https://wiki.archlinux.org/title/Node.js_package_guidelines#Using_nvm
_ensure_local_nvm() {
# let's be sure we are starting clean
which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
export NVM_DIR="${srcdir}/.nvm"
# The init script returns 3 if version specified
# in ./.nvrc is not (yet) installed in $NVM_DIR
# but nvm itself still gets loaded ok
source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
}
|