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