summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a2760a0f1c5cb6c687f287cd104677c062a3ebe8 (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
# Author: futpib <futpib@gmail.com>

pkgname=pagraphcontrol-git
pkgver=1.0.13.r4.g128d65c
pkgrel=1
pkgdesc="PulseAudio Graph Control"
arch=('x86_64')
url='https://github.com/futpib/pagraphcontrol'
license=('GPL')
depends=('papeaks-git')
makedepends=('git' 'nodejs' 'yarn' 'node-gyp' 'python' 'unzip')
provides=('pagraphcontrol')
conflicts=('pagraphcontrol')
source=("git://github.com/futpib/pagraphcontrol.git")
sha256sums=('SKIP')

_pkgname=${pkgname%%-git}

pkgver() {
    cd "${srcdir}/${_pkgname}"

    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

build() {
    cd "${srcdir}/${_pkgname}"

    yarn install --frozen-lockfile --ignore-engines
    yarn build
}

package() {
    cd "${srcdir}/${_pkgname}"
    cd dist/*

    appdir="usr/lib/$_pkgname"
    install -d "$pkgdir/$(dirname "$appdir")"
    cp -r . "$pkgdir/$appdir"

    install -dm755 "$pkgdir/usr/bin"
    ln -s "/$appdir/$_pkgname" "$pkgdir/usr/bin/$_pkgname"

    install -Dm0644 -t "${pkgdir}/usr/share/applications" "$srcdir/$_pkgname/resources/pagraphcontrol.desktop"
}