From 9ae2649ae386c8664f115225d669bf9b7d944494 Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sat, 20 May 2023 16:31:51 +0200 Subject: [PATCH] Create nimlangserver package including patches for Arch Patch nimlangserver to work around missing /usr/compiler/pathutils Reenable testing Fixed missing packages.json file --- .SRCINFO | 14 +++++++++++++ .gitignore | 4 ++++ PKGBUILD | 51 +++++++++++++++++++++++++++++++++++++++++++++ nimlangserver.patch | 12 +++++++++++ 4 files changed, 81 insertions(+) create mode 100644 .SRCINFO create mode 100644 .gitignore create mode 100644 PKGBUILD create mode 100644 nimlangserver.patch diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..105ac4c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,14 @@ +pkgbase = nimlangserver-git + pkgver = latest.r9.gf7b32fa + pkgrel = 1 + url = https://github.com/nim-lang/langserver + arch = x86_64 + license = MIT + makedepends = git + depends = nim>=1.0.0 + provides = nimlangserver + conflicts = nimlangserver + source = nimlangserver::git+https://github.com/nim-lang/langserver.git + sha256sums = SKIP + +pkgname = nimlangserver-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..21c9591 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.zst +/nimlangserver/ +/src/ +/pkg/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..496ff2d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: RealStickman + +pkgname=nimlangserver-git +pkgver=latest.r9.gf7b32fa +pkgrel=1 +pkgdesc="" +arch=('x86_64') +url="https://github.com/nim-lang/langserver" +license=('MIT') +depends=('nim>=1.0.0') +makedepends=('git') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=("${pkgname%-git}::git+$url.git" + "nimlangserver.patch") +sha256sums=('SKIP' + '76a987077dea6a224a6337a08f172f92da1734af6c7e31e8674d131654aba07c') + +prepare() { + # patching + cd "$srcdir/${pkgname%-git}" + patch --strip=2 < ../../nimlangserver.patch # work around "Error: cannot open file: /usr/compiler/pathutils" https://github.com/nim-lang/langserver/issues/22 + # download packages.json file + nimble refresh +} + +pkgver() { + cd "$srcdir/${pkgname%-git}" + git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + # change into source + cd "$srcdir/${pkgname%-git}" + # compile program + nimble build +} + +check() { + # change into source + cd "$srcdir/${pkgname%-git}" + # run all tests + nimble test +} + +package() { + # create our target filestructure + mkdir -p "$pkgdir/usr/bin" + # copy executable + install -Dm755 "$srcdir/${pkgname%-git}/${pkgname%-git}" "$pkgdir/usr/bin/${pkgname%-git}" +} diff --git a/nimlangserver.patch b/nimlangserver.patch new file mode 100644 index 0000000..f44f9a5 --- /dev/null +++ b/nimlangserver.patch @@ -0,0 +1,12 @@ +diff '--color=auto' --unified --recursive --text --color src/nimlangserver-orig/nimlangserver.nim src/nimlangserver/nimlangserver.nim +--- src/nimlangserver-orig/nimlangserver.nim 2023-05-25 14:56:42.996481704 +0200 ++++ src/nimlangserver/nimlangserver.nim 2023-05-25 14:56:51.320521779 +0200 +@@ -2,7 +2,7 @@ + faststreams/asynctools_adapters, faststreams/inputs, faststreams/outputs, + json_rpc/streamconnection, os, sugar, sequtils, hashes, osproc, + suggestapi, protocol/enums, protocol/types, with, tables, strutils, sets, +- ./utils, ./pipes, chronicles, std/re, uri, "$nim/compiler/pathutils" ++ ./utils, ./pipes, chronicles, std/re, uri, "$lib/compiler/pathutils" + + const + RESTART_COMMAND = "nimlangserver.restart"