You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

430 lines
11 KiB

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