1 # Maintainer: Daniel M. Capella <polyzen@archlinux.org>
2 # Contributor: hexchain <i at hexchain dot org>
4 pkgname=yaml-language-server
7 pkgdesc='YAML Language Server'
8 url=https://github.com/redhat-developer/yaml-language-server
12 makedepends=('jq' 'yarn')
13 options=('!emptydirs')
14 source=("$url/archive/$pkgver/$pkgname-$pkgver.tar.gz"
15 'yamlls-pr-863.patch::https://github.com/redhat-developer/yaml-language-server/pull/863.patch')
16 b2sums=('40f6dd646c88589a48a132557dcfe5b18bd9c70724fc3cfd6acdfc4cc61174cb2165c90435d48f4ac70844c8cdb33390de550b2a95a5d1f330e4d1283d673b7a'
17 '2e6560f569364c78ea1673267b73f49e6b1322b39ad957a57c7d4f880e0b1acf1c05b74ccef617920cac3c29a0fd7a778331f961213799918213b787b50cbfd6')
21 patch --forward --strip=1 --input=../yamlls-pr-863.patch
26 yarn --frozen-lockfile
38 # Emulate `npm prune --production`
39 cp package.json{,.bak}
40 read -ra devDependencies < <(jq -r '.devDependencies | keys | join(" ")' package.json)
41 yarn remove --frozen-lockfile "${devDependencies[@]}"
42 mv package.json{.bak,}
44 install -d "$pkgdir"/usr/{bin,lib/node_modules/$pkgname}
45 ln -s ../lib/node_modules/$pkgname/bin/$pkgname "$pkgdir"/usr/bin/$pkgname
46 cp -r bin node_modules out package.json \
47 "$pkgdir"/usr/lib/node_modules/$pkgname
48 install -Dm644 -t "$pkgdir"/usr/share/doc/$pkgname {CHANGELOG,README}.md
49 install -Dm644 -t "$pkgdir"/usr/share/licenses/$pkgname LICENSE