summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 123c2b155921917b0b0f5935d0df9206e21845c7 (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
pkgname=gamerworld-git
_pkgname=GamerWorld-git
pkgver=1.2.0
pkgrel=8
pkgdesc="Play games all in one place"
arch=('any')
url="https://gitlab.com/gamerworld/application"
license=('GPL')
depends=('nss' 'gtk3' 'libxss')
makedepends=('npm' 'git' 'unzip')
provides=("${pkgname%}")
conflicts=("gamerworld-bin")
source=('git+https://gitlab.com/gamerworld/application.git')
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/application"
    node -pe "require('./package.json').version"
}

build() {
    cd "$srcdir/application"
    npm --cache "$srcdir/npm-cache" i electron@12.0.2 jquery electron-packager
    ./node_modules/.bin/electron-packager .
    for dir in GamerWorld-linux-*/ ; do mv "${dir}" "GamerWorld" ;done
}

package() {
    cd "$srcdir/application/GamerWorld"
    install -dm755 "$pkgdir/opt/GamerWorld"
    cp -r ./ "$pkgdir/opt/GamerWorld"

    # Link to binary
    install -dm755 "$pkgdir/usr/bin"
    ln -s "/opt/$_pkgname/GamerWorld" "$pkgdir/usr/bin/GamerWorld"

    # Desktop Entry
    install -Dm644 "$srcdir/application/GamerWorld.desktop" \
        "$pkgdir/usr/share/applications/GamerWorld.desktop"
    sed -i s%/usr/share%/opt% "$pkgdir/usr/share/applications/GamerWorld.desktop"
}