aboutsummaryrefslogtreecommitdiffstats
path: root/community/nodejs-current/APKBUILD
blob: 80802f6135f23797e65fed878f2b435246d3a499 (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
88
89
90
91
92
93
94
95
96
97
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jose-Luis Rivas <ghostbar@riseup.net>
#
# secfixes:
#   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.1.0
pkgrel=0
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 python2 paxmark
	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
	"
builddir="$srcdir/node-v$pkgver"

prepare() {
	default_prepare

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

build() {
	cd "$builddir"

	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 \
		--openssl-use-def-ca-store

	# we need run mksnapshot at build time so paxmark it early.
	make -C out mksnapshot BUILDTYPE=Release
	paxmark -m out/Release/mksnapshot
	make

	# paxmark so JIT works
	paxmark -m out/Release/node
}

# 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() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install

	# It's strange, but it really needs to be paxmarked again...
	paxmark -m "$pkgdir"/usr/bin/node

	# Remove npm, it's provided by main/nodejs package.
	rm -r "$pkgdir"/usr/lib/node_modules
	rm "$pkgdir"/usr/bin/npm "$pkgdir"/usr/bin/npx
}

sha512sums="4d012d4638682ef1c7eac55913b0f997e163c47b0ee57f6364bac9f03772792279c4915545f5a78e75a42e8cd1006133c0eb318bbfe375f71bd4ca19a314dd77  node-v13.1.0.tar.gz
940cc90aaa77a531cde13e31918a9978f9478936c3851038bcdf2869e64de03ce84dec5a46519469a90a8ba2853226825452d23d9347752abdbe04e944c083eb  dont-run-gyp-files-for-bundled-deps.patch
9f60928b53447f9590c7065bcdbdd4065d10a06e8451531615791a3bd7d14f9114807e5446e0ec00e2cb7a11a277050345e34636b199db2979d7f022b31ffde4  link-with-libatomic-on-mips32.patch"