ucode: update to the latest version
[openwrt/staging/hauke.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:=2023-04-03
16 PKG_SOURCE_VERSION:=5163867269fc04fa01ec5e9f8df3384c933339f2
17 PKG_MIRROR_HASH:=e82922ff59d6f899d9434bf79f2e6e4add0b7b0466355755fc83d4b5a0aeebfb
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 SUBMENU:=ucode
43 SECTION:=lang
44 CATEGORY:=Languages
45 TITLE:=Tiny scripting and templating language
46 endef
47
48 define Package/ucode
49 $(Package/ucode/default)
50 DEPENDS:=+libucode
51 endef
52
53 define Package/ucode/description
54 ucode is a tiny script interpreter featuring an ECMAScript oriented
55 script language and Jinja-inspired templating.
56 endef
57
58
59 define Package/libucode
60 $(Package/ucode/default)
61 SUBMENU:=
62 SECTION:=libs
63 CATEGORY:=Libraries
64 TITLE+= (library)
65 ABI_VERSION:=$(PKG_ABI_VERSION)
66 DEPENDS:=+libjson-c
67 endef
68
69 define Package/libucode/description
70 The libucode package provides the shared runtime library for the ucode interpreter.
71 endef
72
73
74 define Package/ucode-mod-fs
75 $(Package/ucode/default)
76 TITLE+= (filesystem module)
77 DEPENDS:=ucode
78 endef
79
80 define Package/ucode-mod-fs/description
81 The filesystem plugin module allows interaction with the local file system.
82 endef
83
84
85 define Package/ucode-mod-math
86 $(Package/ucode/default)
87 TITLE+= (math module)
88 DEPENDS:=ucode
89 endef
90
91 define Package/ucode-mod-math/description
92 The math plugin provides access to various <math.h> procedures.
93 endef
94
95
96 define Package/ucode-mod-nl80211
97 $(Package/ucode/default)
98 TITLE+= (nl80211 module)
99 DEPENDS:=ucode +libnl-tiny +libubox
100 endef
101
102 define Package/ucode-mod-nl80211/description
103 The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.
104 endef
105
106
107 define Package/ucode-mod-resolv
108 $(Package/ucode/default)
109 TITLE+= (resolv module)
110 DEPENDS:=ucode
111 endef
112
113 define Package/ucode-mod-resolv/description
114 The resolv plugin implements simple DNS resolving.
115 endef
116
117
118 define Package/ucode-mod-rtnl
119 $(Package/ucode/default)
120 TITLE+= (rtnl module)
121 DEPENDS:=ucode +libnl-tiny +libubox
122 endef
123
124 define Package/ucode-mod-rtnl/description
125 The rtnl plugin provides access to the Linux routing netlink API.
126 endef
127
128
129 define Package/ucode-mod-struct
130 $(Package/ucode/default)
131 TITLE+= (struct module)
132 DEPENDS:=ucode
133 endef
134
135 define Package/ucode-mod-struct/description
136 The struct plugin implements Python 3 compatible struct.pack/unpack functionality.
137 endef
138
139
140 define Package/ucode-mod-ubus
141 $(Package/ucode/default)
142 TITLE+= (ubus module)
143 DEPENDS:=ucode +libubus +libblobmsg-json
144 endef
145
146 define Package/ucode-mod-ubus/description
147 The ubus module allows ucode template scripts to enumerate and invoke ubus
148 procedures.
149 endef
150
151
152 define Package/ucode-mod-uci
153 $(Package/ucode/default)
154 TITLE+= (uci module)
155 DEPENDS:=ucode +libuci
156 endef
157
158 define Package/ucode-mod-uci/description
159 The uci module allows templates to read and modify uci configuration.
160 endef
161
162
163 define Package/ucode-mod-uloop
164 $(Package/ucode/default)
165 TITLE+= (uloop module)
166 DEPENDS:=ucode +libubox
167 endef
168
169 define Package/ucode-mod-uloop/description
170 The uloop module allows ucode scripts to interact with OpenWrt uloop event
171 loop implementation.
172 endef
173
174
175 define Build/InstallDev
176 $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode
177 $(CP) $(PKG_INSTALL_DIR)/usr/include/ucode/*.h $(1)/usr/include/ucode/
178 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so* $(1)/usr/lib/
179 endef
180
181
182 define Package/ucode/install
183 $(INSTALL_DIR) $(1)/usr/bin
184 $(CP) $(PKG_INSTALL_DIR)/usr/bin/u* $(1)/usr/bin/
185 endef
186
187 define Package/libucode/install
188 $(INSTALL_DIR) $(1)/usr/lib
189 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/
190 endef
191
192 define Package/ucode-mod-fs/install
193 $(INSTALL_DIR) $(1)/usr/lib/ucode
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/
195 endef
196
197 define Package/ucode-mod-math/install
198 $(INSTALL_DIR) $(1)/usr/lib/ucode
199 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/
200 endef
201
202 define Package/ucode-mod-nl80211/install
203 $(INSTALL_DIR) $(1)/usr/lib/ucode
204 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/
205 endef
206
207 define Package/ucode-mod-resolv/install
208 $(INSTALL_DIR) $(1)/usr/lib/ucode
209 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/
210 endef
211
212 define Package/ucode-mod-rtnl/install
213 $(INSTALL_DIR) $(1)/usr/lib/ucode
214 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/
215 endef
216
217 define Package/ucode-mod-struct/install
218 $(INSTALL_DIR) $(1)/usr/lib/ucode
219 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/
220 endef
221
222 define Package/ucode-mod-ubus/install
223 $(INSTALL_DIR) $(1)/usr/lib/ucode
224 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/
225 endef
226
227 define Package/ucode-mod-uci/install
228 $(INSTALL_DIR) $(1)/usr/lib/ucode
229 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/
230 endef
231
232 define Package/ucode-mod-uloop/install
233 $(INSTALL_DIR) $(1)/usr/lib/ucode
234 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uloop.so $(1)/usr/lib/ucode/
235 endef
236
237 $(eval $(call BuildPackage,libucode))
238 $(eval $(call BuildPackage,ucode))
239 $(eval $(call BuildPackage,ucode-mod-fs))
240 $(eval $(call BuildPackage,ucode-mod-math))
241 $(eval $(call BuildPackage,ucode-mod-nl80211))
242 $(eval $(call BuildPackage,ucode-mod-resolv))
243 $(eval $(call BuildPackage,ucode-mod-rtnl))
244 $(eval $(call BuildPackage,ucode-mod-struct))
245 $(eval $(call BuildPackage,ucode-mod-ubus))
246 $(eval $(call BuildPackage,ucode-mod-uci))
247 $(eval $(call BuildPackage,ucode-mod-uloop))
248 $(eval $(call HostBuild))