summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 38c2a40c2774993a0d889a37dc3114abeaffe581 (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: Rajdeep Malakar <rajdeepm.dev@gmail.com>

pkgname="pkgx-git"
_pkgname="pkgx"
pkgver=1.1.6.996.ga0da42e
pkgrel=3
pkgdesc="the last thing you’ll install"
arch=("x86_64" "arm")
url="https://github.com/pkgxdev/pkgx"
license=("Apache-2.0")
depends=()
makedepends=(
	"deno" # For Compiling
	"git"  # For Cloning
)
provides=("pkgx")
conflicts=("pkgx")
source=("$_pkgname::git+https://github.com/pkgxdev/pkgx.git")
b2sums=("SKIP") # Since it's a VCS Package, it makes no sense to have checksums
options=(!strip)

pkgver() {
	cd "$_pkgname"
	export VER="$(git tag --sort=committerdate | grep -E '[0-9]' | tail -1 | cut -b 2-7)"
	export REV="$(git rev-list --count HEAD)"
	export COMMIT="$(git rev-parse --short HEAD)"
	echo "$VER.$REV.g$COMMIT"
}

build() {
	cd "$_pkgname"
	# Patch version
	echo "export default function() { return '$pkgver' }" >src/modes/version.ts
	deno task compile
}

check() {
	cd "$_pkgname"
	deno task typecheck
	deno task test
}

package() {
	cd "$srcdir/$_pkgname"
	install -D $_pkgname "$pkgdir/usr/local/bin/$_pkgname"
	install -D LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}