aboutsummaryrefslogtreecommitdiffstats
path: root/community/yarn/APKBUILD
blob: 1616127b5fa56702d78067e2f6b0876517a337d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Contributor: Ed Robinson <ed@reevoo.com>
# Maintainer: Ed Robinson <ed@reevoo.com>
pkgname=yarn
pkgver=0.22.0
pkgrel=0
pkgdesc="Fast, reliable, and secure dependency management for Node.js"
url="https://yarnpkg.com/"
arch="noarch"
license="BSD-2"
depends="nodejs"
options="!check"
source="https://yarnpkg.com/downloads/$pkgver/$pkgname-v$pkgver.tar.gz
	apk-install-method.patch
	remove-support-for-legacy-nodejs.patch"
builddir="$srcdir/dist"

prepare() {
	default_prepare || return 1

	cd "$builddir"

	# These tests runs only on Ubuntu, so delete them.
	rm -r end_to_end_tests

	# Remove support for legacy nodejs.
	rm -r lib-legacy

	# Remove some unneeded files.
	# Node does not load *.min.js files, so these are useless for us.
	# We respect licenses, but really don't wanna waste disk space (~1 MiB)
	# with dozens copies of the same files.
	rm yarn.lock
	find . \( -iname '*.md' \
		-o -iname '*.md~' \
		-o -iname '*.cmd' \
		-o -name '*.min.js' \
		-o -name '*.map' \
		-o -name 'bower.json' \
		-o -name 'Gruntfile.js' \
		-o -iname 'license*' -a ! -name '*.js' \
		-o -type f -a -name '.*' \) \
		-delete
}

package() {
	local destdir="usr/share/node_modules/$pkgname"

	mkdir -p "$pkgdir"/$destdir
	cp -R "$builddir"/* "$pkgdir"/$destdir/ || return 1

	mkdir -p "$pkgdir"/usr/bin
	ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarn
	ln -s /$destdir/bin/yarn "$pkgdir"/usr/bin/yarnpkg
}

sha512sums="56fbadf0dcd077bde75e8e3103c07a3c6d5129b9d8a3ae3b46f8e0f6b149c5e339f435af315b6c52f8415fdaadb60ae8d6be63f8c0f24409145aed21611e1d41  yarn-v0.22.0.tar.gz
30431f7aa5fe7382e062b92e413ea8d118e157d89aa043353c18ff7d1721d0e3ecfbe68de1f0058b3b70cee5cf9baa08d28f1718beb5d14fcb0cf2881dff1eac  apk-install-method.patch
b1d0f8e4bee9fb73002f7dbe7cdc5cafdb5bac53e4649bd9d98dbce9afb7950bafd392a4b8433d76aa90f931c2f92972b8ae41fe61f506690439d5959b6c09d5  remove-support-for-legacy-nodejs.patch"