blob: a20a473f8f745830cb71e12cf42f8dffb982ee59 (
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
|
# Maintainer: Thomas Quillan <tjquillan@gmail.com>
pkgname=devcontainer-cli
_npm_namespace="@devcontainers"
_npm_name="cli"
pkgver=0.67.0
pkgrel=1
pkgdesc="Dev container CLI, which can take a devcontainer.json and create and configure a dev container from it."
arch=("any")
url="https://github.com/devcontainers/cli"
license=("MIT")
depends=("nodejs")
makedepends=("npm" "jq")
optdepends=()
source=("https://registry.npmjs.org/${_npm_namespace}/${_npm_name}/-/${_npm_name}-${pkgver}.tgz")
sha256sums=('b789259911754b7c86458c8ed3404023bd32f56b6c307d21473b11dde4511fad')
noextract=("${_npm_name}-${pkgver}.tgz")
package() {
npm install -g --cache "${srcdir}/npm-cache" --prefix "${pkgdir}/usr" "${srcdir}/${_npm_name}-${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="$(mktemp)"
local pkgjson="${pkgdir}/usr/lib/node_modules/${_npm_namespace}/${_npm_name}/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "${pkgjson}" > "${tmppackage}"
mv "${tmppackage}" "${pkgjson}"
chmod 644 "${pkgjson}"
}
|