desktop/nodejs/PKGBUILD
2018-09-30 20:37:21 +02:00

59 lines
1.3 KiB
Bash

pkgname=nodejs
pkgver=10.11.0
pkgrel=1
pkgdesc='Evented I/O for V8 javascript'
arch=('x86_64')
url='http://nodejs.org/'
license=('MIT')
makedepends=('python2' 'procps-ng')
optdepends=('npm: nodejs package manager')
checkdepends=('curl')
source=("http://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz")
sha256sums=('f721552552fb11ef99aba290fc6e696a8647adc98d643db6651e81ed07c4037e')
prepare() {
cd node-v$pkgver
msg 'Fixing for python2 name'
find -type f -exec sed \
-e 's_^#!/usr/bin/env python$_&2_' \
-e 's_^\(#!/usr/bin/python2\).[45]$_\1_' \
-e 's_^#!/usr/bin/python$_&2_' \
-e 's_^\( *exec \+\)python\( \+.*\)$_\1python2\2_'\
-e 's_^\(.*\)python\( \+-c \+.*\)$_\1python2\2_'\
-e "s_'python'_'python2'_" -i {} \;
find test/ -type f -exec sed 's_python _python2 _' -i {} \;
}
build() {
cd node-v$pkgver
export PYTHON=python2
./configure \
--prefix=/usr \
--with-intl=full-icu \
--download=all \
--without-npm
make
}
check() {
cd node-v$pkgver
make test || warning "Tests failed"
}
package() {
cd node-v$pkgver
make DESTDIR="$pkgdir" install
# install docs as per user request
install -d "$pkgdir"/usr/share/doc/nodejs
cp -r doc/api/{*.html,assets} \
"$pkgdir"/usr/share/doc/nodejs
install -D -m644 LICENSE \
"$pkgdir"/usr/share/licenses/nodejs/LICENSE
}