diff options
author | caltlgin | 2020-11-05 08:09:55 +1300 |
---|---|---|
committer | caltlgin | 2020-11-05 08:09:55 +1300 |
commit | 6404c2738b92726aea8874705b33a742a5ac797a (patch) | |
tree | 04916b873de96f1071f624e2ee2d8d41f748b6f7 /PKGBUILD | |
download | aur-6404c2738b92726aea8874705b33a742a5ac797a.tar.gz |
Add to AUR
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..03264585aa73 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,38 @@ +# Maintainer: Caltlgin Stsodaat <contact@fossdaily.xyz> + +pkgname='fx' +pkgver=20.0.2 +pkgrel=1 +pkgdesc='Command-line tool and terminal JSON viewer' +arch=('any') +url='https://github.com/antonmedv/fx' +license=('MIT') +makedepends=('npm' 'jq') +noextract=("${pkgname}-${pkgver}.tgz") +source=("https://registry.npmjs.org/${pkgname}/-/${pkgname}-${pkgver}.tgz") +sha256sums=('7ec01246c8291cd6194587e4fe0eba92a554336ec2342a74c9eb47cf1b41179c') + +package() { + npm install -g \ + --cache "${srcdir}/npm-cache" \ + --prefix "${pkgdir}/usr" \ + --user root \ + "${srcdir}/${pkgname}-${pkgver}.tgz" + + find "${pkgdir}/usr" -type d -exec chmod 755 {} + + chown -R root:root "${pkgdir}" + + find "${pkgdir}" -name 'package.json' -print0 | xargs -r -0 sed -i '/_where/d' + + local PKG_TEMP="$(mktemp)" + local PKG_JSON="${pkgdir}/usr/lib/node_modules/${pkgname}/package.json" + jq '.|=with_entries(select(.key|test("_.+")|not))' "${PKG_JSON}" > "${PKG_TEMP}" + mv -f "${PKG_TEMP}" "${PKG_JSON}" + chmod 644 "${PKG_JSON}" + + cd "${pkgdir}/usr/lib/node_modules/${pkgname}" + install -Dvm644 'README.md' -t "${pkgdir}/usr/share/doc/${pkgname}" + install -Dvm644 'LICENSE' -t "${pkgdir}/usr/share/licenses/${pkgname}" +} + +# vim: ts=2 sw=2 et: |