Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use prebuilt node binary in Makefile and update to 6.11.1 #82

Merged
merged 4 commits into from
Aug 15, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 25 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
OS := $(shell uname)

BUILD_DIR := $(PWD)/build
TMP := $(PWD)/.tmp
DEP := $(TMP)/deps
DESTDIR := $(BUILD_DIR)/system/$(OS)
DESTBIN := $(DESTDIR)/bin

NODE_VERSION := 4.1.0
NODE_MODULES := $(PWD)/node_modules
NODE := nodejs-$(NODE_VERSION)
NODE_BIN := $(DESTBIN)/node
NPM_BIN := $(DESTBIN)/npm
NM_BIN := $(PWD)/node_modules/.bin

NODE_HOST := https://nodejs.org/download/release
NODE_SRC := node-v$(NODE_VERSION).tar.gz
DEP := vendor

NODE_VERSION := 6.11.1
NODE := nodejs-$(NODE_VERSION)
NODE_BIN := $(DESTBIN)/node
NPM_BIN := $(DESTBIN)/npm

NPM_REGISTRY := http://npm.dev.s-cloud.net

export PATH := $(DESTBIN):$(NM_BIN):$(PATH)

.PHONY: setup build sc-vendor-libs test run publish dirs clean sc-vendor-libs
.PHONY: build sc-vendor-libs test run publish dirs clean sc-vendor-libs

setup: $(NODE_BIN)

build: $(NODE_BIN)
node_modules: $(NPM_BIN) package.json
$(NPM_BIN) install
@touch $@

build: node_modules
$(NPM_BIN) run build

test: build
Expand All @@ -44,10 +41,11 @@ publish: test
dirs:
echo $(DESTDIR)
echo $(DESTBIN)
echo $(NODE_BIN)
echo $(NPM_BIN)

clean:
rm -rf $(NODE_MODULES) $(BUILD_DIR)/* $(TMP) sdk.js
rm -rf $(NODE_MODULES) $(BUILD_DIR)/* sdk.js

vendor/audiomanager.js:
$(NPM_BIN) install @sc/audiomanager --registry=$(NPM_REGISTRY)
Expand All @@ -59,19 +57,17 @@ vendor/scaudio.js:

sc-vendor-libs: vendor/audiomanager.js vendor/scaudio.js

### nodejs
$(TMP):
mkdir -p $(TMP)

$(TMP)/$(NODE)/configure:
mkdir -p $(TMP)/${NODE}
curl -L $(NODE_HOST)/v$(NODE_VERSION)/$(NODE_SRC) | tar xzv -C $(TMP)/$(NODE) --strip-components 1

$(TMP)/$(NODE)/config.gypi: $(TMP)/$(NODE)/configure
cd $(TMP)/$(NODE); PKG_CONFIG_PATH=/usr/lib/pkgconfig/openssl.pc ./configure --prefix=$(DESTDIR)

$(NODE_BIN): $(TMP)/$(NODE)/config.gypi
PORTABLE=1 make -j4 -C $(TMP)/$(NODE) install

$(NPM_BIN): $(DESTDIR)/usr/lib/$(NODE)/bin/node
@mkdir -p $(@D)
ln -sf $(DESTDIR)/usr/lib/$(NODE)/bin/npm $@
@touch $@

$(NODE_BIN): $(DESTDIR)/usr/lib/$(NODE)/bin/node
@mkdir -p $(@D)
ln -sf $< $@
@touch $@

$(DESTDIR)/usr/lib/$(NODE)/bin/node: $(DEP)/node/$(OS)/$(NODE_VERSION).tar.gz
@mkdir -p $(@D)
tar xz -C $(DESTDIR)/usr/lib/$(NODE) --strip-components 1 -f $<
@touch $@
Binary file added vendor/node/Darwin/6.11.1.tar.gz
Binary file not shown.