From 72d9e31847209abc12170dcce3813b80cf5dfd00 Mon Sep 17 00:00:00 2001 From: M4x1m3 Date: Mon, 22 Jun 2020 19:02:32 +0200 Subject: [PATCH] Added support for git theme repos Usage: OMEGA_THEME_REPO must be set to a valid git url, or local for local repository OMEGA_THEME_NAME must be set to an existing theme in the repository --- Makefile | 3 ++- apps/Makefile | 14 ++++++++++++-- build/config.mak | 3 ++- escher/Makefile | 15 +++++++++++++-- themes | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 9dc9aa5a7..6266be7de 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,8 @@ info: @echo "EPSILON_VERSION = $(EPSILON_VERSION)" @echo "EPSILON_APPS = $(EPSILON_APPS)" @echo "EPSILON_I18N = $(EPSILON_I18N)" - @echo "OMEGA_THEME = $(OMEGA_THEME)" + @echo "OMEGA_THEME_NAME = $(OMEGA_THEME_NAME)" + @echo "OMEGA_THEME_REPO = $(OMEGA_THEME_REPO)" @echo "BUILD_DIR = $(BUILD_DIR)" @echo "PLATFORM" = $(PLATFORM) @echo "DEBUG" = $(DEBUG) diff --git a/apps/Makefile b/apps/Makefile index 84268fdbb..9a2f09fb0 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -107,10 +107,20 @@ apps_tests_src += $(addprefix apps/,\ global_preferences.cpp \ ) +ifeq ($(OMEGA_THEME_REPO),local) $(foreach img,$(image_list), $(eval $(call rule_for, \ ICON, \ $(img), \ - $(addprefix themes/themes/, $(addsuffix .json, $(OMEGA_THEME))), \ - $$(PYTHON) themes/themes_manager.py -i $(OMEGA_THEME) $$@ $(BUILD_DIR)/, \ + $(addprefix themes/themes/local/, $(addsuffix .json, $(OMEGA_THEME_NAME))), \ + $$(PYTHON) themes/themes_manager.py -i $(OMEGA_THEME_REPO) $(OMEGA_THEME_NAME) $$@ $(BUILD_DIR)/, \ global \ ))) +else +$(foreach img,$(image_list), $(eval $(call rule_for, \ + ICON, \ + $(img), \ + $(addsuffix /escher/palette.h, $(BUILD_DIR)), \ + $$(PYTHON) themes/themes_manager.py -i $(OMEGA_THEME_REPO) $(OMEGA_THEME_NAME) $$@ $(BUILD_DIR)/, \ + global \ +))) +endif diff --git a/build/config.mak b/build/config.mak index 6f2e004ed..24b8563e9 100644 --- a/build/config.mak +++ b/build/config.mak @@ -13,5 +13,6 @@ EPSILON_I18N ?= en fr es de pt hu EPSILON_GETOPT ?= 0 EPSILON_TELEMETRY ?= 0 ESCHER_LOG_EVENTS_BINARY ?= 0 -OMEGA_THEME ?= omega_light +OMEGA_THEME_NAME ?= omega_light +OMEGA_THEME_REPO ?= local LEDS_CHOICE ?= 0 diff --git a/escher/Makefile b/escher/Makefile index 158cdedaa..d36961b98 100644 --- a/escher/Makefile +++ b/escher/Makefile @@ -1,12 +1,23 @@ SFLAGS += -Iescher/include +ifeq ($(OMEGA_THEME_REPO),local) $(eval $(call rule_for, \ THEME, \ escher/palette.h, \ - $(addprefix themes/themes/, $(addsuffix .json, $(OMEGA_THEME))), \ - $$(PYTHON) themes/themes_manager.py $(OMEGA_THEME) $$@, \ + $(addprefix themes/themes/local/, $(addsuffix .json, $(OMEGA_THEME_NAME))), \ + $$(PYTHON) themes/themes_manager.py $(OMEGA_THEME_REPO) $(OMEGA_THEME_NAME) $$@ $(BUILD_DIR)/, \ global \ )) +else +$(eval $(call rule_for, \ + THEME, \ + escher/palette.h, \ + themes/themes/git/.empty-folder, \ + $$(PYTHON) themes/themes_manager.py $(OMEGA_THEME_REPO) $(OMEGA_THEME_NAME) $$@ $(BUILD_DIR)/, \ + global \ +)) +endif + escher_src += $(addprefix escher/src/,\ alternate_empty_view_controller.cpp \ diff --git a/themes b/themes index c0f54d229..e609f158b 160000 --- a/themes +++ b/themes @@ -1 +1 @@ -Subproject commit c0f54d2298f0fff5d22d8d45401aee7e3e34e701 +Subproject commit e609f158bd59b9e377e1bf91449af7bb91088bdf