2022-04-03 18:55:40 +02:00

50 lines
1.4 KiB
Plaintext

# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=prettier
pkgver=2.6.2
pkgrel=0
pkgdesc="Opinionated code formatter"
url="https://prettier.io/"
license="MIT"
# riscv64: blocked by nodejs
# armhf, armv7, x86: fails to build on 32-bit arches
arch="noarch !armhf !armv7 !riscv64 !x86"
depends="nodejs"
makedepends="yarn"
checkdepends="npm"
subpackages="$pkgname-doc"
source="https://github.com/prettier/prettier/archive/$pkgver/prettier-$pkgver.tar.gz
timeout.patch
"
build() {
yarn install --frozen-lockfile
yarn build
}
check() {
yarn test:dist
}
package() {
local destdir=/usr/lib/node_modules/prettier
install -d \
"$pkgdir"/usr/bin \
"$pkgdir"/$destdir \
"$pkgdir"/usr/share/licenses/prettier
cp -r dist/* "$pkgdir"/$destdir
ln -s $destdir/bin-prettier.js "$pkgdir"/usr/bin/prettier
cd "$pkgdir"/$destdir
rm -r esm # remove ES modules: not needed for command-line usage
rm README.md # more links to various badges than actual content
mv LICENSE "$pkgdir"/usr/share/licenses/prettier/LICENSE
}
sha512sums="
a4a874392b7f6e587b77e183f6242f0089634bff7e86b3a5c133dc049e79686a1a3e4e6d632f382b03e563b6693f840db86c49e2996c9650addbe4d06882c935 prettier-2.6.2.tar.gz
06968fc076d2cd68360601c84c49b82a1f872a1b54d5ec9738de7ac63793f96cd609817bbb0a0f1902b7ba004232d1276b3577557dc60dd2a7d71fad5e440099 timeout.patch
"