APKBUILD 2.96 KB
Newer Older
Jakub Jirutka's avatar
Jakub Jirutka committed
1
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
2
# Maintainer: Jose-Luis Rivas <ghostbar@riseup.net>
3 4
#
# secfixes:
5 6 7 8
#   14.4.0-r0:
#     - CVE-2020-8172
#     - CVE-2020-11080
#     - CVE-2020-8174
9 10 11 12
#   13.11.0-r0:
#     - CVE-2019-15604
#     - CVE-2019-15605
#     - CVE-2019-15606
13 14
#   11.10.1-r0:
#     - CVE-2019-5737
15 16 17 18 19 20
#   11.3.0-r0:
#     - CVE-2018-12121
#     - CVE-2018-12122
#     - CVE-2018-12123
#     - CVE-2018-0735
#     - CVE-2018-0734
21 22 23 24
#   9.10.0-r0:
#     - CVE-2018-7158
#     - CVE-2018-7159
#     - CVE-2018-7160
25 26 27 28
#   9.2.1-r0:
#     - CVE-2017-15896
#     - CVE-2017-15897
#
29 30
pkgname=nodejs-current
# The current stable version, i.e. non-LTS.
31
pkgver=14.4.0
32
pkgrel=0
33
pkgdesc="JavaScript runtime built on V8 engine - current stable version"
34
url="https://nodejs.org/"
35
arch="all !mips64 !mips64el"
36
license="MIT"
37
depends="ca-certificates"
38
depends_dev="libuv"
39 40 41 42 43 44 45 46 47 48
makedepends="
	brotli-dev
	c-ares-dev
	libuv-dev
	linux-headers
	nghttp2-dev
	openssl-dev
	python3
	zlib-dev
	"
49
subpackages="$pkgname-dev $pkgname-doc"
50
provides="nodejs"
51
replaces="nodejs nodejs-lts"  # nodejs-lts for backward compatibility
52
source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz
53 54
	dont-run-gyp-files-for-bundled-deps.patch
	link-with-libatomic-on-mips32.patch
55
	elf.patch
56
	unbundle-uv.patch
57
	"
58
builddir="$srcdir/node-v$pkgver"
59

60
prepare() {
61
	default_prepare
62

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

67
build() {
68 69 70 71
	# Add defines recommended in libuv readme.
	export CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
	export CXXFLAGS="$CXXFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"

72 73 74 75
	case "$CARCH" in
	mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";;
	esac

76
	./configure --prefix=/usr \
77
		$_carchflags \
78
		--shared-brotli \
79 80
		--shared-zlib \
		--shared-libuv \
Leonardo Arena's avatar
Leonardo Arena committed
81
		--shared-openssl \
82
		--shared-cares \
83
		--shared-nghttp2 \
84
		--without-npm \
85
		--openssl-use-def-ca-store
86

87
	make BUILDTYPE=Release
88 89 90 91 92 93 94 95
}

# 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')"
96 97 98
}

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

102
sha512sums="48f5c7eb2b7dabc5b20e77ca726ab3e079ad8533549679ed0126d0641252bc0e0f02ec9dbbcdf6cd568d190981d200bbbb1eb6f54b19fdcc953f102bd1dd9038  node-v14.4.0.tar.gz
103
940cc90aaa77a531cde13e31918a9978f9478936c3851038bcdf2869e64de03ce84dec5a46519469a90a8ba2853226825452d23d9347752abdbe04e944c083eb  dont-run-gyp-files-for-bundled-deps.patch
104
65df7eeadbdfc015185260c0e24f3206714e4d2aacceef742d078a4f8bae386b2867e0f7f3b8c2eac47180cb10a8e14b71a36a23bb74ed6a95eecbaf76897e0c  link-with-libatomic-on-mips32.patch
105
ace818285ff0b868f17be64db7c7b77b314ba370fda6bac640d56bf18322a54fa015206a3e1adefa1d78ef66b597eebf10c28d6549005cd7e58f60a37c38b741  elf.patch
106
6b06f819a026999e3a01bee09401004376e8c1fe19541a6f508557e73fbbb5b9d433cf8130a99230c7d04513715dff898f6004809e1ce7d0c01287312e468a5a  unbundle-uv.patch"