# Maintainer: Jose-Luis Rivas pkgname=nodejs pkgver=6.2.2 pkgrel=0 pkgdesc='Evented I/O for V8 javascript' url='http://nodejs.org/' arch='all' license='MIT' # gold is needed for mksnapshot makedepends="$depends_dev python openssl-dev zlib-dev libuv-dev linux-headers paxmark binutils-gold" subpackages="$pkgname-dev $pkgname-doc" replaces="nodejs-lts" source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz" _builddir="$srcdir"/node-v$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done } build() { cd "$_builddir" ./configure --prefix=/usr \ --shared-zlib \ --shared-libuv \ --shared-openssl \ || 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() { local d 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 for d in doc html man; do rm -r "$pkgdir"/usr/lib/node_modules/npm/$d || return 1 done } md5sums="1120e8bf191fdaee42206d031935210d node-v6.2.2.tar.gz" sha256sums="b6baee57a0ede496c7c7765001f7495ad74c8dfe8c34f1a6fb2cd5d8d526ffce node-v6.2.2.tar.gz" sha512sums="65c5579aef66884609a18f87608736379af4522075807f6d7fb74487b01fdfd30b697c237fe50f15bb883ca8b376fdacab2e216963c5f0c90a47427a116ba5cd node-v6.2.2.tar.gz"