summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0442249aadf828fe3806cbbac05ffdfa95ac9fa6 (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
# Maintainer: Nicolas FORMICHELLA <stigpro@outlook.fr>
pkgname=n-link-git 
_pkgname=n-link
pkgver=0.1.6.r3.g5ce4d8a
pkgrel=1
pkgdesc="Free, cross-platform, CX-II compatible computer linking program for the TI-Nspire."
arch=("x86_64")
url="https://lights0123.com/n-link/"
license=('GPL3')
groups=()
depends=("nodejs-lts-fermium" "webkit2gtk" "squashfs-tools")
makedepends=('git' 'rust')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
replaces=()
backup=()
options=()
install="${_pkgname}.install"
source=(git+"https://github.com/lights0123/${_pkgname}.git" 
        "69-${_pkgname}.rules" 
        "only-build-deb.patch")
noextract=()
md5sums=('SKIP'
         '2c9e778637586091f4d5cfd74b5ee6a5'
         '1a69d6a98b8d9e8de295750fec0b6475')

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

prepare() {
	cd "$srcdir/${pkgname%-git}/desktop/src-tauri"
        patch -uN tauri.conf.json < ${srcdir}/only-build-deb.patch
        cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
        cd ..
        yarn install
}

build() {
	cd "$srcdir/${pkgname%-git}/desktop"
	yarn tauri:build
}

package() {
	cd "$srcdir/${pkgname%-git}/desktop/src-tauri/target/release/bundle/deb/"
	find . -type f -name *.deb -print0 | xargs -0 -I '{}' ar p {} data.tar.gz | bsdtar -C "${pkgdir}" -xf -
        find "${pkgdir}" -type d -exec chmod 755 {} \;
        mkdir -p "${pkgdir}/etc/udev/rules.d/"
        install -Dm644 "${srcdir}/69-${_pkgname}.rules" "${pkgdir}/etc/udev/rules.d/69-${pkgname}.rules"
}