blob: 13ddf6e390468cdea7c7d3f0a402130197f19457 (
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
|
# Maintainer: George Rawlinson <george@rawlinson.net.nz>
# Maintainer: Bret Comnes <bcomnes@gmail.com>
pkgname=homebridge
pkgver=1.8.3
pkgrel=1
pkgdesc='HomeKit support for the impatient'
arch=('any')
url='https://github.com/homebridge/homebridge'
license=('Apache')
depends=('nodejs')
makedepends=('npm' 'jq')
optdepends=('homebridge-config-ui-x: for web-based management tool')
options=('!emptydirs' '!strip')
source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
noextract=("$pkgname-$pkgver.tgz")
sha512sums=('dacf01495e7ac5ffa318382e2aa7e92b429dd78722581cd7f98a4dde25d6ec1605f485739786a2fd7ba8c9e1b48ccc9607e18deca8227e402cd08602024bbf04')
b2sums=('e15aeeae99f63ee8cb9e22502da5449a03cf232b02120c4d2696b65cdcd111bbf350d4ab3f32b18d1e6d1e7227f6d664c23e82fb60663151a01feb93a7c81933')
package() {
npm install \
--global \
--cache "${srcdir}/npm-cache" \
--prefix "$pkgdir/usr" \
--no-audit --no-fund --no-update-notifier \
"$srcdir/$pkgname-$pkgver.tgz"
# Clean up srcdir references
# https://wiki.archlinux.org/title/Node.js_package_guidelines#Package_contains_reference_to_$srcdir/$pkgdir
find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
local tmppackage="$(mktemp)"
local pkgjson="$pkgdir/usr/lib/node_modules/$pkgname/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
find "$pkgdir" -type f -name package.json | while read pkgjson; do
local tmppackage="$(mktemp)"
jq 'del(.man)' "$pkgjson" > "$tmppackage"
mv "$tmppackage" "$pkgjson"
chmod 644 "$pkgjson"
done
}
|