Skip to content

Commit

Permalink
typst: Include completions and man pages
Browse files Browse the repository at this point in the history
  • Loading branch information
AOx0 committed Sep 26, 2023
1 parent 517a78a commit affa489
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
3 changes: 2 additions & 1 deletion typst-git/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
src
typst
pkg
pkg
typst-git*
22 changes: 19 additions & 3 deletions typst-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
# Maintainer: Nicholas Novak <[email protected]>

pkgname=typst-git
pkgver=r2301.360cc9b9
name=typst
pkgver=r2346.d7928a8e
pkgrel=1
pkgdesc="A new markup-based typesetting system that is powerful and easy to learn. "
license=('Apache-2.0')
arch=('any')
makedepends=('git' 'cargo')
provides=('typst')
depends=()
depends=('gcc-libs' 'glibc')
url="https://github.com/typst/typst"
source=(
"typst::git+https://github.com/typst/typst"
)
md5sums=('SKIP')

prepare() {
cd "$srcdir/typst"
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}


pkgver() {
cd "$srcdir/typst"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
cd "$srcdir/typst"
cargo build -p typst-cli --release
CFLAGS+=" -ffat-lto-objects"
export GEN_ARTIFACTS=artifacts/
cargo build -p typst-cli --release --all-features
}

package() {
Expand All @@ -31,5 +40,12 @@ package() {

# Install the licenses
install -vDm 644 "$srcdir/typst/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

# Install man pages and completions
local _artifacts="$srcdir/typst/crates/typst-cli/artifacts"
install -Dm0644 -t "$pkgdir/usr/share/man/man1/" "$_artifacts/$name"*.1
install -Dm0644 -t "$pkgdir/usr/share/zsh/site-functions/" "$_artifacts/_$name"
install -Dm0644 -t "$pkgdir/usr/share/fish/vendor_completions.d/" "$_artifacts/$name.fish"
install -Dm0644 "$_artifacts/$name.bash" "$pkgdir/usr/share/bash-completion/completions/$name"
}

0 comments on commit affa489

Please sign in to comment.