ucode: update to Git HEAD (2025-03-24)

This commit is contained in:
coolsnowwolf 2025-04-12 02:22:54 +08:00
parent 6008d24ba8
commit de74afdd3a

View File

@ -12,21 +12,36 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/jow-/ucode.git PKG_SOURCE_URL=https://github.com/jow-/ucode.git
PKG_SOURCE_DATE:=2023-01-09 PKG_SOURCE_DATE:=2025-03-24
PKG_SOURCE_VERSION:=8dad974baa4696fcba85837fa70cde8b68dd7c12 PKG_SOURCE_VERSION:=b27d70c977ab4381f4094a0b1208e2a13fc5123f
PKG_MIRROR_HASH:=91494352ac298ac2735d62355837a1f18e366999c9e940613e6fa3265edc0364 PKG_MIRROR_HASH:=c2285ab8e473a12a1795864323af15779ef42a72dfe8a77c740cf99c316a2ac7
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=ISC PKG_LICENSE:=ISC
PKG_ABI_VERSION:=20220812 PKG_ABI_VERSION:=20230711
PKG_BUILD_DEPENDS:=libmd
HOST_BUILD_DEPENDS:=libjson-c/host
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/cmake.mk
CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION) CMAKE_OPTIONS += \
-DSOVERSION=$(PKG_ABI_VERSION)
CMAKE_HOST_OPTIONS += \
-DCMAKE_SKIP_RPATH=FALSE \
-DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib"
ifeq ($(HOST_OS),Darwin)
CMAKE_HOST_OPTIONS += \
-DCMAKE_MACOSX_RPATH=1
else
CMAKE_HOST_OPTIONS += \
-DUSE_RPATH="${STAGING_DIR_HOSTPKG}/lib"
endif
CMAKE_HOST_OPTIONS += \ CMAKE_HOST_OPTIONS += \
-DSOVERSION=$(PKG_ABI_VERSION) \
-DFS_SUPPORT=ON \ -DFS_SUPPORT=ON \
-DMATH_SUPPORT=ON \ -DMATH_SUPPORT=ON \
-DNL80211_SUPPORT=OFF \ -DNL80211_SUPPORT=OFF \
@ -35,13 +50,17 @@ CMAKE_HOST_OPTIONS += \
-DSTRUCT_SUPPORT=ON \ -DSTRUCT_SUPPORT=ON \
-DUBUS_SUPPORT=OFF \ -DUBUS_SUPPORT=OFF \
-DUCI_SUPPORT=OFF \ -DUCI_SUPPORT=OFF \
-DULOOP_SUPPORT=OFF -DULOOP_SUPPORT=OFF \
-DDEBUG_SUPPORT=ON \
-DLOG_SUPPORT=OFF \
-DDIGEST_SUPPORT=OFF
define Package/ucode/default define Package/ucode/default
SECTION:=utils SUBMENU:=ucode
CATEGORY:=Utilities SECTION:=lang
TITLE:=ucode - Tiny scripting and templating language CATEGORY:=Languages
TITLE:=Tiny scripting and templating language
endef endef
define Package/ucode define Package/ucode
@ -57,7 +76,10 @@ endef
define Package/libucode define Package/libucode
$(Package/ucode/default) $(Package/ucode/default)
TITLE+= - runtime library SUBMENU:=
SECTION:=libs
CATEGORY:=Libraries
TITLE+= (library)
ABI_VERSION:=$(PKG_ABI_VERSION) ABI_VERSION:=$(PKG_ABI_VERSION)
DEPENDS:=+libjson-c DEPENDS:=+libjson-c
endef endef
@ -66,105 +88,29 @@ define Package/libucode/description
The libucode package provides the shared runtime library for the ucode interpreter. The libucode package provides the shared runtime library for the ucode interpreter.
endef endef
# 1: name
# 2: cmake symbol
# 3: depends
# 4: description
define UcodeModule
UCODE_MODULES += ucode-mod-$(strip $(1))
CMAKE_OPTIONS += -D$(strip $(2))=$(if $(CONFIG_PACKAGE_ucode-mod-$(strip $(1))),ON,OFF)
PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_ucode-mod-$(strip $(1))
define Package/ucode-mod-fs define Package/ucode-mod-$(strip $(1))
$(Package/ucode/default) $(Package/ucode/default)
TITLE+= (filesystem module) TITLE+= ($(strip $(1)) module)
DEPENDS:=ucode DEPENDS:=+ucode $(3)
endef endef
define Package/ucode-mod-fs/description define Package/ucode-mod-$(strip $(1))/description
The filesystem plugin module allows interaction with the local file system. $(strip $(4))
endef endef
define Package/ucode-mod-$(strip $(1))/install
define Package/ucode-mod-math $(INSTALL_DIR) $$(1)/usr/lib/ucode
$(Package/ucode/default) $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/$(strip $(1)).so $$(1)/usr/lib/ucode/
TITLE+= (math module) endef
DEPENDS:=ucode
endef
define Package/ucode-mod-math/description
The math plugin provides access to various <math.h> procedures.
endef
define Package/ucode-mod-nl80211
$(Package/ucode/default)
TITLE+= (nl80211 module)
DEPENDS:=ucode +libnl-tiny
endef
define Package/ucode-mod-nl80211/description
The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.
endef
define Package/ucode-mod-resolv
$(Package/ucode/default)
TITLE+= (resolv module)
DEPENDS:=ucode
endef
define Package/ucode-mod-resolv/description
The resolv plugin implements simple DNS resolving.
endef
define Package/ucode-mod-rtnl
$(Package/ucode/default)
TITLE+= (rtnl module)
DEPENDS:=ucode +libnl-tiny
endef
define Package/ucode-mod-rtnl/description
The rtnl plugin provides access to the Linux routing netlink API.
endef
define Package/ucode-mod-struct
$(Package/ucode/default)
TITLE+= (struct module)
DEPENDS:=ucode
endef
define Package/ucode-mod-struct/description
The struct plugin implemnts Python 3 compatible struct.pack/unpack functionality.
endef
define Package/ucode-mod-ubus
$(Package/ucode/default)
TITLE+= (ubus module)
DEPENDS:=ucode +libubus +libblobmsg-json
endef
define Package/ucode-mod-ubus/description
The ubus module allows ucode template scripts to enumerate and invoke ubus
procedures.
endef
define Package/ucode-mod-uci
$(Package/ucode/default)
TITLE+= (uci module)
DEPENDS:=ucode +libuci
endef
define Package/ucode-mod-uci/description
The uci module allows templates to read and modify uci configuration.
endef
define Package/ucode-mod-uloop
$(Package/ucode/default)
TITLE+= (uloop module)
DEPENDS:=ucode +libubox
endef
define Package/ucode-mod-uloop/description
The uloop module allows ucode scripts to interact with OpenWrt uloop event
loop implementation.
endef endef
@ -185,60 +131,63 @@ define Package/libucode/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
endef endef
define Package/ucode-mod-fs/install
$(INSTALL_DIR) $(1)/usr/lib/ucode
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
endef
define Package/ucode-mod-math/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode debug, DEBUG_SUPPORT, +libubox +libucode, \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/ The debug plugin module provides runtime debugging and introspection facilities.))
endef
define Package/ucode-mod-nl80211/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode fs, FS_SUPPORT, , \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/ The filesystem plugin module allows interaction with the local file system.))
endef
define Package/ucode-mod-resolv/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode log, LOG_SUPPORT, +libubox, \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/ The log plugin module provides access to the syslog and libubox ulog APIs.))
endef
define Package/ucode-mod-rtnl/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode math, MATH_SUPPORT, , \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/ The math plugin provides access to various <math.h> procedures.))
endef
define Package/ucode-mod-struct/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode nl80211, NL80211_SUPPORT, +libnl-tiny +libubox, \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/ The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.))
endef
define Package/ucode-mod-ubus/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode resolv, RESOLV_SUPPORT, , \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/ The resolv plugin implements simple DNS resolving.))
endef
define Package/ucode-mod-uci/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode rtnl, RTNL_SUPPORT, +libnl-tiny +libubox, \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/ The rtnl plugin provides access to the Linux routing netlink API.))
endef
define Package/ucode-mod-uloop/install $(eval $(call UcodeModule, \
$(INSTALL_DIR) $(1)/usr/lib/ucode socket, SOCKET_SUPPORT, , \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uloop.so $(1)/usr/lib/ucode/ The socket plugin provides access to IPv4, IPv6, Unix and packet socket APIs.))
endef
$(eval $(call UcodeModule, \
struct, STRUCT_SUPPORT, , \
The struct plugin implements Python 3 compatible struct.pack/unpack functionality.))
$(eval $(call UcodeModule, \
ubus, UBUS_SUPPORT, +libubus +libblobmsg-json, \
The ubus module allows ucode template scripts to enumerate and invoke ubus procedures.))
$(eval $(call UcodeModule, \
uci, UCI_SUPPORT, +libuci, \
The uci module allows templates to read and modify uci configuration.))
$(eval $(call UcodeModule, \
uloop, ULOOP_SUPPORT, +libubox, \
The uloop module allows ucode scripts to interact with OpenWrt uloop event loop implementation.))
$(eval $(call UcodeModule, \
digest, DIGEST_SUPPORT, , \
The digest module allows ucode scripts to use libmd digests.))
$(eval $(call BuildPackage,libucode)) $(eval $(call BuildPackage,libucode))
$(eval $(call BuildPackage,ucode)) $(eval $(call BuildPackage,ucode))
$(eval $(call BuildPackage,ucode-mod-fs))
$(eval $(call BuildPackage,ucode-mod-math)) $(foreach mod,$(UCODE_MODULES), \
$(eval $(call BuildPackage,ucode-mod-nl80211)) $(eval $(call BuildPackage,$(mod))))
$(eval $(call BuildPackage,ucode-mod-resolv))
$(eval $(call BuildPackage,ucode-mod-rtnl))
$(eval $(call BuildPackage,ucode-mod-struct))
$(eval $(call BuildPackage,ucode-mod-ubus))
$(eval $(call BuildPackage,ucode-mod-uci))
$(eval $(call BuildPackage,ucode-mod-uloop))
$(eval $(call HostBuild)) $(eval $(call HostBuild))