From 0ec32078303cb3843408754502529422b9ce5408 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Mon, 2 Jan 2023 15:43:12 +0100 Subject: [PATCH] gluon-web-osm: add minify flag support --- package/gluon-config-mode-geo-location-osm/Makefile | 2 +- package/gluon-web-osm/Makefile | 13 +++++++++++++ package/gluon-web-osm/javascript/gluon-web-osm.js | 2 +- .../www/static => javascript}/gluon-web-osm.min.js | 0 4 files changed, 15 insertions(+), 2 deletions(-) rename package/gluon-web-osm/{files/lib/gluon/web/www/static => javascript}/gluon-web-osm.min.js (100%) diff --git a/package/gluon-config-mode-geo-location-osm/Makefile b/package/gluon-config-mode-geo-location-osm/Makefile index a0710e66..2e101223 100644 --- a/package/gluon-config-mode-geo-location-osm/Makefile +++ b/package/gluon-config-mode-geo-location-osm/Makefile @@ -13,7 +13,7 @@ define Package/gluon-config-mode-geo-location-osm/install $(Gluon/Build/Install) $(INSTALL_DIR) $(1)/lib/gluon/config-mode/www/static/ - $(LN) /lib/gluon/web/www/static/gluon-web-osm.min.js $(1)/lib/gluon/config-mode/www/static/gluon-web-osm.js + $(LN) /lib/gluon/web/www/static/gluon-web-osm.js $(1)/lib/gluon/config-mode/www/static/ endef $(eval $(call BuildPackageGluon,gluon-config-mode-geo-location-osm)) diff --git a/package/gluon-web-osm/Makefile b/package/gluon-web-osm/Makefile index 3594da80..31f4b7b7 100644 --- a/package/gluon-web-osm/Makefile +++ b/package/gluon-web-osm/Makefile @@ -8,4 +8,17 @@ define Package/gluon-web-osm TITLE:=base src for OSM inlay endef +PKG_CONFIG_DEPENDS += CONFIG_GLUON_MINIFY + +define Package/gluon-web-osm/install + $(Gluon/Build/Install) + $(INSTALL_DIR) $(1)/lib/gluon/web/www/static/ + +ifdef CONFIG_GLUON_MINIFY + $(INSTALL_DATA) ./javascript/gluon-web-osm.min.js $(1)/lib/gluon/web/www/static/gluon-web-osm.js +else + $(INSTALL_DATA) ./javascript/gluon-web-osm.js $(1)/lib/gluon/web/www/static/ +endif +endef + $(eval $(call BuildPackageGluon,gluon-web-osm)) diff --git a/package/gluon-web-osm/javascript/gluon-web-osm.js b/package/gluon-web-osm/javascript/gluon-web-osm.js index 10bba2a8..65d525ab 100644 --- a/package/gluon-web-osm/javascript/gluon-web-osm.js +++ b/package/gluon-web-osm/javascript/gluon-web-osm.js @@ -1,7 +1,7 @@ /* Build using: - uglifyjs javascript/gluon-web-osm.js -o files/lib/gluon/web/www/static/gluon-web-osm.min.js -c -m + uglifyjs javascript/gluon-web-osm.js -o javascript/gluon-web-osm.min.js -c -m */ 'use strict'; diff --git a/package/gluon-web-osm/files/lib/gluon/web/www/static/gluon-web-osm.min.js b/package/gluon-web-osm/javascript/gluon-web-osm.min.js similarity index 100% rename from package/gluon-web-osm/files/lib/gluon/web/www/static/gluon-web-osm.min.js rename to package/gluon-web-osm/javascript/gluon-web-osm.min.js