aboutsummaryrefslogtreecommitdiffstats
path: root/community/stylua/APKBUILD
blob: f7158261f4e88d3f13b33fc4729ad50cab79d751 (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.1
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="
aeb85764529b584bbb51e1a3cda1c15d26fe97785716a016f2a5450ddcd509fba1840e4edca79ee0b3dd4c56f3bfff8bc61f88e09f3e575d861756257d5165f4  stylua-0.14.1.tar.gz
"