Skip to content

Commit

Permalink
typstyle: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Integral-Tech committed Dec 28, 2024
1 parent 8e9e8f3 commit 6c78696
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
43 changes: 43 additions & 0 deletions archlinuxcn/typstyle/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Maintainer: Integral <[email protected]>
# Contributor: Jisu-Woniu <[email protected]>

pkgname=typstyle
pkgver=0.12.14
pkgrel=1
pkgdesc="Beautiful and reliable typst code formatter"
arch=('aarch64' 'armv7h' 'x86_64' 'riscv64')
url="https://github.com/Enter-tainer/${pkgname}"
license=('Apache-2.0')
depends=('gcc-libs')
makedepends=('cargo')
optdepends=("typst: For typst compilation")
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('053ae2b6349fe244f44dc816f7d91036c152eeb14bfc2c6bfeeca33cc5ac0c34')

prepare() {
cd "${pkgname}-${pkgver}/"
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
cd "${pkgname}-${pkgver}/"
cargo build --frozen --release --all-features
}

check() {
cd "${pkgname}-${pkgver}/"
cargo test --frozen --all-features
}

package() {
cd "${pkgname}-${pkgver}/"
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
install -d "${pkgdir}/usr/share/doc/${pkgname}/"
cp -r docs/* "${pkgdir}/usr/share/doc/${pkgname}/"

cd target/release
install -Dm755 "${pkgname}" -t "${pkgdir}/usr/bin/"
"./${pkgname}" completions bash | install -Dm644 /dev/stdin "${pkgdir}/usr/share/bash-completion/completions/${pkgname}"
"./${pkgname}" completions zsh | install -Dm644 /dev/stdin "${pkgdir}/usr/share/zsh/site-functions/_${pkgname}"
"./${pkgname}" completions fish | install -Dm644 /dev/stdin "${pkgdir}/usr/share/fish/vendor_completions.d/${pkgname}.fish"
}
12 changes: 12 additions & 0 deletions archlinuxcn/typstyle/lilac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
maintainers:
- github: Integral-Tech
email: [email protected]

pre_build_script: update_pkgver_and_pkgrel(_G.newver)
post_build_script: git_pkgbuild_commit()

update_on:
- source: github
github: Enter-tainer/typstyle
use_latest_release: true
prefix: v

0 comments on commit 6c78696

Please sign in to comment.