From 8683be8571d6ac79e5429984b86888848ba0c496 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Feb 2014 00:01:01 +0100 Subject: [PATCH 1/6] Added Travis integration. The test is just compilation for now. --- .travis.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..60480013 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +# stats available at +# https://travis-ci.org/strukturag/spreed-speakfreely/ +language: go + +go: + - 1.1 + - 1.2 + - tip + +before_install: + - sudo apt-get update + +install: + - sudo apt-get -y install nodejs npm ruby-sass ruby-compass python-babel + # 'npm config set ca ""' required only for node 0.6 + # which is installed on Travis CI + # see https://github.com/npm/npm/issues/4379#issuecomment-31590254 + - sudo npm config set ca "" + - sudo npm install -g po2json + +script: + - make get + - make styles + - make javascript + - make binary From 6f48312ff696f8ac95cf05f1b3466fd7203ef267 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Feb 2014 00:02:47 +0100 Subject: [PATCH 2/6] Support both "/usr/bin/nodejs" and "/usr/bin/node" when compiling JavaScript. --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d9ca1c93..851df34c 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,13 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH) DIST_SRC := $(DIST)/src DIST_BIN := $(DIST)/bin +NODEJS_BIN_EXISTS := $(shell [ -x /usr/bin/nodejs ] && echo 1 || echo 0) +ifeq ($(NODEJS_BIN_EXISTS), 1) + NODEJS_BIN := /usr/bin/nodejs +else + NODEJS_BIN := /usr/bin/node +endif + build: get binary styles javascript gopath: @@ -65,7 +72,7 @@ styles: javascript: mkdir -p $(OUTPUT_JS) - nodejs $(CURDIR)/build/r.js -o $(CURDIR)/build/build.js dir=$(OUTPUT_JS) baseUrl=$(CURDIR)/static/js mainConfigFile=$(CURDIR)/static/js/main.js + $(NODEJS_BIN) $(CURDIR)/build/r.js -o $(CURDIR)/build/build.js dir=$(OUTPUT_JS) baseUrl=$(CURDIR)/static/js mainConfigFile=$(CURDIR)/static/js/main.js release: GOPATH = "$(DIST):$(CURDIR)" release: LDFLAGS = -X main.version $(VERSION) -X main.defaultConfig $(CONFIG_PATH)/$(CONFIG_FILE) From daa970ea618e06de146a4cb6f209d6bca1555d1e Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Feb 2014 00:04:36 +0100 Subject: [PATCH 3/6] Show build status of master branch. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 79c99cab..2a7eea8a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ The latest version of Spreed Speak Freely can be found on GitHub: ## Building + [![Build Status](https://travis-ci.org/strukturag/spreed-speakfreely.png?branch=master)](https://travis-ci.org/strukturag/spreed-speakfreely) + Go, Sass and NodeJS need to be in your $PATH. ```bash From 70ca7c2c09cb731eabc87276c45d0f10156ff839 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Feb 2014 00:44:04 +0100 Subject: [PATCH 4/6] Install "sass" and "compass" as gems to get recent versions. --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 60480013..47732e71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,11 +7,16 @@ go: - 1.2 - tip +env: + - GEM_HOME=/var/lib/gems/1.8 + before_install: - sudo apt-get update install: - - sudo apt-get -y install nodejs npm ruby-sass ruby-compass python-babel + - sudo apt-get -y install nodejs npm rubygems python-babel + - sudo gem install sass + - sudo gem install compass # 'npm config set ca ""' required only for node 0.6 # which is installed on Travis CI # see https://github.com/npm/npm/issues/4379#issuecomment-31590254 From ab814616060b44efe0eda79d261868975ad32724 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Feb 2014 00:44:20 +0100 Subject: [PATCH 5/6] We need Sass 3.2.0 or newer. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2a7eea8a..343d4a0d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The latest version of Spreed Speak Freely can be found on GitHub: - [Go](http://golang.org) >= 1.1.0 - [NodeJS](http://nodejs.org/) - - [Sass](http://sass-lang.com/) + - [Sass](http://sass-lang.com/) >= 3.2.0 - [Compass](http://compass-style.org/) - [Babel](http://babel.pocoo.org/) - [po2json](https://github.com/mikeedwards/po2json) @@ -99,4 +99,4 @@ The latest version of Spreed Speak Freely can be found on GitHub: ## License -`Spreed Speak Freely` uses the AGPL license, see our `LICENSE` file. \ No newline at end of file +`Spreed Speak Freely` uses the AGPL license, see our `LICENSE` file. From 75a9bfbaad26354d83f8ee2b413fd0b61a5b8dda Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Wed, 19 Feb 2014 10:03:57 +0100 Subject: [PATCH 6/6] Use "nodejs"/"node" from PATH. --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 851df34c..870a5f3a 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,13 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH) DIST_SRC := $(DIST)/src DIST_BIN := $(DIST)/bin -NODEJS_BIN_EXISTS := $(shell [ -x /usr/bin/nodejs ] && echo 1 || echo 0) -ifeq ($(NODEJS_BIN_EXISTS), 1) - NODEJS_BIN := /usr/bin/nodejs -else - NODEJS_BIN := /usr/bin/node +NODEJS_BIN := $(shell which nodejs) +ifeq ("$(NODEJS_BIN)", "") + NODEJS_BIN := $(shell which node) +endif +NODEJS_BIN_EXISTS := $(shell [ -x "$(NODEJS_BIN)" ] && echo 1 || echo 0) +ifneq ($(NODEJS_BIN_EXISTS), 1) + $(error "Can't find node.js runtime, please install / check your PATH") endif build: get binary styles javascript