summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 78c0705f697d91c66635c57f972abc9559d7be9c (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>

# https://wiki.archlinux.org/index.php/Electron_package_guidelines

pkgname=ezra-project-git
pkgver=0.9.0.r16.g99704cd
_branch='master'
pkgrel=1
pkgdesc="a bible study software focussing on topical study based on keywords/tags"
arch=('x86_64')
url="https://github.com/tobias-klein/ezra-project"
license=('GPL3')
depends=('electron' 'nodejs')
makedepends=('npm' 'git' 'sword')
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
source=("git://github.com/tobias-klein/${pkgname%-git}.git#branch=$_branch"
        'ezra-project.sh'
        'ezra-project.desktop')
sha256sums=('SKIP'
            '0a36167bce248b6082045163cf60b143d02ca1e447a791cf0c88e960a7fdc618'
            'f89adcdecca5b0684679a4c4060a7e0398b5d332b2377e0fb0e115969d94e116')
_electron="$(electron --version | sed 's/^v//')"

pkgver() {
    cd "$srcdir/${pkgname%-git}"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "$srcdir/${pkgname%-git}"
    npm uninstall --no-audit -D electron
    npm install --no-audit electron@"$_electron"
}

build() {
    cd "$srcdir/${pkgname%-git}"
    "$(npm bin)"/electron-rebuild -f -w node-sword-interface -v "$_electron"
}

package() {
    cd "$srcdir/${pkgname%-git}"
    install -Dm644 "$srcdir/${pkgname%-git}.desktop" "$pkgdir/usr/share/applications/${pkgname%-git}.desktop"
    install -Dm755 "$srcdir/${pkgname%-git}.sh" "$pkgdir/usr/bin/${pkgname%-git}"
    "$(npm bin)"/electron-packager . "${pkgname%-git}" --overwrite --asar --platform=linux --arch=x64 --prune=true --out=release --electron-version="$_electron"
    rm release/ezra-project-linux-x64/"${pkgname%-git}"
    mkdir "$pkgdir/usr/lib/"
    cp -a release/ezra-project-linux-x64 "$pkgdir/usr/lib/${pkgname%-git}"
}