Package Details: typst-lsp 0.10.1-1

Git Clone URL: https://aur.archlinux.org/typst-lsp.git (read-only, click to copy)
Package Base: typst-lsp
Description: Language server for Typst
Upstream URL: https://github.com/nvarner/typst-lsp
Licenses: MIT, Apache
Submitter: Chocobo1
Maintainer: Chocobo1
Last Packager: Chocobo1
Votes: 2
Popularity: 0.35
First Submitted: 2023-04-05 18:23 (UTC)
Last Updated: 2023-09-22 18:23 (UTC)

Latest Comments

alerque commented on 2023-06-21 23:38 (UTC) (edited on 2023-06-21 23:38 (UTC) by alerque)

If you can't be bothered to follow packaging guidelines can you please consider disowning or at least adding me as a co-maintainer yet. This package doesn't have enough usage yet for me to justify moving it to official repos. If we get some votes and/or usage showing up in pkgstats I will probably do that eventually.

Also it can't be that much of a bother to copy the patch I sent to a file and apply it with a single command, then push it. I already handled all the guideline fixes for you.

Chocobo1 commented on 2023-06-19 17:00 (UTC)

Can you please overhaul this a bit to follow the Arch Rust package guidelines.

Lets say I have other considerations and I don't really want to deal with it. Could you please consider bringing this package into (arch) official repo and maintain it? I believe it would be the best for all users.

alerque commented on 2023-06-15 20:01 (UTC)

This patch can be saved to a file and applied with git am file.patch and covers the issues I mentioned:

From fc7bf6102b7b843ea2878a4f9d91e7186d98ea08 Mon Sep 17 00:00:00 2001
From: Caleb Maclennan <caleb@alerque.com>
Date: Thu, 15 Jun 2023 22:34:38 +0300
Subject: [PATCH] Overhaul to fix cargo build/package split and other
 guidelines

Signed-off-by: Caleb Maclennan <caleb@alerque.com>
---
 .SRCINFO |  7 ++++---
 PKGBUILD | 51 +++++++++++++++++++++++++--------------------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/.SRCINFO b/.SRCINFO
index dc3b6e9..1cb9a32 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,16 @@
 pkgbase = typst-lsp
    pkgdesc = Language server for Typst
    pkgver = 0.6.2
-   pkgrel = 1
+   pkgrel = 2
    url = https://github.com/nvarner/typst-lsp
    arch = i686
    arch = x86_64
    license = Apache
    license = MIT
-   makedepends = rust
+   makedepends = cargo
    depends = gcc-libs
-   source = typst-lsp-0.6.2-src.tar.gz::https://github.com/nvarner/typst-lsp/archive/refs/tags/v0.6.2.tar.gz
+   depends = glibc
+   source = https://github.com/nvarner/typst-lsp/archive/v0.6.2/typst-lsp-0.6.2.tar.gz
    sha256sums = 197be73f657c4c5f26ce43310e83b56352b4ecf9b59d22d765ec1bbb0e76027b

 pkgname = typst-lsp
diff --git a/PKGBUILD b/PKGBUILD
index 3cf9320..d122018 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,42 +1,41 @@
 # Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>
+# Contributor: Caleb Maclennan <caleb@alerque.com>

 pkgname=typst-lsp
 pkgver=0.6.2
-pkgrel=1
-pkgdesc="Language server for Typst"
-arch=('i686' 'x86_64')
-url="https://github.com/nvarner/typst-lsp"
-license=('Apache' 'MIT')
-depends=('gcc-libs')
-makedepends=('rust')
-source=("$pkgname-$pkgver-src.tar.gz::https://github.com/nvarner/typst-lsp/archive/refs/tags/v$pkgver.tar.gz")
+pkgrel=2
+pkgdesc='Language server for Typst'
+arch=(i686 x86_64)
+url="https://github.com/nvarner/$pkgname"
+license=(Apache MIT)
+depends=(gcc-libs
+         glibc)
+makedepends=(cargo)
+_archive="$pkgname-$pkgver"
+source=("$url/archive/v$pkgver/$_archive.tar.gz")
 sha256sums=('197be73f657c4c5f26ce43310e83b56352b4ecf9b59d22d765ec1bbb0e76027b')


 prepare() {
-  cd "typst-lsp-$pkgver"
+   cd "$_archive"
+   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
+}

-  if [ ! -f "Cargo.lock" ]; then
-    cargo update
-  fi
-  cargo fetch
+build() {
+   cd "$_archive"
+   export RUSTUP_TOOLCHAIN=stable
+   export CARGO_TARGET_DIR=target
+   cargo build --frozen --release --all-features
 }

 check() {
-  cd "typst-lsp-$pkgver"
-
-  #cargo test \
-  #  --frozen
+   cd "$_archive"
+   export RUSTUP_TOOLCHAIN=stable
+   cargo test  --frozen --all-features
 }

 package() {
-  cd "typst-lsp-$pkgver"
-
-  cargo install \
-    --locked \
-    --no-track \
-    --root "$pkgdir/usr" \
-    --path .
-
-  install -Dm644 "LICENSE-MIT.txt" -t "$pkgdir/usr/share/licenses/typst-lsp"
+   cd "$_archive"
+   install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
+   install -Dm644 "LICENSE-MIT.txt" -t "$pkgdir/usr/share/licenses/typst-lsp"
 }
-- 
2.41.0

alerque commented on 2023-06-15 06:32 (UTC)

Can you please overhaul this a bit to follow the Arch Rust package guidelines. Just on a quick inspection there are quite a few things missing. First, upstream has a lock file so use it, don't silently create it if missing. If they miss it or don't update it it should fail. Also the fetch should be limited to the architecture. Then a build function should be added and used instead of cargo install (unless that is absolutely unavoidable). A couple of environment variables also need setting to get the right toolchain in case people have defaulted to a nightly Rust toolchain, etc. The Wiki explains all these.