Browse Source

Made node, sass, compass, autoprefixer optional configure dependencies and added compiled styles to source.

pull/53/head
Simon Eisenmann 11 years ago
parent
commit
fd3204d231
  1. 3
      .gitignore
  2. 32
      Makefile.am
  3. 30
      configure.ac
  4. 36
      src/styles/Makefile.am
  5. 20
      static/css/bootstrap.min.css
  6. 23
      static/css/font-awesome.min.css
  7. 39
      static/css/main.min.css

3
.gitignore vendored

@ -8,9 +8,6 @@ @@ -8,9 +8,6 @@
/*.log
/changelog*.txt
/src/styles/.sass-cache
/static/css/main.min.css
/static/css/bootstrap.min.css
/static/css/font-awesome.min.css
/static/fonts/*
/static/js/main.min.js
/tokens.txt

32
Makefile.am

@ -44,11 +44,6 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH) @@ -44,11 +44,6 @@ DIST := $(CURDIR)/dist_$(BUILD_ARCH)
DIST_SRC := $(DIST)/src
DIST_BIN := $(DIST)/bin
SASSFLAGS = --style=expanded
# Tools
AUTOPREFIXER_BROWSER_SUPPORT := "> 1%, last 2 versions, Firefox ESR, Opera 12.1"
all: build
build: get binary assets
@ -80,33 +75,24 @@ test: get @@ -80,33 +75,24 @@ test: get
GOPATH=$(GOPATH) $(GO) test -i $(TESTDEPS)
GOPATH=$(GOPATH) $(GO) test -v $(TESTDEPS)
assets: styles javascript
styles:
$(MKDIR_P) $(CURDIR)/static/css
$(MKDIR_P) $(CURDIR)/static/fonts
cp -r $(CURDIR)/src/styles/libs/font-awesome/fonts/font* $(CURDIR)/static/fonts
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/src/styles/main.scss:$(CURDIR)/static/css/main.min.css
$(AUTOPREFIXER) --browsers $(AUTOPREFIXER_BROWSER_SUPPORT) $(CURDIR)/static/css/main.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/src/styles/bootstrap.scss:$(CURDIR)/static/css/bootstrap.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/src/styles/font-awesome.scss:$(CURDIR)/static/css/font-awesome.min.css
styleshint:
$(FIND) src/styles -maxdepth 1 -name "*.scss" -print0 | xargs -0 -n1 $(SASS) --compass --scss $(SASSFLAGS) -c
assets: javascript fonts
releaseassets: RJSFLAGS = generateSourceMaps=false preserveLicenseComments=true
releaseassets: SASSFLAGS = --style=compressed --no-cache
releaseassets: dist_gopath assets
fonts:
$(MKDIR_P) $(CURDIR)/static/fonts
cp -r $(CURDIR)/src/styles/libs/font-awesome/fonts/font* $(CURDIR)/static/fonts
javascript:
$(MKDIR_P) $(OUTPUT_JS)
$(NODEJS) $(CURDIR)/build/r.js \
-o $(CURDIR)/build/build.js \
dir=$(OUTPUT_JS) $(RJSFLAGS)
styles: fonts
cd $(CURDIR)/src/styles && $(MAKE) styles
jshint:
@if [ "$(JSHINT)" = "" ]; then echo "Command 'jshint' not found"; exit 1; fi
$(FIND) static/ -wholename static/js/libs -prune -o -name "*.js" -print0 | xargs -0 -n1 $(JSHINT) --config .jshint
@ -178,4 +164,4 @@ tarball: distclean release install @@ -178,4 +164,4 @@ tarball: distclean release install
echo -n $(PACKAGE_VERSION) > $(TARPATH)/version.txt
tar czf $(DIST)/$(PACKAGE_NAME)-$(PACKAGE_VERSION)_$(BUILD_OS)_$(BUILD_ARCH).tar.gz -C $(DIST) $(PACKAGE_NAME)-$(PACKAGE_VERSION)
.PHONY: clean distclean pristine get getupdate build styles javascript release releasetest dist_gopath install gopath binary binaryrace binaryall tarball assets
.PHONY: clean distclean pristine get getupdate build javascript fonts styles release releasetest dist_gopath install gopath binary binaryrace binaryall tarball assets

30
configure.ac

@ -67,25 +67,30 @@ AC_SUBST(GO) @@ -67,25 +67,30 @@ AC_SUBST(GO)
AC_PATH_PROGS([NODEJS],[nodejs node])
if test x"${NODEJS}" == x"" ; then
AC_MSG_ERROR([Please install node.js before trying to build spreed-webrtc.])
AC_MSG_WARN([No node.js. It is required to build styles and translations.])
NODEJS=nodejs
else
NODEJS_VERSION=`$NODEJS --version | $SED 's/^v//'`
AX_COMPARE_VERSION([$NODEJS_VERSION], [lt], [$NODEJS_VERSION_MIN],
[AC_MSG_WARN([Please install node.js $NODEJS_VERSION_MIN or newer before trying to build styles (found node.js $NODEJS_VERSION).])])
fi
NODEJS_VERSION=`$NODEJS --version | $SED 's/^v//'`
AX_COMPARE_VERSION([$NODEJS_VERSION], [lt], [$NODEJS_VERSION_MIN],
[AC_MSG_ERROR([Please install node.js $NODEJS_VERSION_MIN or newer before trying to build spreed-webrtc (found node.js $NODEJS_VERSION).])])
AC_SUBST(NODEJS)
AC_PATH_PROGS([SASS],[sass])
if test x"${SASS}" == x"" ; then
AC_MSG_ERROR([Please install sass before trying to build spreed-webrtc.])
AC_MSG_WARN([Please install sass before trying to build spreed-webrtc.])
SASS=sass
else
SASS_VERSION=`$SASS --version | $SED 's/^Sass //' | $SED 's/ .*//'`
AX_COMPARE_VERSION([$SASS_VERSION], [lt], [$SASS_VERSION_MIN],
[AC_MSG_WARN([Please install sass $SASS_VERSION_MIN or newer before trying to build styles (found sass $SASS_VERSION).])])
fi
SASS_VERSION=`$SASS --version | $SED 's/^Sass //' | $SED 's/ .*//'`
AX_COMPARE_VERSION([$SASS_VERSION], [lt], [$SASS_VERSION_MIN],
[AC_MSG_ERROR([Please install sass $SASS_VERSION_MIN or newer before trying to build spreed-webrtc (found sass $SASS_VERSION).])])
AC_SUBST(SASS)
AC_PATH_PROGS([COMPASS],[compass])
if test x"${COMPASS}" == x"" ; then
AC_MSG_ERROR([Please install compass before trying to build spreed-webrtc.])
AC_MSG_WARN([Please install compass before trying to build styles.])
COMPASS=compass
fi
AC_SUBST(COMPASS)
@ -96,13 +101,14 @@ sass_compass=$? @@ -96,13 +101,14 @@ sass_compass=$?
rm $tempfile
if test x"${sass_compass}" != x"0" ; then
AC_MSG_RESULT([not available])
AC_MSG_ERROR([Please install compass so it can be used using "sass --compass ...".])
AC_MSG_WARN([Please install compass so it can be used using "sass --compass ...".])
fi
AC_MSG_RESULT([ok])
AC_PATH_PROGS([AUTOPREFIXER],[autoprefixer])
if test x"${AUTOPREFIXER}" == x"" ; then
AC_MSG_ERROR([Please install autoprefixer before trying to build spreed-webrtc.])
AC_MSG_WARN([Please install autoprefixer before trying to build styles.])
AUTOPREFIXER=autoprefixer
fi
AC_SUBST(AUTOPREFIXER)
@ -114,6 +120,6 @@ AC_DEFINE_UNQUOTED(PACKAGE_VERSION, ["$PACKAGE_VERSION"], [Define to the version @@ -114,6 +120,6 @@ AC_DEFINE_UNQUOTED(PACKAGE_VERSION, ["$PACKAGE_VERSION"], [Define to the version
AC_DEFINE_UNQUOTED(PACKAGE_STRING, ["$PACKAGE_STRING"], [Define to the full name and version of this package.])
AC_CONFIG_FILES([
Makefile
Makefile src/styles/Makefile
])
AC_OUTPUT

36
src/styles/Makefile.am

@ -0,0 +1,36 @@ @@ -0,0 +1,36 @@
#
# Spreed WebRTC.
# Copyright (C) 2013-2014 struktur AG
#
# This file is part of Spreed WebRTC.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
SASSFLAGS = --style=compressed --no-cache
AUTOPREFIXER_BROWSER_SUPPORT := "> 1%, last 2 versions, Firefox ESR, Opera 12.1"
STATIC = ../../static
styles:
$(MKDIR_P) $(STATIC)/css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/main.scss:$(STATIC)/css/main.min.css
$(AUTOPREFIXER) --browsers $(AUTOPREFIXER_BROWSER_SUPPORT) $(STATIC)/css/main.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/bootstrap.scss:$(STATIC)/css/bootstrap.min.css
$(SASS) --compass --scss $(SASSFLAGS) \
$(CURDIR)/font-awesome.scss:$(STATIC)/css/font-awesome.min.css
styleshint:
$(FIND) ./ -maxdepth 1 -name "*.scss" -print0 | xargs -0 -n1 $(SASS) --compass --scss $(SASSFLAGS) -c

20
static/css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

23
static/css/font-awesome.min.css vendored

File diff suppressed because one or more lines are too long

39
static/css/main.min.css vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save