Skip to content
Snippets Groups Projects
Commit d9ef6aa3 authored by Jan-Tarek Butt's avatar Jan-Tarek Butt
Browse files

add srcdiet as host build depence and minimize lua code

parent ea3f7c5a
No related branches found
No related tags found
No related merge requests found
...@@ -6,24 +6,34 @@ PKG_RELEASE:=1 ...@@ -6,24 +6,34 @@ PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_BUILD_DEPENDS += lua/host luci-base/host
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME) define Package/ffnw-hoodselector
SECTION:=networke SECTION:=networke
CATEGORY:=Freifunk Nordwest CATEGORY:=Freifunk Nordwest
TITLE:=Select the hoods depending on the geo coordinate TITLE:=Select the hoods depending on the geo coordinate
DEPENDS:=+lwtrace +ffnw-hoods +dkjson gluon-mesh-batman-adv-15 +gluon-mesh-vpn-fastd DEPENDS:=+lwtrace +ffnw-hoods +dkjson gluon-mesh-batman-adv-15 +gluon-mesh-vpn-fastd
endef endef
define Package/$(PKG_NAME)/description define Package/ffnw-hoodselector/description
Select the hoods depending on the geo coordinates Select the hoods depending on the geo coordinates
endef endef
define SrcDiet
$(FIND) $(1) -type f | while read src; do \
if $(STAGING_DIR_HOST)/bin/lua $(STAGING_DIR_HOST)/bin/LuaSrcDiet \
--noopt-binequiv -o "$$$$src.o" "$$$$src"; \
then mv "$$$$src.o" "$$$$src"; fi; \
done
endef
define Build/Prepare define Build/Prepare
mkdir -p $(PKG_BUILD_DIR) mkdir -p $(PKG_BUILD_DIR)
$(CP) ./luasrc/* $(PKG_BUILD_DIR)/ $(CP) ./luasrc/* $(PKG_BUILD_DIR)/
sed -e 's/--.*//' -e '/^$$$$/d' $(PKG_BUILD_DIR)/hoodselector > $(PKG_BUILD_DIR)/hoodselector-min $(call SrcDiet,$(PKG_BUILD_DIR),$(PKG_BUILD_DIR))
chmod +x $(PKG_BUILD_DIR)/hoodselector-min chmod +x -R $(PKG_BUILD_DIR)/
endef endef
define Build/Configure define Build/Configure
...@@ -32,10 +42,10 @@ endef ...@@ -32,10 +42,10 @@ endef
define Build/Compile define Build/Compile
endef endef
define Package/$(PKG_NAME)/install define Package/ffnw-hoodselector/install
$(CP) ./files/* $(1)/ $(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_BUILD_DIR)/hoodselector-min $(1)/usr/sbin/hoodselector $(CP) $(PKG_BUILD_DIR)/hoodselector $(1)/usr/sbin/hoodselector
endef endef
$(eval $(call BuildPackage,$(PKG_NAME))) $(eval $(call BuildPackage,ffnw-hoodselector))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment