blob: 321a70960a9551464fffd28b864b324457e20aca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# Maintainer: Asuka Minato <i at asukaminato dot eu dot org>
_pkgname=delance-runtime
pkgname=delance-langserver
# If patch >= 100, update _pkgver only
_pkgver="2024.4.104"
pkgver="2024.4.1.r104"
pkgrel=1
pkgdesc="A spear to the Python language server built with black magic"
arch=(any)
url="https://sr.ht/~self/delance/"
license=('0BSD')
depends=(nodejs)
makedepends=(npm jq)
source=("https://git.sr.ht/~self/${_pkgname}/archive/v${_pkgver}.tar.gz")
sha256sums=('69e31712772c18a2deaa87ee0f0c680dde2b62ac0daad9fff6b056195a30594a')
build() {
cd "$_pkgname-v$_pkgver"
npm install --cache "${srcdir}/npm-cache"
}
package() {
cd "$_pkgname-v$_pkgver"
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
install -Dm644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}/"
cp -r "dist/v${_pkgver}-"*/ "${pkgdir}/usr/share/${pkgname}"
cd "${pkgdir}/usr/share/${pkgname}"
rm browser.*.LICENSE.txt
local _licenses=(*.LICENSE.txt)
install -Dm644 "${_licenses[@]}" -t "${pkgdir}/usr/share/licenses/${pkgname}/"
rm "${_licenses[@]}"
install -dm755 "${pkgdir}/usr/bin/"
install -Dm755 /dev/stdin "${pkgdir}/usr/share/${pkgname}/langserver.cjs" <<"EOF"
#!/usr/bin/node
require('./server.bundle.js');
EOF
ln -s "/usr/share/${pkgname}/langserver.cjs" "${pkgdir}/usr/bin/${pkgname}"
}
pkgver() {
cd "$_pkgname-v$_pkgver"
jq '
def v: split(".") | map(tonumber);
.version | v as $pkgver |
(if $pkgver[-1] >= 100 then
[$ARGS.positional[0] | v | last, "r" + ($pkgver[-1] | tostring)]
else
[$pkgver[-1]]
end) as $patch |
$pkgver[0:-1] + $patch | join(".")
' package.json --args ${pkgver%.r*}
}
|