summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authortjquillan2022-06-09 20:15:06 -0700
committertjquillan2022-06-09 20:15:06 -0700
commit30432e1e4ffba9ff7aeace817776d108ba92d73d (patch)
tree50b7025142db478e07fcbefe46be890b839500f5
downloadaur-30432e1e4ffba9ff7aeace817776d108ba92d73d.tar.gz
updpkg: 0.5.1-1
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD35
2 files changed, 50 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..4e83607bd7bd
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = devcontainer-cli
+ pkgdesc = Dev container CLI, which can take a devcontainer.json and create and configure a dev container from it.
+ pkgver = 0.5.1
+ pkgrel = 1
+ url = https://github.com/devcontainers/cli
+ arch = any
+ license = MIT
+ makedepends = npm
+ makedepends = jq
+ depends = nodejs
+ noextract = cli-0.5.1.tgz
+ source = https://registry.npmjs.org/@devcontainers/cli/-/cli-0.5.1.tgz
+ sha256sums = 2e89f0790c727e0055fe1c5a8a4d9b2be1a2b895a5be33400151426d8e50b556
+
+pkgname = devcontainer-cli
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e0f3f0f62af8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: Thomas Quillan <tjquillan@gmail.com>
+
+pkgname=devcontainer-cli
+_npm_namespace="@devcontainers"
+_npm_name="cli"
+pkgver=0.5.1
+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=('2e89f0790c727e0055fe1c5a8a4d9b2be1a2b895a5be33400151426d8e50b556')
+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}"
+}