-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,58 @@ | ||
# Maintainer: Nicholas Novak <34256932+NickyBoy89@users.noreply.github.com> | ||
|
||
pkgname=typst-git | ||
_pkgname=${pkgname%-git} | ||
name=typst | ||
pkgver=r2346.d7928a8e | ||
pkgver=0.11.0.r25.g1e645b396 | ||
pkgrel=1 | ||
pkgdesc="A new markup-based typesetting system that is powerful and easy to learn. " | ||
pkgdesc='A markup-based typesetting system for the sciences' | ||
license=('Apache-2.0') | ||
arch=('any') | ||
makedepends=('git' 'cargo') | ||
provides=('typst') | ||
depends=('gcc-libs' 'glibc') | ||
_url="https://github.com/$_pkgname/$_pkgname" | ||
makedepends=(cargo | ||
git) | ||
provides=("$_pkgname=$pkgver") | ||
conflicts=("$_pkgname") | ||
depends=(gcc-libs | ||
glibc) | ||
url="https://github.com/typst/typst" | ||
source=( | ||
"typst::git+https://github.com/typst/typst" | ||
) | ||
source=("$_pkgname::git+$_url.git") | ||
md5sums=('SKIP') | ||
|
||
prepare() { | ||
cd "$srcdir/typst" | ||
cargo fetch --locked --target "$CARCH-unknown-linux-gnu" | ||
cd "$_pkgname" | ||
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" | ||
} | ||
|
||
|
||
pkgver() { | ||
cd "$srcdir/typst" | ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | ||
cd "$_pkgname" | ||
git describe --long --tags | | ||
sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g;s/rc.\.//' | ||
} | ||
|
||
_srcenv() { | ||
export RUSTUP_TOOLCHAIN=nightly | ||
export CARGO_TARGET_DIR=target | ||
export RUSTFLAGS="-Z threads=2" | ||
} | ||
|
||
build() { | ||
cd "$srcdir/typst" | ||
cd "$_pkgname" | ||
_srcenv | ||
CFLAGS+=" -ffat-lto-objects" | ||
export TYPST_VERSION="${pkgver}" | ||
export GEN_ARTIFACTS=artifacts/ | ||
cargo build -p typst-cli --release --all-features | ||
cargo build -p typst-cli --frozen --release --all-features | ||
} | ||
|
||
package() { | ||
# Install the binary | ||
install -vDm 755 "$srcdir/typst/target/release/typst" "$pkgdir/usr/bin/typst" | ||
|
||
# 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" | ||
cd "$_pkgname" | ||
local _artifacts='crates/typst-cli/artifacts' | ||
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_pkgname" | ||
install -Dm0644 -t "$pkgdir/usr/share/man/man1/" "$_artifacts/$_pkgname"*.1 | ||
install -Dm0644 -t "$pkgdir/usr/share/zsh/site-functions/" "$_artifacts/_$_pkgname" | ||
install -Dm0644 -t "$pkgdir/usr/share/fish/vendor_completions.d/" "$_artifacts/$_pkgname.fish" | ||
install -Dm0644 "$_artifacts/$_pkgname.bash" "$pkgdir/usr/share/bash-completion/completions/$_pkgname" | ||
} | ||
|