summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 315f97f4b7f280595ffa9ea251237315d5a0beb2 (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
# Maintainer: Philipp Reger <philipp.reger@outlook.com>

pkgname=datcom-jitsi-meet-electron
pkgver=2.8.500
pkgrel=11
pkgdesc="DatCom Jitsi Meet Desktop"
arch=('x86_64')
url="https://github.com/datcom-unibw/jitsi-meet-electron"

license=('APACHE-2.0')

conflicts=()

depends=('electron'
         'gtk3'
         'libxss'
         'nss')

makedepends=('coreutils'
             'git'
             'npm'
             'python2'
             'png++'
             'libxtst'
             'nvm'
             )

source=(datcom-jitsi-meet-electron.desktop
        "jitsi-meet-electron-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
        )

sha256sums=('5976b5ced6c707d79cc21666abcbfc11c6d8f1b83eb8505dc8b29d62ca85c7e9'
            '391aae579c639cbe9f569e49fe90303c505ea36fc453c9b868981fd900c08cfc'
            )

            
prepare() {
  export npm_config_cache="$srcdir/npm_cache"
  _npm_prefix=$(npm config get prefix)
  npm config delete prefix
  source /usr/share/nvm/init-nvm.sh
  nvm install 14 && nvm use 14

  cd jitsi-meet-electron-${pkgver}/

  sed -r 's#("electron": ").*"#\1'$(cat /usr/lib/electron/version)'"#' -i package.json

  export npm_config_cache="${srcdir}/npm_cache"
  npm install
  # npm audit fix
}
            
build() {
    cd jitsi-meet-electron-${pkgver}/
    npm run build
    npx electron-builder --dir
    npm config set prefix ${_npm_prefix}
    nvm unalias default
}

package() {
	_dist_path=${srcdir}/jitsi-meet-electron-${pkgver}/dist/linux-unpacked

    install -d "${pkgdir}/usr/bin"
    install -d "${pkgdir}/opt/datcom-jitsi-meet-electron"
    cp -r "${_dist_path}"/resources/* "${pkgdir}/opt/datcom-jitsi-meet-electron"

    install -Dm644 -- ${srcdir}/jitsi-meet-electron-$pkgver/resources/icon.png "${pkgdir}/usr/share/pixmaps/datcom-jitsi-meet-electron.png"

    cat << EOF > "$pkgdir"/usr/bin/datcom-jitsi-meet-electron
#!/bin/sh

NODE_ENV=production ELECTRON_IS_DEV=false exec electron /opt/datcom-jitsi-meet-electron/app.asar "\$@"
EOF

    chmod +x "$pkgdir"/usr/bin/datcom-jitsi-meet-electron

    install -Dm644 "${srcdir}/datcom-jitsi-meet-electron.desktop" "${pkgdir}/usr/share/applications/datcom-jitsi-meet-electron.desktop"
}