summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cfddfe19fc3e445de66db347b0714f6049472da7 (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
# Maintainer: DatCom <github+aur@datcom-unibw.de>

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

license=('APACHE-2.0')

conflicts=('jitsi-meet-electron-bin'
           'jitsi-meet-electron')
replaces=('jitsi-meet-electron')

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'
            '44cfdf34d04231d5b37327a9daa2e1f9f49c880329d5742e5d77537a0a64df8f'
            )

            
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
    sed -i 's#git+ssh://git@github.com#https://github.com#g' package-lock.json

    export npm_config_cache="${srcdir}/npm_cache"
    npm install
}
            
build() {
    cd jitsi-meet-electron-${pkgver}/
    export npm_config_cache="${srcdir}/npm_cache"

    source /usr/share/nvm/init-nvm.sh
    nvm use 14

    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"
}