diff --git a/Makefile b/Makefile index 97b16cfea..f680ec803 100644 --- a/Makefile +++ b/Makefile @@ -30,14 +30,14 @@ global: build .PHONY: build build: build/Makefile - @node-gyp build $(DEBUG_FLAG) --clang -- -j$(JOBS) + @node-pre-gyp build $(DEBUG_FLAG) --clang -- -j$(JOBS) vendor/mbgl: git submodule update --init .PHONY: build/Makefile build/Makefile: $(MBGL)/config/$(HOST).gypi - @node-gyp configure --clang -- \ + @node-pre-gyp configure --clang -- \ -Dmbgl=$(MBGL) \ -Dhost=$(HOST) \ -I$(MBGL)/config/$(HOST).gypi \ diff --git a/binding.gyp b/binding.gyp index c97efcf4b..263249bc9 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,6 +1,6 @@ { 'targets': [ - { 'target_name': 'mbgl', + { 'target_name': '<(module_name)', 'dependencies': [ './<(mbgl)/mbgl.gyp:core', './<(mbgl)/mbgl.gyp:platform-<(platform_lib)', @@ -52,11 +52,11 @@ { 'target_name': 'action_after_build', 'type': 'none', - 'dependencies': [ 'mbgl' ], + 'dependencies': [ '<(module_name)' ], 'copies': [ { - 'files': [ '<(PRODUCT_DIR)/mbgl.node' ], - 'destination': 'lib' + 'files': [ '<(PRODUCT_DIR)/<(module_name).node' ], + 'destination': '<(module_path)' } ] } diff --git a/package.json b/package.json index c60a03c38..46b54b191 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,12 @@ } ], "dependencies": { - "nan": "^1.4.1" + "nan": "^1.4.1", + "node-pre-gyp": "^0.6.4" }, + "bundledDependencies": [ + "node-pre-gyp" + ], "devDependencies": { "aws-sdk": "^2.1.9", "mapbox-gl-test-suite": "git://github.com/mapbox/mapbox-gl-test-suite#master", @@ -31,5 +35,12 @@ "install": "make", "test": "make test" }, - "gypfile": true + "gypfile": true, + "binary": { + "module_name": "mbgl", + "module_path": "./lib/", + "host": "https://mapbox-node-binary.s3.amazonaws.com", + "remote_path": "./{name}/v{version}", + "package_name": "{node_abi}-{platform}-{arch}.tar.gz" + } }