# Tanım: Node.js®, Chrome'un V8 JavaScript motorunda inşa edilmiş bir JavaScript çalışma zamanıdır.
# URL: http://nodejs.org/
# Paketçi: milisarge
# Gerekler: python libuv icu http-parser c-ares libnghttp2
# Grup: geliştirme

isim=node
surum=9.11.2
devir=1

kaynak=(http://nodejs.org/dist/v$surum/node-v$surum.tar.xz
		node.npm.sh)
		
derle() {
	
	cd node-v$surum
	
	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 {} \;
	
	export PYTHON=python2
  ./configure \
    --prefix=/usr \
    --with-intl=system-icu \
    --shared-openssl \
    --shared-zlib \
    --shared-libuv \
    --shared-http-parser \
    --shared-cares \
    --shared-nghttp2
	
	make
	make DESTDIR=$PKG install
	ln -s ../lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js $PKG/usr/bin/node-gyp
	install -D -m 644 $SRC/node.npm.sh $PKG/usr/share/bash-completion/completions/npm
}
