desktop/nodejs/PKGBUILD
2016-04-27 00:06:16 +02:00

61 lines
1.4 KiB
Bash

pkgname=nodejs
pkgver=6.0.0
pkgrel=1
pkgdesc='Evented I/O for V8 javascript'
arch=('x86_64')
url='http://nodejs.org/'
license=('MIT')
depends=('openssl' 'zlib' 'icu')
makedepends=('python2' 'procps-ng')
optdepends=('npm: nodejs package manager')
checkdepends=('curl')
source=("http://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz")
sha256sums=('6db56d81a4e07ff4017809ad4ee49a5256fad804cd8527f8724f8e149e3dfc32')
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=system-icu \
--without-npm \
--shared-zlib \
--shared-openssl
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
}