aports/main/nodejs/APKBUILD
Leo 3bd8b464a1 main/nodejs: add npm subpackage
83248509e4 (main/nodejs: upgrade to 12.13.0, 2019-10-28) by accident
deleted the npm subpackage, which is used as a dependency on other
packeges. The npm function itself was not removed.

Closes !1031
2019-11-02 17:29:49 +00:00

142 lines
3.9 KiB
Plaintext

# Contributor: Jose-Luis Rivas <ghostbar@riseup.net>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Dave Esaias <dave@containership.io>
# Contributor: Tadahisa Kamijo <kamijin@live.jp>
# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
#
# secfixes:
# 10.16.3-r0:
# - CVE-2019-9511
# - CVE-2019-9512
# - CVE-2019-9513
# - CVE-2019-9514
# - CVE-2019-9515
# - CVE-2019-9516
# - CVE-2019-9517
# - CVE-2019-9518
# 10.15.3-r0:
# - CVE-2019-5737
# 10.14.0-r0:
# - CVE-2018-12121
# - CVE-2018-12122
# - CVE-2018-12123
# - CVE-2018-0735
# - CVE-2018-0734
# 8.11.4-r0:
# - CVE-2018-12115
# 8.11.3-r0:
# - CVE-2018-7167
# - CVE-2018-7161
# - CVE-2018-1000168
# 8.11.0-r0:
# - CVE-2018-7158
# - CVE-2018-7159
# - CVE-2018-7160
# 8.9.3-r0:
# - CVE-2017-15896
# - CVE-2017-15897
# 6.11.5-r0:
# - CVE-2017-14919
# 6.11.1-r0:
# - CVE-2017-1000381
#
pkgname=nodejs
# Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)!
# Odd-numbered versions are supported only for 9 months by upstream.
pkgver=12.13.0
pkgrel=1
pkgdesc="JavaScript runtime built on V8 engine - LTS 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 npm::noarch"
provides="nodejs-lts=$pkgver" # for backward compatibility
replaces="nodejs-current 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
cp -pr "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share
local d; for d in doc html man; do
rm -r "$pkgdir"/usr/lib/node_modules/npm/$d
done
}
dev() {
provides="nodejs-lts-dev=$pkgver" # for backward compatibility
default_dev
}
npm() {
pkgdesc="A package manager for JavaScript"
depends="$pkgname"
# for backward compatibility
provides="nodejs-npm=$pkgver-r$pkgrel nodejs-current-npm=$pkgver-r$pkgrel"
replaces="nodejs-npm nodejs-current-npm $pkgname"
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/np[mx] "$subpkgdir"/usr/bin/
mkdir -p "$subpkgdir"/usr/lib/node_modules
mv "$pkgdir"/usr/lib/node_modules/npm "$subpkgdir"/usr/lib/node_modules/
}
sha512sums="0c1b8f9163ee5cb274666814eff1e2acc0ec286b5383a1e879fa8e587751a8fd11e891730dd099c1702b00c624bd172a683be7ceec3cc38981559dd19462d9c5 node-v12.13.0.tar.gz
3c536776e2ecb5dc677bf711a09418085b3c5e931a6eaf647f47c28e194d5c6dec354d4e7a039a5805b30fc7e83140594851e18d9120f523eec2f93539eac4db dont-run-gyp-files-for-bundled-deps.patch
9f60928b53447f9590c7065bcdbdd4065d10a06e8451531615791a3bd7d14f9114807e5446e0ec00e2cb7a11a277050345e34636b199db2979d7f022b31ffde4 link-with-libatomic-on-mips32.patch"