summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlynx Zhou2019-10-28 10:01:20 +0800
committerAlynx Zhou2019-10-28 10:01:20 +0800
commit331d669af2b81397ed1996bc1c038a071a462949 (patch)
tree73f48f0ab944308e2400c7d8a162463f6be65b58
parent7ad7d8a998262b28b8141ebaa1317157ae509838 (diff)
downloadaur-331d669af2b81397ed1996bc1c038a071a462949.tar.gz
Updated comments.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD18
2 files changed, 14 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index a65ba9656ce5..64f48c6196f8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = hikarujs
pkgdesc = A static site generator that generates routes based on directories naturally.
pkgver = 1.0.11
- pkgrel = 5
+ pkgrel = 6
url = https://hikaru.alynx.moe/
arch = any
license = Apache
diff --git a/PKGBUILD b/PKGBUILD
index 28f00e514561..d5c2cb8ac656 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=hikarujs
pkgver=1.0.11
-pkgrel=5
+pkgrel=6
pkgdesc='A static site generator that generates routes based on directories naturally.'
arch=('any')
url='https://hikaru.alynx.moe/'
@@ -14,23 +14,31 @@ noextract=("${pkgname}-${pkgver}.tgz")
sha512sums=('d273887454904061112d4e28fcf9ac9a65d07ea8d54fbcaa6ec8f853e461c234ed134cb0a917133996cf6af24ee2156f65c9b026d989ba027f053b43ea6adb7f')
package() {
+ # Use `--cache="${srcdir}/.npm"` to prevent npm from generating cache in home.
+ # Use `--loglevel=error` to remove fsevents warning.
npm install \
- --user root --global \
- --prefix "${pkgdir}/usr" \
- --cache "${srcdir}/.npm" \
+ --global \
+ --user=root \
--loglevel=error \
+ --prefix="${pkgdir}/usr" \
+ --cache="${srcdir}/.npm" \
"${srcdir}/${pkgname}-${pkgver}.tgz"
+ # Remove all src dir reference in dependencies' package.json with sed.
find "${pkgdir}" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
+ # Remove src dir reference in package.json with jq.
local tmpjson="$(mktemp)"
local pkgjson="${pkgdir}/usr/lib/node_modules/${pkgname}/package.json"
jq '.|=with_entries(select(.key|test("_.+")|not))' "${pkgjson}" > "${tmpjson}"
mv "${tmpjson}" "${pkgjson}"
chmod 0644 "${pkgjson}"
- find "${pkgdir}/usr" -type d -exec chmod 0755 {} +
+ # npm sometimes gives dirs 777, fix it.
+ find "${pkgdir}" -type d -exec chmod 0755 {} +
+ # npm sets all owner to build user, which results in a lot of error which package checking.
chown -R root:root "${pkgdir}"
+ # Install LICENSE.
install -Dm0644 \
"${pkgdir}/usr/lib/node_modules/${pkgname}/LICENSE" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"