From affa489a5cdc0bb1e5316e64e8db276bee61b5f9 Mon Sep 17 00:00:00 2001 From: Alejandro Osornio <50227494+AOx0@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:53:49 -0600 Subject: [PATCH] typst: Include completions and man pages --- typst-git/.gitignore | 3 ++- typst-git/PKGBUILD | 22 +++++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/typst-git/.gitignore b/typst-git/.gitignore index 92d930d..78ab768 100644 --- a/typst-git/.gitignore +++ b/typst-git/.gitignore @@ -1,3 +1,4 @@ src typst -pkg \ No newline at end of file +pkg +typst-git* diff --git a/typst-git/PKGBUILD b/typst-git/PKGBUILD index 700f7d3..b75a642 100644 --- a/typst-git/PKGBUILD +++ b/typst-git/PKGBUILD @@ -1,20 +1,27 @@ # Maintainer: Nicholas Novak <34256932+NickyBoy89@users.noreply.github.com> 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)" @@ -22,7 +29,9 @@ pkgver() { 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() { @@ -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" }