### this file is sourced not run
PKGVER=9.11.2
PKGBUILD=1
PKGARCH=x86_64

# source: james updated to post BLFS 8.3 2018-10-14
TARBALL=node-v${PKGVER}.tar.gz
MD5SUM=3fb57c9a1b5a3734ce014b4efbc1a502
SRC_URL=https://nodejs.org/dist/v${PKGVER}/$TARBALL
BUNDLE=

SLACKREQ='openssl' # 
SLACKDESC="nodejs: nodejs $PKGVER (Javascript application server)
nodejs: 
nodejs: Node.js is a platform built on Chrome's JavaScript runtime for 
nodejs: easily building fast, scalable network applications. Node.js uses an 
nodejs: event-driven, non-blocking I/O model that makes it lightweight and 
nodejs: efficient, perfect for data-intensive real-time applications that run 
nodejs: across distributed devices.
nodejs: 
nodejs: https://nodejs.org/
nodejs: 
nodejs:
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	mkdir -p /opt &&

	cd /tmp/node* &&
	export ICU_DATA=/usr/share/icu/current/ && # so ICU knows where its data is
	./configure --prefix=/opt/node-$PKGVER \
		--shared-cares \
		--shared-zlib \
		--shared-openssl \
		--with-intl=system-icu &&

	make $MAKEFLAGS &&
	make install &&

	ln -s /opt/node-$PKGVER /opt/node &&
		
	mkdir -p /etc/profile.d &&
	echo 'PATH=$PATH:/opt/node/bin' > /etc/profile.d/nodejs.sh &&
	chmod +x /etc/profile.d/nodejs.sh &&

	pkg_build_slackdesc
}
