update build system (#30441)

This commit is contained in:
Frédéric Péters 2019-02-06 20:23:36 +01:00
parent 042a83d3b0
commit 02d2df4922
4 changed files with 31 additions and 19 deletions

View File

@ -3,14 +3,21 @@ NAME="rouen-publik-theme"
prefix = /usr
all: css
all: themes.json css
themes.json: $(wildcard static/*/config.json)
python publik-base-theme/create_themes_json.py --overlay rouen
%.css: export LC_ALL=C.UTF-8
.SECONDEXPANSION:
%.css: %.scss $$(wildcard $$(@D)/*.scss)
sass $< $@
publik-base-theme/static/includes/_data_uris.scss: $(wildcard publik-base-theme/static/includes/img/*)
cd publik-base-theme; python make_data_uris.py static/includes/
css: publik-base-theme/static/includes/_data_uris.scss $(wildcard static/rouen/*.scss)
cd static/rouen/ && sass style.scss:style.css
rm -rf static/rouen/.sass-cache/
css: publik-base-theme/static/includes/_data_uris.scss $(shell python get_themes.py)
rm -rf static/*/.sass-cache/
clean:
rm -rf sdist
@ -18,9 +25,10 @@ clean:
rm -rf sdist publik-base-theme/static/includes/_data_uris.scss
DIST_FILES = \
Makefile static\
templates themes.json \
publik-base-theme
Makefile \
publik-base-theme \
static templates \
get_themes.py
dist: clean
-mkdir sdist
@ -35,6 +43,7 @@ install:
cp -r static templates themes.json $(DESTDIR)$(prefix)/share/publik/themes/rouen
dist-bzip2: dist
-mkdir sdist
cd sdist && tar cfj ../sdist/$(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION)
version:

9
get_themes.py Normal file
View File

@ -0,0 +1,9 @@
#! /usr/bin/env python
import os
for dirname in sorted(os.listdir('static')):
config = os.path.join('static', dirname, 'config.json')
if not os.path.exists(config):
continue
print 'static/%s/style.css' % dirname

6
static/rouen/config.json Normal file
View File

@ -0,0 +1,6 @@
{
"label": "Rouen",
"variables": {
"theme_color": "#EE787C"
}
}

View File

@ -1,12 +0,0 @@
[
{"id": "rouen",
"label": "Rouen",
"overlay": "rouen",
"variables": {
"css_variant": "rouen",
"no_extra_js": true,
"theme_color": "#EE787C"
},
"module": "publik-base"
}
]