Merge pull request #13241 from first-leon/master
[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:=23.0
12 PKG_RELEASE:=3
13
14 PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:= http://www.erlang.org/download/
16 PKG_HASH:=42dcf3c721f4de59fe74ae7b65950c2174c46dc8d1dd4e27c0594d86f606a635
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_USE_MIPS16:=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:=http://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
49 PROVIDES:= erlang-erts=10.0.1 erlang-kernel=6.0 erlang-sasl=3.2 erlang-stdlib=3.5
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.0.6
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:=7.2
79 DEPENDS+= +erlang +erlang-hipe
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:=4.3
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-hipe
106 $(call Package/erlang/Default)
107 TITLE:=High Performance Erlang
108 VERSION:=3.18
109 DEPENDS+= +erlang
110 endef
111
112 define Package/erlang-hipe/description
113 $(call Package/erlang/Default/description)
114 .
115 This Erlang/OTP package provides HiPE (High Performance Erlang)
116 support.
117 endef
118
119
120 define Package/erlang-inets
121 $(call Package/erlang/Default)
122 TITLE:=Internet clients and servers
123 VERSION:=7.0
124 DEPENDS+= +erlang
125 endef
126
127 define Package/erlang-inets/description
128 $(call Package/erlang/Default/description)
129 .
130 This Erlang/OTP package provides a container for Internet clients and
131 servers. Currently a FTP client, a HTTP client and server, and a tftp
132 client and server have been incorporated in Inets.
133 endef
134
135
136 define Package/erlang-mnesia
137 $(call Package/erlang/Default)
138 TITLE:=Distributed database
139 VERSION:=4.15.4
140 DEPENDS+= +erlang
141 endef
142
143 define Package/erlang-mnesia/description
144 $(call Package/erlang/Default/description)
145 .
146 This Erlang/OTP package provides a distributed DataBase Management
147 System (DBMS), appropriate for telecommunications applications and
148 other Erlang applications which require continuous operation and
149 exhibit soft real-time properties.
150 endef
151
152
153 define Package/erlang-runtime-tools
154 $(call Package/erlang/Default)
155 TITLE:=Low-profile debugging/tracing tools
156 VERSION:=1.13
157 DEPENDS+= +erlang
158 endef
159
160 define Package/erlang-runtime-tools/description
161 $(call Package/erlang/Default/description)
162 .
163 This Erlang/OTP package provides low footprint tracing/debugging tools
164 suitable for inclusion in a production system.
165 endef
166
167
168 define Package/erlang-snmp
169 $(call Package/erlang/Default)
170 TITLE:=Simple Network Management Protocol (SNMP) support
171 VERSION:=5.2.11
172 DEPENDS+= +erlang +erlang-asn1
173 endef
174
175 define Package/erlang-snmp/description
176 $(call Package/erlang/Default/description)
177 .
178 This Erlang/OTP package provides Simple Network Management Protocol
179 (SNMP) support including a MIB compiler and tools for creating SNMP
180 agents.
181 endef
182
183
184 define Package/erlang-public-key
185 $(call Package/erlang/Default)
186 TITLE:=Public Key support
187 VERSION:=1.6
188 DEPENDS+= +erlang +erlang-crypto +erlang-asn1
189 endef
190
191 define Package/erlang-public-key/description
192 $(call Package/erlang/Default/description)
193 .
194 This Erlang/OTP package provides functions to handle public-key infrastructure.
195 endef
196
197
198 define Package/erlang-ssh
199 $(call Package/erlang/Default)
200 TITLE:=Secure Shell (SSH) support
201 VERSION:=4.7
202 DEPENDS+= +erlang +erlang-crypto
203 endef
204
205 define Package/erlang-ssh/description
206 $(call Package/erlang/Default/description)
207 .
208 This Erlang/OTP package provides an implementation of the Secure Shell
209 protocol, with SSH & SFTP support.
210 endef
211
212
213 define Package/erlang-ssl
214 $(call Package/erlang/Default)
215 TITLE:=Secure Sockets Layer (SSL) support
216 VERSION:=9.0
217 DEPENDS+= +erlang +erlang-crypto
218 endef
219
220 define Package/erlang-ssl/description
221 $(call Package/erlang/Default/description)
222 .
223 This Erlang/OTP package provides support for secure communication over
224 sockets.
225 endef
226
227
228 define Package/erlang-syntax-tools
229 $(call Package/erlang/Default)
230 TITLE:=Abstract Erlang syntax trees handling support
231 VERSION:=2.1.5
232 DEPENDS+= +erlang
233 endef
234
235 define Package/erlang-syntax-tools/description
236 $(call Package/erlang/Default/description)
237 .
238 This Erlang/OTP package provides support for handling abstract Erlang
239 syntax trees.
240 endef
241
242
243 define Package/erlang-tools
244 $(call Package/erlang/Default)
245 TITLE:=Erlang tools support
246 VERSION:=3.0
247 DEPENDS+= +erlang
248 endef
249
250 define Package/erlang-tools/description
251 $(call Package/erlang/Default/description)
252 .
253 This Erlang/OTP package provides support for misc tools.
254 endef
255
256
257 define Package/erlang-reltool
258 $(call Package/erlang/Default)
259 TITLE:=Erlang reltool support
260 VERSION:=0.7.6
261 DEPENDS+= +erlang
262 endef
263
264 define Package/erlang-reltool/description
265 $(call Package/erlang/Default/description)
266 .
267 This Erlang/OTP package provides support for release management.
268 endef
269
270
271 define Package/erlang-erl-interface
272 $(call Package/erlang/Default)
273 TITLE:=Erlang erl_interface support
274 VERSION:=3.9.3
275 DEPENDS+= +erlang
276 endef
277
278 define Package/erlang-erl-interface/description
279 $(call Package/erlang/Default/description)
280 .
281 This Erlang/OTP package provides support for erlang interoperability with other languages.
282 endef
283
284 define Package/erlang-os_mon
285 $(call Package/erlang/Default)
286 TITLE:=Erlang OS Monitoring Application
287 VERSION:=2.4.5
288 DEPENDS+= +erlang
289 endef
290
291 define Package/erlang-os_mon/description
292 $(call Package/erlang/Default/description)
293 .
294 This Erlang/OTP package provides the following services:
295 cpu_sup CPU load and utilization supervision
296 disksup Disk supervision
297 memsup Memory supervision
298 endef
299
300 define Package/erlang-xmerl
301 $(call Package/erlang/Default)
302 TITLE:=Erlang XML export
303 VERSION:=1.3.17
304 DEPENDS+= +erlang
305 endef
306
307 define Package/erlang-xmerl/description
308 $(call Package/erlang/Default/description)
309 .
310 This Erlang/OTP package provides functions for exporting XML data to an external format
311 endef
312
313 # Host
314
315 HOST_CONFIGURE_ARGS += \
316 --disable-hipe \
317 --disable-smp-support \
318 --without-javac
319
320 HOST_CFLAGS += -D_GNU_SOURCE
321
322 define Host/Compile
323 $(MAKE) -C $(HOST_BUILD_DIR) all
324 endef
325
326 define Host/Install
327 $(MAKE) -C $(HOST_BUILD_DIR) install
328 endef
329
330
331 # Target
332
333 CONFIGURE_ARGS += \
334 --disable-hipe \
335 --disable-smp-support \
336 --without-javac \
337 --enable-dynamic-ssl-lib
338
339 CONFIGURE_VARS += \
340 SHLIB_LD="$(TARGET_CC)" \
341 TARGET_ARCH="$(TARGET_ARCH)" \
342 ac_cv_func_mmap_fixed_mapped=yes \
343 ac_cv_path_WX_CONFIG_PATH=no \
344 erl_xcomp_getaddrinfo=no \
345 erl_xcomp_sysroot="$(STAGING_DIR)"
346
347 EXTRA_CFLAGS+=-D_GNU_SOURCE
348 EXTRA_LDFLAGS+=-lz
349
350 define Build/Compile
351 $(MAKE) -C $(PKG_BUILD_DIR) \
352 noboot
353 $(MAKE) -C $(PKG_BUILD_DIR) \
354 INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
355 install
356 endef
357
358 define Package/erlang/install
359 $(INSTALL_DIR) $(1)/usr/bin
360 for f in epmd erl erlc escript run_erl; do \
361 $(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \
362 done
363 $(INSTALL_DIR) $(1)/usr/lib/erlang/bin
364 for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot to_erl; do \
365 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \
366 done
367 $(INSTALL_DIR) $(1)/usr/lib/erlang/lib
368 for m in erts kernel sasl stdlib; do \
369 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$m-* $(1)/usr/lib/erlang/lib/ ; \
370 rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/examples ; \
371 rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/src ; \
372 done
373 $(INSTALL_DIR) $(1)/usr/lib/erlang
374 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/erts-* $(1)/usr/lib/erlang/
375 rm -rf $(1)/usr/lib/erlang/erts-*/{doc,include,lib,man,src}
376 rm -rf $(1)/usr/lib/erlang/erts-*/bin/*.src
377 $(INSTALL_DIR) $(1)/usr/lib/erlang/releases
378 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/releases/* $(1)/usr/lib/erlang/releases/
379 $(SED) 's,%ERL_ROOT%,/usr/lib/erlang,g' \
380 $(1)/usr/lib/erlang/releases/RELEASES.src
381 mv -f $(1)/usr/lib/erlang/releases/RELEASES.src \
382 $(1)/usr/lib/erlang/releases/RELEASES
383 for f in bin/erl bin/start erts-*/bin/erl erts-*/bin/start; do \
384 $(SED) 's,^\(ROOTDIR\)=.*,\1=/usr/lib/erlang,g' \
385 $(1)/usr/lib/erlang/$$$$f ; \
386 done
387 endef
388
389 define Build/InstallDev
390 $(INSTALL_DIR) $(1)/usr/lib
391 $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib/
392 $(INSTALL_DIR) $(1)/usr/include
393 $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include/
394 endef
395
396 define BuildModule
397
398 define Package/erlang-$(1)/install
399 $(INSTALL_DIR) $$(1)/usr/lib/erlang/lib
400 for m in $(2); do \
401 $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$$$$$m-* $$(1)/usr/lib/erlang/lib/ ; \
402 rm -rf $$(1)/usr/lib/erlang/lib/$$$$$$$$m-*/{examples,priv/obj,src} ; \
403 done
404 endef
405
406 $$(eval $$(call BuildPackage,erlang-$(1)))
407
408 endef
409
410
411 $(eval $(call HostBuild))
412 $(eval $(call BuildPackage,erlang))
413 $(eval $(call BuildModule,asn1,asn1))
414 $(eval $(call BuildModule,compiler,compiler))
415 $(eval $(call BuildModule,crypto,crypto))
416 $(eval $(call BuildModule,hipe,hipe))
417 $(eval $(call BuildModule,inets,inets))
418 $(eval $(call BuildModule,mnesia,mnesia))
419 $(eval $(call BuildModule,runtime-tools,runtime_tools))
420 $(eval $(call BuildModule,snmp,snmp))
421 $(eval $(call BuildModule,public-key,public_key))
422 $(eval $(call BuildModule,ssh,ssh))
423 $(eval $(call BuildModule,ssl,ssl))
424 $(eval $(call BuildModule,syntax-tools,syntax_tools))
425 $(eval $(call BuildModule,tools,tools))
426 $(eval $(call BuildModule,reltool,reltool))
427 $(eval $(call BuildModule,erl-interface,erl_interface))
428 $(eval $(call BuildModule,os_mon,os_mon))
429 $(eval $(call BuildModule,xmerl,xmerl))
430