[arch-commits] Commit in python-jsbeautifier/trunk (PKGBUILD)

Daniel M. Capella polyzen at archlinux.org
Tue May 19 18:15:33 UTC 2020


    Date: Tuesday, May 19, 2020 @ 18:15:33
  Author: polyzen
Revision: 630012

upgpkg: python-jsbeautifier 1.11.0-2 Add cssbeautifier splitpkg

Modified:
  python-jsbeautifier/trunk/PKGBUILD

----------+
 PKGBUILD |   41 +++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-05-19 18:14:41 UTC (rev 630011)
+++ PKGBUILD	2020-05-19 18:15:33 UTC (rev 630012)
@@ -1,30 +1,47 @@
 # Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Maintainer: Daniel M. Capella <polyzen at archlinux.org>
 
-pkgname=python-jsbeautifier
+pkgname=('python-jsbeautifier' 'python-cssbeautifier')
+pkgbase=python-jsbeautifier
 pkgver=1.11.0
-pkgrel=1
-pkgdesc='JavaScript unobfuscator and beautifier'
+pkgrel=2
 arch=('any')
 license=('MIT')
 url='https://github.com/beautify-web/js-beautify'
-depends=('python-six' 'python-editorconfig')
-makedepends=('python-setuptools')
-checkdepends=('python-pytest')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/beautify-web/js-beautify/archive/v$pkgver.tar.gz")
+depends=('python-setuptools' 'python-six' 'python-editorconfig')
+source=("https://github.com/beautify-web/js-beautify/archive/v$pkgver/js-beautify-v$pkgver.tar.gz")
 sha512sums=('1bcf0da38a9f465f4afebd981800b19e2650e0d7cb48dbf6a6d801da449e5e25b57244a6b57654d6760d9287496f8a1d23f27ab3e52e66b27a69ce6750989a73')
 
+prepare() {
+  cd js-beautify-$pkgver
+  cp -a python python-css
+}
+
 build() {
   cd js-beautify-$pkgver/python
   python setup.py build
+  cd ../python-css
+  python setup-css.py build
 }
 
 check() {
-  cd js-beautify-$pkgver/python
-  python setup.py test
+  cd js-beautify-$pkgver
+  # Use python-css to avoid rebuilding cssbeautifier
+  python python-css/js-beautify-test.py
 }
 
-package() {
+package_python-jsbeautifier() {
+  pkgdesc='JavaScript unobfuscator and beautifier'
   cd js-beautify-$pkgver/python
-  python setup.py install --root="$pkgdir" --optimize=1
-  install -D -m644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
+  install -D -m644 -t "$pkgdir"/usr/share/licenses/"${pkgname[0]}" ../LICENSE
 }
+
+package_python-cssbeautifier() {
+  pkgdesc='CSS unobfuscator and beautifier'
+  depends+=('python-jsbeautifier')
+  cd js-beautify-$pkgver/python-css
+  python setup-css.py install --root="$pkgdir" --optimize=1 --skip-build
+  rm -r "$pkgdir"/usr/{bin/js-beautify,lib/python3.8/site-packages/jsbeautifier{,-$pkgver-py3.8.egg-info}}
+  install -D -m644 -t "$pkgdir"/usr/share/licenses/"${pkgname[1]}" ../LICENSE
+}


More information about the arch-commits mailing list