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.

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