Date: Friday, March 24, 2023 @ 10:43:19 Author: alerque Revision: 1427685
Migrate typst from AUR Added: typst/ typst/repos/ typst/trunk/ typst/trunk/PKGBUILD ----------+ PKGBUILD | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) Added: typst/trunk/PKGBUILD =================================================================== --- typst/trunk/PKGBUILD (rev 0) +++ typst/trunk/PKGBUILD 2023-03-24 10:43:19 UTC (rev 1427685) @@ -0,0 +1,47 @@ +# Maintainer: Caleb Maclennan <[email protected]> +# Contributor: Ilaï Deutel + +# Upstream versioning is a fiasco. Even with suggestions on hand they deleted +# the off-by-one crazy date tag scheme and recreated the same crazy scheme with +# different dates. I'm normalizing this to something we can parse, but when they +# realize they can't upload to crates.io like this I suspect the project will be +# forced into semver someday, requiring an epoch. Other distros have done other +# substitutions, there is no consensus yet. +# See https://github.com/typst/typst/issues/155 +# See https://github.com/typst/typst/issues/157 +_pkgver=23-03-21-2 +_hash=b934a2fd83d63fc115c01f959e888c7bc1aa87e4 + +pkgname=typst +pkgver=${_pkgver//-/.} +pkgrel=1 +pkgdesc='A markup-based typesetting system for the sciences' +arch=(x86_64) +url="https://$pkgname.app" +_url="https://github.com/$pkgname/$pkgname" +license=(Apache) +makedepends=(cargo) +_archive="$pkgname-$_pkgver" +source=("$_url/archive/v$_pkgver/$_archive.tar.gz") +sha256sums=('4f07dc4691302c4379ad4deae89bf13c3015921d89d14ab1755cdd08b6bd9ac2') + +prepare() { + cd "$_archive" + sed -i -e "/let output/d;/let hash/s/=.*/= \"$_hash\";/" cli/build.rs + cargo fetch --locked --target "$CARCH-unknown-linux-gnu" +} + +build() { + cd "$_archive" + cargo build -p typst-cli --frozen --release --all-features +} + +check() { + cd "$_archive" + cargo test --workspace --frozen --all-features +} + +package() { + cd "$_archive" + install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname" +}
