ucode: update to latest Git HEAD
[openwrt/openwrt.git] / package / utils / ucode / Makefile
1 #
2 # Copyright (C) 2020-2021 Jo-Philipp Wich <jo@mein.io>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=ucode
11 PKG_RELEASE:=1
12
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_URL=https://github.com/jow-/ucode.git
15 PKG_SOURCE_DATE:=2022-10-07
16 PKG_SOURCE_VERSION:=4ae70721aae5f974538928cadc71fa3269e5ad20
17 PKG_MIRROR_HASH:=97339d563e988d57ed02f5fd27722c908d616c2cec8b1f0479f42bc53dfd0aa1
18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
19 PKG_LICENSE:=ISC
20
21 PKG_ABI_VERSION:=20220812
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/host-build.mk
25 include $(INCLUDE_DIR)/cmake.mk
26
27 CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION)
28 CMAKE_HOST_OPTIONS += \
29 -DSOVERSION=$(PKG_ABI_VERSION) \
30 -DFS_SUPPORT=ON \
31 -DMATH_SUPPORT=ON \
32 -DNL80211_SUPPORT=OFF \
33 -DRESOLV_SUPPORT=OFF \
34 -DRTNL_SUPPORT=OFF \
35 -DSTRUCT_SUPPORT=ON \
36 -DUBUS_SUPPORT=OFF \
37 -DUCI_SUPPORT=OFF \
38 -DULOOP_SUPPORT=OFF
39
40
41 define Package/ucode/default
42 SECTION:=utils
43 CATEGORY:=Utilities
44 TITLE:=ucode - Tiny scripting and templating language
45 endef
46
47 define Package/ucode
48 $(Package/ucode/default)
49 DEPENDS:=+libucode
50 endef
51
52 define Package/ucode/description
53 ucode is a tiny script interpreter featuring an ECMAScript oriented
54 script language and Jinja-inspired templating.
55 endef
56
57
58 define Package/libucode
59 $(Package/ucode/default)
60 TITLE+= - runtime library
61 ABI_VERSION:=$(PKG_ABI_VERSION)
62 DEPENDS:=+libjson-c
63 endef
64
65 define Package/libucode/description
66 The libucode package provides the shared runtime library for the ucode interpreter.
67 endef
68
69
70 define Package/ucode-mod-fs
71 $(Package/ucode/default)
72 TITLE+= (filesystem module)
73 DEPENDS:=ucode
74 endef
75
76 define Package/ucode-mod-fs/description
77 The filesystem plugin module allows interaction with the local file system.
78 endef
79
80
81 define Package/ucode-mod-math
82 $(Package/ucode/default)
83 TITLE+= (math module)
84 DEPENDS:=ucode
85 endef
86
87 define Package/ucode-mod-math/description
88 The math plugin provides access to various <math.h> procedures.
89 endef
90
91
92 define Package/ucode-mod-nl80211
93 $(Package/ucode/default)
94 TITLE+= (nl80211 module)
95 DEPENDS:=ucode +libnl-tiny
96 endef
97
98 define Package/ucode-mod-nl80211/description
99 The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.
100 endef
101
102
103 define Package/ucode-mod-resolv
104 $(Package/ucode/default)
105 TITLE+= (resolv module)
106 DEPENDS:=ucode
107 endef
108
109 define Package/ucode-mod-resolv/description
110 The resolv plugin implements simple DNS resolving.
111 endef
112
113
114 define Package/ucode-mod-rtnl
115 $(Package/ucode/default)
116 TITLE+= (rtnl module)
117 DEPENDS:=ucode +libnl-tiny
118 endef
119
120 define Package/ucode-mod-rtnl/description
121 The rtnl plugin provides access to the Linux routing netlink API.
122 endef
123
124
125 define Package/ucode-mod-struct
126 $(Package/ucode/default)
127 TITLE+= (struct module)
128 DEPENDS:=ucode
129 endef
130
131 define Package/ucode-mod-struct/description
132 The struct plugin implemnts Python 3 compatible struct.pack/unpack functionality.
133 endef
134
135
136 define Package/ucode-mod-ubus
137 $(Package/ucode/default)
138 TITLE+= (ubus module)
139 DEPENDS:=ucode +libubus +libblobmsg-json
140 endef
141
142 define Package/ucode-mod-ubus/description
143 The ubus module allows ucode template scripts to enumerate and invoke ubus
144 procedures.
145 endef
146
147
148 define Package/ucode-mod-uci
149 $(Package/ucode/default)
150 TITLE+= (uci module)
151 DEPENDS:=ucode +libuci
152 endef
153
154 define Package/ucode-mod-uci/description
155 The uci module allows templates to read and modify uci configuration.
156 endef
157
158
159 define Package/ucode-mod-uloop
160 $(Package/ucode/default)
161 TITLE+= (uloop module)
162 DEPENDS:=ucode +libubox
163 endef
164
165 define Package/ucode-mod-uloop/description
166 The uloop module allows ucode scripts to interact with OpenWrt uloop event
167 loop implementation.
168 endef
169
170
171 define Build/InstallDev
172 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode
173 $(CP) $(PKG_INSTALL_DIR)/usr/include/ucode/*.h $(1)/usr/include/ucode/
174 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so* $(1)/usr/lib/
175 endef
176
177
178 define Package/ucode/install
179 $(INSTALL_DIR) $(1)/usr/bin
180 $(CP) $(PKG_INSTALL_DIR)/usr/bin/u* $(1)/usr/bin/
181 endef
182
183 define Package/libucode/install
184 $(INSTALL_DIR) $(1)/usr/lib
185 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
186 endef
187
188 define Package/ucode-mod-fs/install
189 $(INSTALL_DIR) $(1)/usr/lib/ucode
190 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
191 endef
192
193 define Package/ucode-mod-math/install
194 $(INSTALL_DIR) $(1)/usr/lib/ucode
195 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/
196 endef
197
198 define Package/ucode-mod-nl80211/install
199 $(INSTALL_DIR) $(1)/usr/lib/ucode
200 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/
201 endef
202
203 define Package/ucode-mod-resolv/install
204 $(INSTALL_DIR) $(1)/usr/lib/ucode
205 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/
206 endef
207
208 define Package/ucode-mod-rtnl/install
209 $(INSTALL_DIR) $(1)/usr/lib/ucode
210 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/
211 endef
212
213 define Package/ucode-mod-struct/install
214 $(INSTALL_DIR) $(1)/usr/lib/ucode
215 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/
216 endef
217
218 define Package/ucode-mod-ubus/install
219 $(INSTALL_DIR) $(1)/usr/lib/ucode
220 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/
221 endef
222
223 define Package/ucode-mod-uci/install
224 $(INSTALL_DIR) $(1)/usr/lib/ucode
225 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/
226 endef
227
228 define Package/ucode-mod-uloop/install
229 $(INSTALL_DIR) $(1)/usr/lib/ucode
230 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uloop.so $(1)/usr/lib/ucode/
231 endef
232
233 $(eval $(call BuildPackage,libucode))
234 $(eval $(call BuildPackage,ucode))
235 $(eval $(call BuildPackage,ucode-mod-fs))
236 $(eval $(call BuildPackage,ucode-mod-math))
237 $(eval $(call BuildPackage,ucode-mod-nl80211))
238 $(eval $(call BuildPackage,ucode-mod-resolv))
239 $(eval $(call BuildPackage,ucode-mod-rtnl))
240 $(eval $(call BuildPackage,ucode-mod-struct))
241 $(eval $(call BuildPackage,ucode-mod-ubus))
242 $(eval $(call BuildPackage,ucode-mod-uci))
243 $(eval $(call BuildPackage,ucode-mod-uloop))
244 $(eval $(call HostBuild))