mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-01-24 02:22:13 +08:00
59 lines
1.3 KiB
Bash
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
|
|
}
|