[arch-commits] Commit in (3 files)

Daniel M. Capella polyzen at archlinux.org
Mon Feb 15 12:00:19 UTC 2021


    Date: Monday, February 15, 2021 @ 12:00:18
  Author: polyzen
Revision: 861067

Respect lockfiles, run tests, obey namcap

Modified:
  htmlhint/trunk/PKGBUILD
  stylelint-config-standard/trunk/PKGBUILD
  stylelint/trunk/PKGBUILD

------------------------------------------+
 htmlhint/trunk/PKGBUILD                  |   53 +++++++++++++++++++++++------
 stylelint-config-standard/trunk/PKGBUILD |   43 ++++++++++++++++-------
 stylelint/trunk/PKGBUILD                 |   30 +++++++++++++---
 3 files changed, 99 insertions(+), 27 deletions(-)

Modified: htmlhint/trunk/PKGBUILD
===================================================================
--- htmlhint/trunk/PKGBUILD	2021-02-15 11:58:02 UTC (rev 861066)
+++ htmlhint/trunk/PKGBUILD	2021-02-15 12:00:18 UTC (rev 861067)
@@ -1,25 +1,58 @@
 # Maintainer: Daniel M. Capella <polyzen at archlinux.org>
 
+_name=HTMLHint
 pkgname=htmlhint
 pkgver=0.14.2
-pkgrel=1
+pkgrel=2
 pkgdesc='Static Code Analysis Tool for your HTML'
 arch=('any')
 url=https://htmlhint.com/
 license=('MIT')
 depends=('nodejs')
-makedepends=('npm')
-source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
-noextract=("$pkgname-$pkgver.tgz")
-sha512sums=('9540a019567fa320a4a600e421ae487c29705fc3e9cb5d4393b5dd7956e80064a62a322e38ac7acb2f3a592d16d3c285b4246ec5fb73372f8a7508cce148ea08')
+makedepends=('git' 'jq' 'npm')
+source=("git+https://github.com/htmlhint/HTMLHint.git#tag=v$pkgver")
+b2sums=('SKIP')
 
+build() {
+  cd $_name
+  npm ci
+  npm run build
+  npm pack
+}
+
+check() {
+  cd $_name
+  npm test
+}
+
 package() {
-  npm install -g --user root --prefix "$pkgdir"/usr --ignore-scripts --production $pkgname-$pkgver.tgz
+  cd $_name
+  npm install --global \
+              --user root \
+              --prefix "$pkgdir"/usr \
+              --production \
+              $pkgname-$pkgver.tgz
+  chown -R root:root "$pkgdir"
+  cp -r dist "$pkgdir"/usr/lib/node_modules/$pkgname
+  install -d "$pkgdir"/usr/share/licenses/$pkgname
+  ln -s /usr/lib/node_modules/$pkgname/LICENSE.md \
+    "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
 
-  cd "$pkgdir"
-  mkdir -p usr/share/licenses/$pkgname
-  mv usr/lib/node_modules/$pkgname/LICENSE.md usr/share/licenses/$pkgname
-  chown -R root:root .
+  # Remove references to $srcdir and $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
 }
 
 # vim:set ts=2 sw=2 et:

Modified: stylelint/trunk/PKGBUILD
===================================================================
--- stylelint/trunk/PKGBUILD	2021-02-15 11:58:02 UTC (rev 861066)
+++ stylelint/trunk/PKGBUILD	2021-02-15 12:00:18 UTC (rev 861067)
@@ -2,19 +2,30 @@
 
 pkgname=stylelint
 pkgver=13.10.0
-pkgrel=1
+pkgrel=2
 pkgdesc='Mighty, modern CSS linter'
 arch=('any')
 url=https://stylelint.io
 license=('MIT')
 depends=('nodejs')
-makedepends=('npm')
+makedepends=('git' 'jq' 'npm')
 optdepends=('stylelint-config-standard: for the standard shareable config')
-source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
-noextract=("$pkgname-$pkgver.tgz")
-b2sums=('6cc6fb1619b3c591bdcc95240959bbe536bc5f050cac5301cf08a2a1cc831c92a6c55c5e053a034ae603a3a43b593b01d0d37a93ada0cb7c13a86b58395c1166')
+source=("git+https://github.com/stylelint/stylelint.git#tag=$pkgver")
+b2sums=('SKIP')
 
+build() {
+  cd $pkgname
+  npm ci
+  npm pack
+}
+
+check() {
+  cd $pkgname
+  npm test
+}
+
 package() {
+  cd $pkgname
   npm install --global \
               --user root \
               --prefix "$pkgdir"/usr \
@@ -24,6 +35,15 @@
   install -d "$pkgdir"/usr/share/licenses/$pkgname
   ln -s /usr/lib/node_modules/$pkgname/LICENSE \
     "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+
+  # Remove references to $srcdir and $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"
 }
 
 # vim:set ts=2 sw=2 et:

Modified: stylelint-config-standard/trunk/PKGBUILD
===================================================================
--- stylelint-config-standard/trunk/PKGBUILD	2021-02-15 11:58:02 UTC (rev 861066)
+++ stylelint-config-standard/trunk/PKGBUILD	2021-02-15 12:00:18 UTC (rev 861067)
@@ -2,25 +2,44 @@
 
 pkgname=stylelint-config-standard
 pkgver=20.0.0
-pkgrel=3
+pkgrel=4
 pkgdesc='Standard shareable config for stylelint'
 arch=('any')
 url=https://github.com/stylelint/stylelint-config-standard
 license=('MIT')
-depends=('nodejs' 'stylelint')
-makedepends=('npm')
-source=("https://registry.npmjs.org/$pkgname/-/$pkgname-$pkgver.tgz")
-noextract=("$pkgname-$pkgver.tgz")
-sha512sums=('201da215dcce4c0ff34b88d255abfacfec06b629f4f2a7e3f98c84c470772c5f659e8b9086dfff632074299abd806cf91cd3e475d1cecdc63c1ec51ecba65494')
+depends=('stylelint')
+makedepends=('git' 'jq' 'npm')
+source=("git+$url.git")
+b2sums=('SKIP')
 
+build() {
+  cd $pkgname
+  npm ci
+  npm pack
+}
+
+check() {
+  cd $pkgname
+  npm test
+}
+
 package() {
-  npm install -g --user root --prefix "$pkgdir"/usr --ignore-scripts --production $pkgname-$pkgver.tgz
+  cd $pkgname
+  npm install --global \
+              --user root \
+              --prefix "$pkgdir"/usr \
+              --production \
+              $pkgname-$pkgver.tgz
+  chown -R root:root "$pkgdir"
 
-  cd "$pkgdir"
-  # License not yet added to repo
-  #mkdir -p usr/share/licenses/$pkgname
-  #mv usr/lib/node_modules/$pkgname/LICENSE usr/share/licenses/$pkgname
-  chown -R root:root .
+  # Remove references to $srcdir and $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"
 }
 
 # vim:set ts=2 sw=2 et:



More information about the arch-commits mailing list