73f98ebababef606c9800be5c620ef741963e6cb
[feed/packages.git] / lang / erlang / Makefile
1 #
2 # Copyright (C) 2009-2020 OpenWrt.org
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:=erlang
11 PKG_VERSION:=26.2.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=https://github.com/erlang/otp/releases/download/OTP-$(PKG_VERSION)
16 PKG_HASH:=2c4e61b24fb1c131d9f30cfe2415320899180debdb71fb59195c72bd9a4ab625
17
18 PKG_LICENSE:=Apache-2.0
19 PKG_LICENSE_FILES:=LICENSE.txt
20 PKG_MAINTAINER:=Arnaud Sautaux <arnaud.sautaux@infoteam.ch>
21 PKG_CPE_ID:=cpe:/a:erlang:erlang
22
23 PKG_BUILD_DEPENDS:=erlang/host openssl
24 PKG_ASLR_PIE:=0
25
26 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION)
27 PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION)
28
29 include $(INCLUDE_DIR)/host-build.mk
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/erlang/Default
33 SUBMENU:=Erlang
34 SECTION:=lang
35 CATEGORY:=Languages
36 TITLE:=Erlang/OTP programming language
37 URL:=https://www.erlang.org/
38 endef
39
40 define Package/erlang/Default/description
41 Erlang/OTP is a general-purpose programming language and runtime
42 environment. Erlang has built-in support for concurrency, distribution
43 and fault tolerance.
44 endef
45
46 define Package/erlang
47 $(call Package/erlang/Default)
48 DEPENDS+= +libncurses +librt +zlib +libstdcpp
49 PROVIDES:= erlang-erts=14.2.3 erlang-kernel=9.2.2 erlang-sasl=4.2.1 erlang-stdlib=5.2.1
50 endef
51
52 define Package/erlang/description
53 $(call Package/erlang/Default/description)
54 .
55 This package contains the runtime implementation and a minimal set of
56 modules (erts, kernel, sasl & stdlib).
57 endef
58
59
60 define Package/erlang-asn1
61 $(call Package/erlang/Default)
62 TITLE:=Abstract Syntax Notation One (ASN.1) support
63 VERSION:=5.2.1
64 DEPENDS+= +erlang +erlang-syntax-tools
65 endef
66
67 define Package/erlang-asn1/description
68 $(call Package/erlang/Default/description)
69 .
70 This Erlang/OTP package provides Abstract Syntax Notation One (ASN.1)
71 support.
72 endef
73
74
75 define Package/erlang-compiler
76 $(call Package/erlang/Default)
77 TITLE:=Byte code compiler
78 VERSION:=8.4.2
79 DEPENDS+= +erlang
80 endef
81
82 define Package/erlang-compiler/description
83 $(call Package/erlang/Default/description)
84 .
85 This Erlang/OTP package provides a byte code compiler for Erlang which
86 produces highly compact code.
87 endef
88
89
90 define Package/erlang-crypto
91 $(call Package/erlang/Default)
92 TITLE:=Cryptography support
93 VERSION:=5.4.1
94 DEPENDS+= +erlang +libopenssl
95 endef
96
97 define Package/erlang-crypto/description
98 $(call Package/erlang/Default/description)
99 .
100 This Erlang/OTP package provides functions for computation of message
101 digests, and encryption and decryption functions.
102 endef
103
104
105 define Package/erlang-inets
106 $(call Package/erlang/Default)
107 TITLE:=Internet clients and servers
108 VERSION:=9.1
109 DEPENDS+= +erlang
110 endef
111
112 define Package/erlang-inets/description
113 $(call Package/erlang/Default/description)
114 .
115 This Erlang/OTP package provides a container for Internet clients and
116 servers. Currently a FTP client, a HTTP client and server, and a tftp
117 client and server have been incorporated in Inets.
118 endef
119
120
121 define Package/erlang-mnesia
122 $(call Package/erlang/Default)
123 TITLE:=Distributed database
124 VERSION:=4.23
125 DEPENDS+= +erlang
126 endef
127
128 define Package/erlang-mnesia/description
129 $(call Package/erlang/Default/description)
130 .
131 This Erlang/OTP package provides a distributed DataBase Management
132 System (DBMS), appropriate for telecommunications applications and
133 other Erlang applications which require continuous operation and
134 exhibit soft real-time properties.
135 endef
136
137
138 define Package/erlang-runtime-tools
139 $(call Package/erlang/Default)
140 TITLE:=Low-profile debugging/tracing tools
141 VERSION:=2.0.1
142 DEPENDS+= +erlang
143 endef
144
145 define Package/erlang-runtime-tools/description
146 $(call Package/erlang/Default/description)
147 .
148 This Erlang/OTP package provides low footprint tracing/debugging tools
149 suitable for inclusion in a production system.
150 endef
151
152
153 define Package/erlang-snmp
154 $(call Package/erlang/Default)
155 TITLE:=Simple Network Management Protocol (SNMP) support
156 VERSION:=5.15
157 DEPENDS+= +erlang +erlang-asn1
158 endef
159
160 define Package/erlang-snmp/description
161 $(call Package/erlang/Default/description)
162 .
163 This Erlang/OTP package provides Simple Network Management Protocol
164 (SNMP) support including a MIB compiler and tools for creating SNMP
165 agents.
166 endef
167
168
169 define Package/erlang-public-key
170 $(call Package/erlang/Default)
171 TITLE:=Public Key support
172 VERSION:=1.15.1
173 DEPENDS+= +erlang +erlang-crypto +erlang-asn1
174 endef
175
176 define Package/erlang-public-key/description
177 $(call Package/erlang/Default/description)
178 .
179 This Erlang/OTP package provides functions to handle public-key infrastructure.
180 endef
181
182
183 define Package/erlang-ssh
184 $(call Package/erlang/Default)
185 TITLE:=Secure Shell (SSH) support
186 VERSION:=5.1.3
187 DEPENDS+= +erlang +erlang-crypto
188 endef
189
190 define Package/erlang-ssh/description
191 $(call Package/erlang/Default/description)
192 .
193 This Erlang/OTP package provides an implementation of the Secure Shell
194 protocol, with SSH & SFTP support.
195 endef
196
197
198 define Package/erlang-ssl
199 $(call Package/erlang/Default)
200 TITLE:=Secure Sockets Layer (SSL) support
201 VERSION:=11.1.2
202 DEPENDS+= +erlang +erlang-crypto
203 endef
204
205 define Package/erlang-ssl/description
206 $(call Package/erlang/Default/description)
207 .
208 This Erlang/OTP package provides support for secure communication over
209 sockets.
210 endef
211
212
213 define Package/erlang-syntax-tools
214 $(call Package/erlang/Default)
215 TITLE:=Abstract Erlang syntax trees handling support
216 VERSION:=3.1
217 DEPENDS+= +erlang
218 endef
219
220 define Package/erlang-syntax-tools/description
221 $(call Package/erlang/Default/description)
222 .
223 This Erlang/OTP package provides support for handling abstract Erlang
224 syntax trees.
225 endef
226
227
228 define Package/erlang-tools
229 $(call Package/erlang/Default)
230 TITLE:=Erlang tools support
231 VERSION:=3.6
232 DEPENDS+= +erlang
233 endef
234
235 define Package/erlang-tools/description
236 $(call Package/erlang/Default/description)
237 .
238 This Erlang/OTP package provides support for misc tools.
239 endef
240
241
242 define Package/erlang-reltool
243 $(call Package/erlang/Default)
244 TITLE:=Erlang reltool support
245 VERSION:=1.0
246 DEPENDS+= +erlang
247 endef
248
249 define Package/erlang-reltool/description
250 $(call Package/erlang/Default/description)
251 .
252 This Erlang/OTP package provides support for release management.
253 endef
254
255
256 define Package/erlang-erl-interface
257 $(call Package/erlang/Default)
258 TITLE:=Erlang erl_interface support
259 VERSION:=5.5.1
260 DEPENDS+= +erlang
261 endef
262
263 define Package/erlang-erl-interface/description
264 $(call Package/erlang/Default/description)
265 .
266 This Erlang/OTP package provides support for erlang interoperability with other languages.
267 endef
268
269 define Package/erlang-os_mon
270 $(call Package/erlang/Default)
271 TITLE:=Erlang OS Monitoring Application
272 VERSION:=2.9.1
273 DEPENDS+= +erlang
274 endef
275
276 define Package/erlang-os_mon/description
277 $(call Package/erlang/Default/description)
278 .
279 This Erlang/OTP package provides the following services:
280 cpu_sup CPU load and utilization supervision
281 disksup Disk supervision
282 memsup Memory supervision
283 endef
284
285 define Package/erlang-xmerl
286 $(call Package/erlang/Default)
287 TITLE:=Erlang XML export
288 VERSION:=1.3.34
289 DEPENDS+= +erlang
290 endef
291
292 define Package/erlang-xmerl/description
293 $(call Package/erlang/Default/description)
294 .
295 This Erlang/OTP package provides functions for exporting XML data to an external format
296 endef
297
298 # Host
299
300 HOST_CONFIGURE_ARGS += \
301 --with-ssl="$(STAGING_DIR_HOST)" \
302 --without-javac
303
304 # Target
305
306 CONFIGURE_ARGS += \
307 --without-javac \
308 --enable-dynamic-ssl-lib
309
310 CONFIGURE_VARS += \
311 SHLIB_LD="$(TARGET_CC)" \
312 TARGET_ARCH="$(TARGET_ARCH)" \
313 ac_cv_func_mmap_fixed_mapped=yes \
314 ac_cv_path_WX_CONFIG_PATH=no \
315 erl_xcomp_getaddrinfo=no \
316 erl_xcomp_sysroot="$(STAGING_DIR)"
317
318 EXTRA_CFLAGS+=-D_GNU_SOURCE
319 EXTRA_LDFLAGS+=-lz
320
321 define Build/Compile
322 $(MAKE) -C $(PKG_BUILD_DIR) \
323 noboot
324 $(MAKE) -C $(PKG_BUILD_DIR) \
325 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
326 install
327 endef
328
329 define Package/erlang/install
330 $(INSTALL_DIR) $(1)/usr/bin
331 for f in epmd erl erlc escript run_erl; do \
332 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \
333 done
334 $(INSTALL_DIR) $(1)/usr/lib/erlang/bin
335 for f in epmd erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot no_dot_erlang.boot to_erl; do \
336 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \
337 done
338 $(INSTALL_DIR) $(1)/usr/lib/erlang/lib
339 for m in erts kernel sasl stdlib; do \
340 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$m-* $(1)/usr/lib/erlang/lib/ ; \
341 rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/examples ; \
342 rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/src ; \
343 done
344 $(INSTALL_DIR) $(1)/usr/lib/erlang
345 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/erts-* $(1)/usr/lib/erlang/
346 rm -rf $(1)/usr/lib/erlang/erts-*/{doc,include,lib,man,src}
347 rm -rf $(1)/usr/lib/erlang/erts-*/bin/*.src
348 $(INSTALL_DIR) $(1)/usr/lib/erlang/releases
349 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/releases/* $(1)/usr/lib/erlang/releases/
350 $(SED) 's,%ERL_ROOT%,/usr/lib/erlang,g' \
351 $(1)/usr/lib/erlang/releases/RELEASES.src
352 mv -f $(1)/usr/lib/erlang/releases/RELEASES.src \
353 $(1)/usr/lib/erlang/releases/RELEASES
354 for f in bin/erl bin/start erts-*/bin/erl erts-*/bin/start; do \
355 $(SED) 's,^\(ROOTDIR\)=.*,\1=/usr/lib/erlang,g' \
356 $(1)/usr/lib/erlang/$$$$f ; \
357 done
358 endef
359
360 define Build/InstallDev
361 $(INSTALL_DIR) $(1)/usr/lib
362 $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib/
363 $(INSTALL_DIR) $(1)/usr/include
364 $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include/
365 endef
366
367 define BuildModule
368
369 define Package/erlang-$(1)/install
370 $(INSTALL_DIR) $$(1)/usr/lib/erlang/lib
371 for m in $(2); do \
372 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$$$$$m-* $$(1)/usr/lib/erlang/lib/ ; \
373 rm -rf $$(1)/usr/lib/erlang/lib/$$$$$$$$m-*/{examples,priv/obj,src} ; \
374 done
375 endef
376
377 $$(eval $$(call BuildPackage,erlang-$(1)))
378
379 endef
380
381
382 $(eval $(call HostBuild))
383 $(eval $(call BuildPackage,erlang))
384 $(eval $(call BuildModule,asn1,asn1))
385 $(eval $(call BuildModule,compiler,compiler))
386 $(eval $(call BuildModule,crypto,crypto))
387 $(eval $(call BuildModule,inets,inets))
388 $(eval $(call BuildModule,mnesia,mnesia))
389 $(eval $(call BuildModule,runtime-tools,runtime_tools))
390 $(eval $(call BuildModule,snmp,snmp))
391 $(eval $(call BuildModule,public-key,public_key))
392 $(eval $(call BuildModule,ssh,ssh))
393 $(eval $(call BuildModule,ssl,ssl))
394 $(eval $(call BuildModule,syntax-tools,syntax_tools))
395 $(eval $(call BuildModule,tools,tools))
396 $(eval $(call BuildModule,reltool,reltool))
397 $(eval $(call BuildModule,erl-interface,erl_interface))
398 $(eval $(call BuildModule,os_mon,os_mon))
399 $(eval $(call BuildModule,xmerl,xmerl))