aboutsummaryrefslogtreecommitdiffstats
path: root/main/nodejs/APKBUILD
blob: 7b6f11b3aa3c2a06be34db069d711429fc34a84f (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
# Maintainer: Jose-Luis Rivas <ghostbar@riseup.net>
pkgname=nodejs
pkgver=6.7.0
pkgrel=1
pkgdesc="JavaScript runtime built on V8 engine"
url="http://nodejs.org/"
arch="all"
license="MIT"
# gold is needed for mksnapshot
makedepends="python2 openssl-dev zlib-dev libuv-dev linux-headers paxmark
	binutils-gold http-parser-dev ca-certificates"
subpackages="$pkgname-dev $pkgname-doc"
replaces="nodejs-lts"
source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz
	use-system-ca-certs.patch"
builddir="$srcdir/node-v$pkgver"

prepare() {
	default_prepare || return 1

	# Remove bundled CA certificates.
	rm -f src/node_root_certs.h
}

build() {
	cd "$builddir"

	./configure --prefix=/usr \
		--shared-zlib \
		--shared-libuv \
		--shared-openssl \
		--shared-http-parser \
		|| return 1

	# we need run mksnapshot at build time so paxmark it early
	make -C out mksnapshot BUILDTYPE=Release \
		&& paxmark -m out/Release/mksnapshot \
		&& make || return 1
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install || return 1
	# paxmark so JIT works
	paxmark -m "$pkgdir"/usr/bin/node || return 1

	cp -pr "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share || return 1
	local d; for d in doc html man; do
		rm -r "$pkgdir"/usr/lib/node_modules/npm/$d || return 1
	done
}

md5sums="a42b7ab2bcf5f8d94a432163d90f3026  node-v6.7.0.tar.gz
14ce8e0fb44d5bf75974026900e0d8c2  use-system-ca-certs.patch"
sha256sums="02b8ee1719a11b9ab22bef9279519efaaf31dd0d39cba4c3a1176ccda400b8d6  node-v6.7.0.tar.gz
fcd2becd2cb9a62537ae11f51f448fd1061aaae17835bb0f2d2aa71bdf9652c0  use-system-ca-certs.patch"
sha512sums="3cd095adc0866b780519006098b434e3b126f67a453e44863c773829de4ce29f573d13efa1c50af001009bdb433728309ef7109e144517ffc5dd5e3251b1f511  node-v6.7.0.tar.gz
c540878495761f4c38f3cccd61da75fa5619637ba9887b7946964a7cef790178e26678fe0aabe400e32c8f0f65e97a519ceee1534bbf18a1a14bc6e9fe067637  use-system-ca-certs.patch"