summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7ef355a50838b18016122a00c99fb2f69c01d1de (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
50
51
52
53
54
55
56
57
58
59
60
61
# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.
# NOTE: Please fill out the license field for your package! If it is unknown,
# then please put 'unknown'.

# Maintainer: Noah Heller <softwareenginer@pm.me>
pkgname=advantagescope-git
pkgver=r1232.73e92df
pkgrel=1
epoch=
pkgdesc="robot diagnostics, log review/analysis, and data visualization application tool"
arch=(x86_64)
url="https://github.com/Mechanical-Advantage/AdvantageScope.git"
license=('MIT')
groups=()
depends=(nspr libxdamage dbus nss libxcb libxext glib2 libxrandr mesa libxfixes alsa-lib alsa-lib glibc gcc-libs libcups libxkbcommon cairo at-spi2-core pango expat libx11 gtk3 libdrm libxcomposite hicolor-icon-theme)
makedepends=(sudo jq curl git npm emsdk tar)
checkdepends=()
optdepends=()
provides=()
conflicts=(advantagescope)
replaces=()
backup=()
options=()
install=
changelog=
source=("git+$url")
noextract=()
sha256sums=('SKIP')
validpgpkeys=()

pkgver(){
	cd "AdvantageScope"
	( set -o pipefail
    git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
  )
}
build() {
	cd AdvantageScope
	sudo /usr/lib/emsdk/emsdk install latest
	sudo /usr/lib/emsdk/emsdk activate latest
	source /usr/lib/emsdk/emsdk_env.sh
	npm install
	jq '. + { homepage: "https://github.com/Mechanical-Advantage/AdvantageScope" }' package.json > temp.json && mv temp.json package.json
	npm run build -- --linux --config.linux.target=pacman
	curl -OL https://raw.githubusercontent.com/Mechanical-Advantage/AdvantageScope/refs/heads/main/LICENSE
	cd dist
	tar xvf advantagescope-$pkgver.pacman
}


package() {
	cd AdvantageScope
	install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
	cd dist
	cp -rf opt "$pkgdir"
  cp -rf usr "$pkgdir"
  mkdir -p "$pkgdir/usr/bin"
  ln -s "/opt/AdvantageScope/$pkgname" "$pkgdir/usr/bin/$pkgname"
}