name='yarn'
version='1.22.22' release='1'
This commit is contained in:
parent
06266d7191
commit
50bf22bc2d
48
yarn/alr.sh
Normal file
48
yarn/alr.sh
Normal file
@ -0,0 +1,48 @@
|
||||
name='yarn'
|
||||
version='1.22.22'
|
||||
release='1'
|
||||
desc='Fast, reliable, and secure dependency management.'
|
||||
homepage='https://classic.yarnpkg.com/'
|
||||
maintainer="Евгений Храмов <xpamych@yandex.ru>"
|
||||
architectures=('all')
|
||||
license=('BSD-2-Clause')
|
||||
provides=('revolt-desktop')
|
||||
conflicts=('revolt-desktop' 'revolt-desktop-git')
|
||||
|
||||
deps=('nodejs')
|
||||
build_deps=('git'
|
||||
'jq'
|
||||
'ripgrep'
|
||||
'yarnpkg')
|
||||
|
||||
sources=("git+https://github.com/${name}pkg/$name.git#tag=v$version")
|
||||
checksums=('SKIP')
|
||||
|
||||
build() {
|
||||
cd $srcdir/$name
|
||||
yarn --frozen-lockfile
|
||||
yarn build
|
||||
}
|
||||
|
||||
package() {
|
||||
local mod_dir=/usr/lib/node_modules/$name
|
||||
install -d "$pkgdir"/{usr/bin,$mod_dir/bin}
|
||||
ln -s $mod_dir/bin/$name.js "$pkgdir"/usr/bin/$name
|
||||
ln -s $mod_dir/bin/$name.js "$pkgdir"/usr/bin/${name}pkg
|
||||
|
||||
cd $name
|
||||
# Prune unnecessary packages
|
||||
cp package.json{,.bak}
|
||||
read -ra devDependencies < <(jq -r '.devDependencies | keys | join(" ")' package.json)
|
||||
yarn remove --frozen-lockfile "${devDependencies[@]}"
|
||||
mv package.json{.bak,}
|
||||
|
||||
# Import userland punycode
|
||||
readarray -t punycode_importers < <(rg -t js -l "require\('punycode'\)" node_modules)
|
||||
sed -i "s,require('punycode'),require('punycode/')," "${punycode_importers[@]}"
|
||||
|
||||
cp -r lib node_modules package.json "$pkgdir"/$mod_dir
|
||||
install -t "$pkgdir"/$mod_dir/bin bin/$name.js
|
||||
install -Dm644 -t "$pkgdir"/usr/share/doc/$name README.md
|
||||
install -Dm644 -t "$pkgdir"/usr/share/licenses/$name LICENSE
|
||||
}
|
Loading…
Reference in New Issue
Block a user