aboutsummaryrefslogtreecommitdiffstats
path: root/community/nodejs-current/APKBUILD
blob: a1d0e69642c78bb229a70be90f674a3f9706ec86 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jose-Luis Rivas <ghostbar@riseup.net>
#
# secfixes:
#   13.11.0-r0:
#     - CVE-2019-15604
#     - CVE-2019-15605
#     - CVE-2019-15606
#   11.10.1-r0:
#     - CVE-2019-5737
#   11.3.0-r0:
#     - CVE-2018-12121
#     - CVE-2018-12122
#     - CVE-2018-12123
#     - CVE-2018-0735
#     - CVE-2018-0734
#   9.10.0-r0:
#     - CVE-2018-7158
#     - CVE-2018-7159
#     - CVE-2018-7160
#   9.2.1-r0:
#     - CVE-2017-15896
#     - CVE-2017-15897
#
pkgname=nodejs-current
# The current stable version, i.e. non-LTS.
pkgver=13.12.0
pkgrel=1
pkgdesc="JavaScript runtime built on V8 engine - current stable version"
url="https://nodejs.org/"
arch="all !mips64 !mips64el"
license="MIT"
depends="ca-certificates"
depends_dev="libuv"
makedepends="linux-headers python3
	zlib-dev libuv-dev openssl-dev c-ares-dev nghttp2-dev"
subpackages="$pkgname-dev $pkgname-doc"
provides="nodejs"
replaces="nodejs nodejs-lts"  # nodejs-lts for backward compatibility
source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz
	dont-run-gyp-files-for-bundled-deps.patch
	link-with-libatomic-on-mips32.patch
	elf.patch
	"
builddir="$srcdir/node-v$pkgver"

prepare() {
	default_prepare

	# Remove bundled dependencies that we're not using.
	rm -rf deps/cares deps/openssl deps/zlib
}

build() {
	case "$CARCH" in
	mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";;
	esac

	./configure --prefix=/usr \
		$_carchflags \
		--shared-zlib \
		--shared-libuv \
		--shared-openssl \
		--shared-cares \
		--shared-nghttp2 \
		--without-npm \
		--openssl-use-def-ca-store

	make
}

# TODO Run provided test suite.
check() {
	cd "$builddir"/out/Release

	./node -e 'console.log("Hello, world!")'
	./node -e "require('assert').equal(process.versions.node, '$pkgver')"
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="18aa46e797e924b5d8f0c2585f10ce1c16b9b1958ad931e3790daab2dfe5b5c59fea7f33c23b7151de23b161b6a8eba8a338b9c9c5168d498871b9b100f63cff  node-v13.12.0.tar.gz
940cc90aaa77a531cde13e31918a9978f9478936c3851038bcdf2869e64de03ce84dec5a46519469a90a8ba2853226825452d23d9347752abdbe04e944c083eb  dont-run-gyp-files-for-bundled-deps.patch
9f60928b53447f9590c7065bcdbdd4065d10a06e8451531615791a3bd7d14f9114807e5446e0ec00e2cb7a11a277050345e34636b199db2979d7f022b31ffde4  link-with-libatomic-on-mips32.patch
ace818285ff0b868f17be64db7c7b77b314ba370fda6bac640d56bf18322a54fa015206a3e1adefa1d78ef66b597eebf10c28d6549005cd7e58f60a37c38b741  elf.patch"