Add GLUON_MINIFY flag to allow skipping the minification process (#1916)
This commit is contained in:
parent
992457b203
commit
57516fe4e7
3
Makefile
3
Makefile
@ -45,6 +45,7 @@ $(eval $(call mkabspath,GLUON_PATCHESDIR))
|
||||
|
||||
GLUON_MULTIDOMAIN ?= 0
|
||||
GLUON_DEBUG ?= 0
|
||||
GLUON_MINIFY ?= 1
|
||||
|
||||
# Can be overridden via environment/command line/... to use the Gluon
|
||||
# build system for non-Gluon builds
|
||||
@ -53,7 +54,7 @@ src-link gluon_base ../../package
|
||||
endef
|
||||
|
||||
GLUON_VARS = \
|
||||
GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_DEBUG GLUON_DEPRECATED GLUON_DEVICES \
|
||||
GLUON_RELEASE GLUON_REGION GLUON_MULTIDOMAIN GLUON_DEBUG GLUON_MINIFY GLUON_DEPRECATED GLUON_DEVICES \
|
||||
GLUON_TARGETSDIR GLUON_PATCHESDIR GLUON_TMPDIR GLUON_IMAGEDIR GLUON_PACKAGEDIR \
|
||||
GLUON_SITEDIR GLUON_RELEASE GLUON_BRANCH GLUON_LANGS GLUON_BASE_FEEDS \
|
||||
GLUON_TARGET BOARD SUBTARGET
|
||||
|
@ -212,6 +212,12 @@ GLUON_DEBUG
|
||||
Setting ``GLUON_DEBUG=1`` will provide firmware images including debugging symbols usable with GDB or
|
||||
similar tools. Requires a device or target with at least 16 MB of flash space, e.g. `x86-64`. Unset by default.
|
||||
|
||||
GLUON_MINIFY
|
||||
Setting ``GLUON_MINIFY=0`` will omit the minification of scripts during the build process. By
|
||||
default the flag is set to ``1``. Disabling the flag is handy if human readable scripts on the
|
||||
devices are desired for development purposes. Be aware that this will increase the size of the
|
||||
resulting images and is therefore not suitable for devices with small flash chips.
|
||||
|
||||
GLUON_DEVICES
|
||||
List of devices to build. The list contains the Gluon profile name of a device, the profile
|
||||
name is the first parameter of the ``device`` command in a target file.
|
||||
|
@ -347,3 +347,7 @@ config GLUON_SPECIALIZE_KERNEL
|
||||
select KERNEL_IP_NF_NAT
|
||||
select KERNEL_IP_NF_TARGET_MASQUERADE
|
||||
select KERNEL_IP_NF_TARGET_REDIRECT
|
||||
|
||||
config GLUON_MINIFY
|
||||
bool "Minify Gluon scripts"
|
||||
default y
|
||||
|
@ -10,12 +10,18 @@ define Package/gluon-status-page
|
||||
DEPENDS:=+gluon-web +gluon-neighbour-info +gluon-respondd +uhttpd +sse-multiplex +libiwinfo +libjson-c +libnl-tiny +libubus-lua
|
||||
endef
|
||||
|
||||
PKG_CONFIG_DEPENDS += CONFIG_GLUON_MINIFY
|
||||
|
||||
define Package/gluon-status-page/install
|
||||
$(Gluon/Build/Install)
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/gluon/status-page/providers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/stations $(1)/lib/gluon/status-page/providers/
|
||||
|
||||
ifndef CONFIG_GLUON_MINIFY
|
||||
$(CP) ./javascript/status-page.js $(1)/lib/gluon/status-page/www/static/status-page.js
|
||||
endif
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/gluon/status-page/view/
|
||||
$(LN) /lib/gluon/web/i18n $(1)/lib/gluon/status-page/
|
||||
$(LN) /lib/gluon/web/view/error $(1)/lib/gluon/status-page/view/
|
||||
|
@ -3,6 +3,10 @@ PKG_FILE_DEPENDS += $(GLUON_MK)
|
||||
|
||||
PKG_BUILD_DEPENDS += luasrcdiet/host
|
||||
|
||||
ifneq ($(wildcard ./luasrc/.),)
|
||||
PKG_CONFIG_DEPENDS += CONFIG_GLUON_MINIFY
|
||||
endif
|
||||
|
||||
ifneq ($(wildcard ./src/respondd.c),)
|
||||
PKG_BUILD_DEPENDS += respondd
|
||||
endif
|
||||
@ -57,12 +61,14 @@ endef
|
||||
define GluonSrcDiet
|
||||
rm -rf $(2)
|
||||
$(CP) $(1) $(2)
|
||||
ifdef CONFIG_GLUON_MINIFY
|
||||
$(FIND) $(2) -type f | while read src; do \
|
||||
if luasrcdiet --noopt-binequiv -o "$$$$src.o" "$$$$src"; then \
|
||||
chmod $$$$(stat -c%a "$$$$src") "$$$$src.o"; \
|
||||
mv "$$$$src.o" "$$$$src"; \
|
||||
fi; \
|
||||
done
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
|
@ -60,6 +60,9 @@ if istrue(env.GLUON_DEBUG) then
|
||||
try_config 'CONFIG_TARGET_ROOTFS_PARTSIZE=500'
|
||||
end
|
||||
|
||||
if not istrue(env.GLUON_MINIFY) then
|
||||
config '# CONFIG_GLUON_MINIFY is not set'
|
||||
end
|
||||
|
||||
packages {
|
||||
'-odhcpd-ipv6only',
|
||||
|
Loading…
Reference in New Issue
Block a user