2023-05-20 16:31:51 +02:00
# Maintainer: RealStickman <mrc+aur _a_ frm01 _d_ net>
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' )
2023-05-25 15:31:05 +02:00
makedepends = ( 'git' )
2023-05-20 16:31:51 +02:00
provides = ( " ${ pkgname %-git } " )
conflicts = ( " ${ pkgname %-git } " )
2023-05-25 15:31:05 +02:00
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
2023-05-25 19:36:42 +02:00
# download packages.json file
nimble refresh
2023-05-25 15:31:05 +02:00
}
2023-05-20 16:31:51 +02:00
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
}
2023-05-25 18:49:57 +02:00
check( ) {
2023-05-20 16:31:51 +02:00
# change into source
2023-05-25 18:49:57 +02:00
cd " $srcdir / ${ pkgname %-git } "
2023-05-20 16:31:51 +02:00
# run all tests
2023-05-25 18:49:57 +02:00
nimble test
}
2023-05-20 16:31:51 +02:00
package( ) {
# create our target filestructure
mkdir -p " $pkgdir /usr/bin "
# copy executable
install -Dm755 " $srcdir / ${ pkgname %-git } / ${ pkgname %-git } " " $pkgdir /usr/bin/ ${ pkgname %-git } "
}