blob: c5ebae576276389092efd4d5576c263f1e88f5e5 (
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
62
|
# shellcheck disable=SC2034,2154
# Maintainer: Bruno Carlin <bruno@bcarlin.net>
pkgname=ember-language-server
pkgver=2.30.5
pkgrel=3
pkgdesc="The Ember Language Server (ELS) implements the Language Server Protocol for Ember.js projects."
arch=( 'any' )
url="https://github.com/ember-tooling/ember-language-server"
license=('MIT')
depends=('nodejs')
makedepends=('npm' 'jq')
#checkdepends=()
#optdepends=()
#provides=()
#conflicts=()
#replaces=()
#backup=()
#options=()
#install=
#changelog=
source=("https://registry.npmjs.com/@ember-tooling/${pkgname}/-/${pkgname}-${pkgver}.tgz")
sha256sums=('a48194589ff1f03b8fa2c9859f7481b2b678fff9d8ce40f0588efdd6c31cb5c1')
noextract=("${pkgname}-${pkgver}.tgz")
#validpgpkeys=()
#prepare() {
# cd "$pkgname-$pkgver"
# patch -p1 -i "$srcdir/$pkgname-$pkgver.patch"
#}
#
#build() {
# cd "$pkgname-$pkgver"
# ./configure --prefix=/usr
# make
#}
#
#check() {
# cd "$pkgname-$pkgver"
# make -k check
#}
package() {
npm install -g \
--prefix "${pkgdir}/usr" \
--cache "${srcdir}/npm-cache" \
"${srcdir}/${pkgname}-${pkgver}.tgz"
# npm gives ownership of ALL FILES to build user
# https://bugs.archlinux.org/task/63396
chown -R root:root "${pkgdir}"
# Remove references to $pkgdir
find "$pkgdir" -type f -name package.json -print0 | xargs -0 sed -i "/_where/d"
# Remove references to $srcdir
local tmppackage pkgjson
tmppackage="$(mktemp)"
pkgjson="$pkgdir/usr/lib/node_modules/@ember-tooling/$pkgname/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
}
|