aboutsummaryrefslogtreecommitdiffstats
path: root/community/stylua/APKBUILD
blob: bd6d73a7e208724c0120d3bf4871821d65133e55 (plain) (blame)
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
# Contributor: psykose <alice@ayaya.dev>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=stylua
pkgver=0.14.2
pkgrel=0
pkgdesc="Opinionated Lua 5.1/5.2/luau code formatter"
url="https://github.com/JohnnyMorganz/StyLua"
arch="all !s390x !riscv64" # blocked by cargo
license="MPL-2.0"
makedepends="cargo"
source="$pkgname-$pkgver.tar.gz::https://github.com/JohnnyMorganz/StyLua/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/StyLua-$pkgver"

prepare() {
	default_prepare
	cargo fetch --locked
}

build() {
	cat >> Cargo.toml <<- EOF
		[profile.release]
		codegen-units = 1
		lto = true
		opt-level = "s"
		panic = "abort"
	EOF
	cargo build --release --frozen
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 "$builddir"/target/release/stylua \
		-t "$pkgdir"/usr/bin
}

sha512sums="
814118e14a56900c8b131c407c19e1e1ca4757e0b5754c30a47ca6085eaf760160177486df4980af8ebd8fbe19b5327daf4bd514080946759e70beab9578eed9  stylua-0.14.2.tar.gz
"