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.

338 lines
8.6 KiB

  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=erlang
  9. PKG_VERSION:=17.5
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:= http://www.erlang.org/download/ \
  13. http://erlang.mirror.su.se/
  14. PKG_MD5SUM:=346dd0136bf1cc28cebc140e505206bb
  15. PKG_LICENSE:=ErlPL-1.1
  16. PKG_LICENSE_FILES:=EPLICENCE
  17. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  18. PKG_BUILD_DEPENDS:=erlang/host openssl
  19. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION)
  20. PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION)
  21. include $(INCLUDE_DIR)/host-build.mk
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/erlang/Default
  24. SUBMENU:=Erlang
  25. SECTION:=lang
  26. CATEGORY:=Languages
  27. TITLE:=Erlang/OTP programming language
  28. URL:=http://www.erlang.org/
  29. endef
  30. define Package/erlang/Default/description
  31. Erlang/OTP is a general-purpose programming language and runtime
  32. environment. Erlang has built-in support for concurrency, distribution
  33. and fault tolerance.
  34. endef
  35. define Package/erlang
  36. $(call Package/erlang/Default)
  37. DEPENDS+= +libncurses +librt +zlib
  38. PROVIDES:= erlang-erts=6.4 erlang-kernel=3.2 erlang-sasl=2.4.1 erlang-stdlib=2.4
  39. endef
  40. define Package/erlang/description
  41. $(call Package/erlang/Default/description)
  42. .
  43. This package contains the runtime implementation and a minimal set of
  44. modules (erts, kernel, sasl & stdlib).
  45. endef
  46. define Package/erlang-asn1
  47. $(call Package/erlang/Default)
  48. TITLE:=Abstract Syntax Notation One (ASN.1) support
  49. VERSION:=3.0.4
  50. DEPENDS+= +erlang +erlang-syntax-tools
  51. endef
  52. define Package/erlang-asn1/description
  53. $(call Package/erlang/Default/description)
  54. .
  55. This Erlang/OTP package provides Abstract Syntax Notation One (ASN.1)
  56. support.
  57. endef
  58. define Package/erlang-compiler
  59. $(call Package/erlang/Default)
  60. TITLE:=Byte code compiler
  61. VERSION:=5.0.4
  62. DEPENDS+= +erlang +erlang-hipe
  63. endef
  64. define Package/erlang-compiler/description
  65. $(call Package/erlang/Default/description)
  66. .
  67. This Erlang/OTP package provides a byte code compiler for Erlang which
  68. produces highly compact code.
  69. endef
  70. define Package/erlang-crypto
  71. $(call Package/erlang/Default)
  72. TITLE:=Cryptography support
  73. VERSION:=3.5
  74. DEPENDS+= +erlang +libopenssl
  75. endef
  76. define Package/erlang-crypto/description
  77. $(call Package/erlang/Default/description)
  78. .
  79. This Erlang/OTP package provides functions for computation of message
  80. digests, and encryption and decryption functions.
  81. endef
  82. define Package/erlang-hipe
  83. $(call Package/erlang/Default)
  84. TITLE:=High Performance Erlang
  85. VERSION:=3.11.3
  86. DEPENDS+= +erlang
  87. endef
  88. define Package/erlang-hipe/description
  89. $(call Package/erlang/Default/description)
  90. .
  91. This Erlang/OTP package provides HiPE (High Performance Erlang)
  92. support.
  93. endef
  94. define Package/erlang-inets
  95. $(call Package/erlang/Default)
  96. TITLE:=Internet clients and servers
  97. VERSION:=5.10.6
  98. DEPENDS+= +erlang
  99. endef
  100. define Package/erlang-inets/description
  101. $(call Package/erlang/Default/description)
  102. .
  103. This Erlang/OTP package provides a container for Internet clients and
  104. servers. Currently a FTP client, a HTTP client and server, and a tftp
  105. client and server have been incorporated in Inets.
  106. endef
  107. define Package/erlang-mnesia
  108. $(call Package/erlang/Default)
  109. TITLE:=Distributed database
  110. VERSION:=4.12.5
  111. DEPENDS+= +erlang
  112. endef
  113. define Package/erlang-mnesia/description
  114. $(call Package/erlang/Default/description)
  115. .
  116. This Erlang/OTP package provides a distributed DataBase Management
  117. System (DBMS), appropriate for telecommunications applications and
  118. other Erlang applications which require continuous operation and
  119. exhibit soft real-time properties.
  120. endef
  121. define Package/erlang-runtime-tools
  122. $(call Package/erlang/Default)
  123. TITLE:=Low-profile debugging/tracing tools
  124. VERSION:=1.8.16
  125. DEPENDS+= +erlang
  126. endef
  127. define Package/erlang-runtime-tools/description
  128. $(call Package/erlang/Default/description)
  129. .
  130. This Erlang/OTP package provides low footprint tracing/debugging tools
  131. suitable for inclusion in a production system.
  132. endef
  133. define Package/erlang-snmp
  134. $(call Package/erlang/Default)
  135. TITLE:=Simple Network Management Protocol (SNMP) support
  136. VERSION:=5.1.1
  137. DEPENDS+= +erlang +erlang-asn1
  138. endef
  139. define Package/erlang-snmp/description
  140. $(call Package/erlang/Default/description)
  141. .
  142. This Erlang/OTP package provides Simple Network Management Protocol
  143. (SNMP) support including a MIB compiler and tools for creating SNMP
  144. agents.
  145. endef
  146. define Package/erlang-ssh
  147. $(call Package/erlang/Default)
  148. TITLE:=Secure Shell (SSH) support
  149. VERSION:=3.2
  150. DEPENDS+= +erlang +erlang-crypto
  151. endef
  152. define Package/erlang-ssh/description
  153. $(call Package/erlang/Default/description)
  154. .
  155. This Erlang/OTP package provides an implementation of the Secure Shell
  156. protocol, with SSH & SFTP support.
  157. endef
  158. define Package/erlang-ssl
  159. $(call Package/erlang/Default)
  160. TITLE:=Secure Sockets Layer (SSL) support
  161. VERSION:=6.0
  162. DEPENDS+= +erlang +erlang-crypto
  163. endef
  164. define Package/erlang-ssl/description
  165. $(call Package/erlang/Default/description)
  166. .
  167. This Erlang/OTP package provides support for secure communication over
  168. sockets.
  169. endef
  170. define Package/erlang-syntax-tools
  171. $(call Package/erlang/Default)
  172. TITLE:=Abstract Erlang syntax trees handling support
  173. VERSION:=1.6.18
  174. DEPENDS+= +erlang
  175. endef
  176. define Package/erlang-syntax-tools/description
  177. $(call Package/erlang/Default/description)
  178. .
  179. This Erlang/OTP package provides support for handling abstract Erlang
  180. syntax trees.
  181. endef
  182. # Host
  183. HOST_CONFIGURE_ARGS += \
  184. --disable-hipe \
  185. --disable-smp-support \
  186. --without-javac
  187. HOST_CFLAGS += -D_GNU_SOURCE
  188. define Host/Compile
  189. $(MAKE) -C $(HOST_BUILD_DIR) all
  190. endef
  191. define Host/Install
  192. $(MAKE) -C $(HOST_BUILD_DIR) install
  193. endef
  194. # Target
  195. CONFIGURE_ARGS += \
  196. --disable-hipe \
  197. --disable-smp-support \
  198. --without-javac \
  199. --enable-dynamic-ssl-lib
  200. CONFIGURE_VARS += \
  201. SHLIB_LD="$(TARGET_CC)" \
  202. TARGET_ARCH="$(TARGET_ARCH)" \
  203. ac_cv_func_mmap_fixed_mapped=yes \
  204. ac_cv_path_WX_CONFIG_PATH=no \
  205. erl_xcomp_getaddrinfo=no \
  206. erl_xcomp_sysroot="$(STAGING_DIR)"
  207. EXTRA_CFLAGS+=-D_GNU_SOURCE
  208. EXTRA_LDFLAGS+=-lz
  209. define Build/Compile
  210. $(MAKE) -C $(PKG_BUILD_DIR) \
  211. noboot
  212. $(MAKE) -C $(PKG_BUILD_DIR) \
  213. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  214. install
  215. endef
  216. define Package/erlang/install
  217. $(INSTALL_DIR) $(1)/usr/bin
  218. for f in epmd erl erlc escript run_erl; do \
  219. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \
  220. done
  221. $(INSTALL_DIR) $(1)/usr/lib/erlang/bin
  222. for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot to_erl; do \
  223. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \
  224. done
  225. $(INSTALL_DIR) $(1)/usr/lib/erlang/lib
  226. for m in erts kernel sasl stdlib; do \
  227. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$m-* $(1)/usr/lib/erlang/lib/ ; \
  228. rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/examples ; \
  229. rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/src ; \
  230. done
  231. $(INSTALL_DIR) $(1)/usr/lib/erlang
  232. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/erts-* $(1)/usr/lib/erlang/
  233. rm -rf $(1)/usr/lib/erlang/erts-*/{doc,include,lib,man,src}
  234. rm -rf $(1)/usr/lib/erlang/erts-*/bin/*.src
  235. $(INSTALL_DIR) $(1)/usr/lib/erlang/releases
  236. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/releases/* $(1)/usr/lib/erlang/releases/
  237. $(SED) 's,%ERL_ROOT%,/usr/lib/erlang,g' \
  238. $(1)/usr/lib/erlang/releases/RELEASES.src
  239. mv -f $(1)/usr/lib/erlang/releases/RELEASES.src \
  240. $(1)/usr/lib/erlang/releases/RELEASES
  241. for f in bin/erl bin/start erts-*/bin/erl erts-*/bin/start; do \
  242. $(SED) 's,^\(ROOTDIR\)=.*,\1=/usr/lib/erlang,g' \
  243. $(1)/usr/lib/erlang/$$$$f ; \
  244. done
  245. endef
  246. define Build/InstallDev
  247. $(INSTALL_DIR) $(1)/usr/lib
  248. $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib/
  249. $(INSTALL_DIR) $(1)/usr/include
  250. $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include/
  251. endef
  252. define BuildModule
  253. define Package/erlang-$(1)/install
  254. $(INSTALL_DIR) $$(1)/usr/lib/erlang/lib
  255. for m in $(2); do \
  256. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$$$$$m-* $$(1)/usr/lib/erlang/lib/ ; \
  257. rm -rf $$(1)/usr/lib/erlang/lib/$$$$$$$$m-*/{examples,priv/obj,src} ; \
  258. done
  259. endef
  260. $$(eval $$(call BuildPackage,erlang-$(1)))
  261. endef
  262. $(eval $(call HostBuild))
  263. $(eval $(call BuildPackage,erlang))
  264. $(eval $(call BuildModule,asn1,asn1))
  265. $(eval $(call BuildModule,compiler,compiler))
  266. $(eval $(call BuildModule,crypto,crypto))
  267. $(eval $(call BuildModule,hipe,hipe))
  268. $(eval $(call BuildModule,inets,inets))
  269. $(eval $(call BuildModule,mnesia,mnesia))
  270. $(eval $(call BuildModule,runtime-tools,runtime_tools))
  271. $(eval $(call BuildModule,snmp,snmp))
  272. $(eval $(call BuildModule,ssh,ssh))
  273. $(eval $(call BuildModule,ssl,ssl))
  274. $(eval $(call BuildModule,syntax-tools,syntax_tools))