Improve installation feedback as we did in Windshaft

remotes/origin/bin-rhel65
Raul Ochoa 10 years ago
parent 65702de64d
commit 62e435fd9e

@ -1,7 +1,5 @@
srcdir=$(shell pwd)
all:
npm install
@sh ./scripts/install.sh
clean:
rm -rf node_modules/*
@ -15,7 +13,8 @@ config.status--test:
config/environments/test.js: config.status--test
./config.status--test
check-local: config/environments/test.js
test: config/environments/test.js
@echo "***tests***"
./run_tests.sh ${RUNTESTFLAGS} \
test/unit/cartodb/*.js \
test/unit/cartodb/cache/model/*.js \
@ -23,16 +22,6 @@ check-local: config/environments/test.js
test/acceptance/*.js \
test/acceptance/cache/*.js
check-submodules:
PATH="$$PATH:$(srcdir)/node_modules/.bin/"; \
for sub in windshaft grainstore node-varnish mapnik; do \
if test -e node_modules/$${sub}; then \
echo "Testing submodule $${sub}"; \
make -C node_modules/$${sub} check || exit 1; \
fi; \
done
check-full: check-local check-submodules
check: check-local
check: test
.PHONY: test

@ -43,7 +43,8 @@
"semver": "~1.1.4"
},
"scripts": {
"test": "make check"
"preinstall": "sh ./scripts/check-node-canvas.sh",
"test": "make test"
},
"engines": {
"node": ">=0.8 <0.11",

@ -0,0 +1,24 @@
#!/bin/sh
if [[ "$OSTYPE" == "darwin"* ]]; then
CAIRO_PKG_CONFIG=`pkg-config cairo --cflags-only-I 2> /dev/null`
RESULT=$?
if [[ ${RESULT} -ne 0 ]]; then
echo "###################################################################################"
echo "# PREINSTALL HOOK ERROR #"
echo "#---------------------------------------------------------------------------------#"
echo "# #"
echo "# node-canvas install error: some packages required by 'cairo' are not found #"
echo "# #"
echo "# Use '\033[1mmake all\033[0m', it will take care of common/known issues #"
echo "# #"
echo "# As an alternative try: #"
echo "# Try to 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig' #"
echo "# #"
echo "# If problems persist visit: https://github.com/Automattic/node-canvas/wiki #"
echo "# #"
echo "###################################################################################"
exit 1
fi
fi

@ -0,0 +1,7 @@
#!/bin/sh
if [[ "$OSTYPE" == "darwin"* ]]; then
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig
fi
npm install
Loading…
Cancel
Save