69 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			Bash
		
	
	
	
	
	
| name='yarn'
 | |
| version='1.22.22'
 | |
| release='6'
 | |
| desc='Fast, reliable, and secure dependency management'
 | |
| desc_ru='Быстрое, надёжное и безопасное управление зависимостями'
 | |
| homepage='https://classic.yarnpkg.com/'
 | |
| maintainer='Evgeny Khramov <xpamych@yandex.ru>'
 | |
| maintainer_ru='Евгений Храмов <xpamych@yandex.ru>'
 | |
| architectures=('all')
 | |
| license=('BSD-2-Clause')
 | |
| provides=('yarn')
 | |
| conflicts=('yarn' 'yarn-git' 'yarnpkg')
 | |
| 
 | |
| deps=('nodejs')
 | |
| deps_alt=("${deps[@]}")
 | |
| deps_arch=("${deps[@]}")
 | |
| deps_debian=("${deps[@]}")
 | |
| deps_fedora=("${deps[@]}")
 | |
| deps_redos=("${deps[@]}")
 | |
| deps_rhel=("${deps[@]}")
 | |
| deps_rosa=("${deps[@]}")
 | |
| deps_alpine=("${deps[@]}")
 | |
| 
 | |
| build_deps=('git' 'jq' 'ripgrep' 'yarnpkg')
 | |
| build_deps_alt=("${build_deps[@]}")
 | |
| build_deps_arch=("${build_deps[@]}")
 | |
| build_deps_debian=("${build_deps[@]}")
 | |
| build_deps_fedora=("${build_deps[@]}")
 | |
| build_deps_redos=("${build_deps[@]}")
 | |
| build_deps_rhel=("${build_deps[@]}")
 | |
| build_deps_rosa=("${build_deps[@]}")
 | |
| build_deps_alpine=("${build_deps[@]}")
 | |
| 
 | |
| sources=("git+https://github.com/${name}pkg/$name.git#tag=v$version")
 | |
| checksums=('SKIP')
 | |
| 
 | |
| build() {
 | |
|   cd $srcdir/$name
 | |
|   yarn --frozen-lockfile
 | |
|   yarn build
 | |
| }
 | |
| 
 | |
| package() {
 | |
|   install -d  "$pkgdir"/{usr/bin,/usr/lib/node_modules/$name/bin}
 | |
|   ln -s /usr/lib/node_modules/$name/bin/$name.js "$pkgdir"/usr/bin/$name
 | |
|   ln -s /usr/lib/node_modules/$name/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"/usr/lib/node_modules/$name
 | |
|   install -t "$pkgdir"/usr/lib/node_modules/$name/bin bin/$name.js
 | |
|   install -Dm644 -t "$pkgdir"/usr/share/doc/$name README.md
 | |
|   install -Dm644 -t "$pkgdir"/usr/share/licenses/$name LICENSE
 | |
| }
 | |
| files() {
 | |
|     files-find-bin
 | |
|     files-find-lib
 | |
|     files-find-share
 | |
| }
 |