summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0386f816d028e07c27bb7c5f39870f77e7fcf700 (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
# Maintainer: Kian Kasad <kian at kasad.com>

pkgname=sponsorblock-chromium-git
pkgver=2.0.7.r38.4dc4160
pkgrel=1
pkgdesc="SponsorBlock extension for chromium-based browsers"
arch=(any)
url="https://github.com/ajayyy/SponsorBlock"
license=('GPL')
makedepends=('git' 'npm')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname%-git}::git+${url}.git")
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/${pkgname%-git}"

	# print version string
	printf "%s" "$(git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

prepare() {
	cd "$srcdir/${pkgname%-git}"

	cp config.json.example config.json

	# install build-time dependencies using npm
	npm install
}

build() {
	cd "$srcdir/${pkgname%-git}"

	# build extension
	npm run build
}

package() {
	cd "$srcdir/${pkgname%-git}"

	# create install dir
	mkdir -p "$pkgdir/usr/share/"

	# install extension files
	cp -aT dist "$pkgdir/usr/share/${pkgname%-git}"
}