summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c58271597b62e8f6a3a19aa8abe03c60c283f3e0 (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
# Maintainer: bobpaul <aurpackage [at] bobpaul 'period' org>
_pkgname=blisp
pkgname=blisp-git
pkgver=v0.0.4.r30.ge45941c
pkgrel=1
pkgdesc="ISP tool & library for Bouffalo Labs RISC-V Microcontrollers and SoCs"
url="https://github.com/pine64/blisp"
makedepends=('git' 'cmake')
license=("MIT")
arch=('x86_64' 'armv7h' 'aarch64' 'powerpc' 'powerpc64' 'powerpc64le' 'riscv64')
conflicts=("${_pkgname}")
provides=("${_pkgname}")
source=("git+https://github.com/pine64/blisp/"
	    "termios.patch")
sha256sums=('SKIP'
            '373366d48729a2ccc678fcb6ec5d5bdd15d663c77b27552e744908a72a9e5916')

prepare(){
	cd "${_pkgname}"
	git submodule update --init --recursive

	case "$CARCH" in
		"powerpc"*)
			echo "Patching: ppc, ppc64, and ppc64le use termios, not termios2"
			patch < ../termios.patch
			;;
		*)
			;;
	esac
	mkdir -p build
	cd build

	cmake -DBLISP_BUILD_CLI=ON ..
}


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

build() {
	cd "${_pkgname}"/build
	cmake --build .
}

package() {
  install -Dm755 "${srcdir}"/"${_pkgname}"/build/tools/blisp/blisp "${pkgdir}/"usr/bin/blisp
}