logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

erlang-24.0.ebuild (4470B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. WX_GTK_VER="3.0-gtk3"
  5. inherit elisp-common java-pkg-opt-2 systemd wxwidgets
  6. # NOTE: If you need symlinks for binaries please tell maintainers or
  7. # open up a bug to let it be created.
  8. UPSTREAM_V="$(ver_cut 1-2)"
  9. DESCRIPTION="Erlang programming language, runtime environment and libraries (OTP)"
  10. HOMEPAGE="https://www.erlang.org/"
  11. SRC_URI="https://github.com/erlang/otp/archive/OTP-${PV}.tar.gz -> ${P}.tar.gz
  12. http://erlang.org/download/otp_doc_man_${UPSTREAM_V}.tar.gz -> ${PN}_doc_man_${UPSTREAM_V}.tar.gz
  13. doc? ( http://erlang.org/download/otp_doc_html_${UPSTREAM_V}.tar.gz -> ${PN}_doc_html_${UPSTREAM_V}.tar.gz )"
  14. LICENSE="Apache-2.0"
  15. # We use this subslot because Compiled HiPE Code can be loaded on the exact
  16. # same build of ERTS that was used when compiling the code. See
  17. # http://erlang.org/doc/system_principles/misc.html for more information.
  18. SLOT="0/${PV}"
  19. KEYWORDS="-amd64 -arm -arm64 -hppa -ia64 -ppc -ppc64 -sparc -x86 -amd64-linux -x86-linux -ppc-macos -x64-macos -x64-solaris"
  20. IUSE="doc emacs +hipe java +kpoll odbc sctp ssl systemd tk wxwidgets"
  21. RDEPEND="
  22. acct-group/epmd
  23. acct-user/epmd
  24. sys-libs/ncurses:0
  25. sys-libs/zlib
  26. emacs? ( >=app-editors/emacs-23.1:* )
  27. java? ( >=virtual/jdk-1.8:* )
  28. odbc? ( dev-db/unixODBC )
  29. sctp? ( net-misc/lksctp-tools )
  30. ssl? ( >=dev-libs/openssl-0.9.7d:0= )
  31. systemd? ( sys-apps/systemd )
  32. wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
  33. "
  34. DEPEND="${RDEPEND}
  35. dev-lang/perl
  36. "
  37. S="${WORKDIR}/otp-OTP-${PV}"
  38. PATCHES=(
  39. "${FILESDIR}"/${PN}-22.0-dont-ignore-LDFLAGS.patch
  40. )
  41. SITEFILE=50"${PN}"-gentoo.el
  42. src_prepare() {
  43. default
  44. ./otp_build autoconf || die
  45. }
  46. src_configure() {
  47. use wxwidgets && setup-wxwidgets
  48. local myconf=(
  49. --disable-builtin-zlib
  50. $(use_enable hipe)
  51. $(use_enable kpoll kernel-poll)
  52. $(use_with java javac)
  53. $(use_enable sctp)
  54. $(use_with ssl ssl "${EPREFIX}"/usr)
  55. $(use_enable ssl dynamic-ssl-lib)
  56. $(use_enable systemd)
  57. $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null")
  58. )
  59. econf "${myconf[@]}"
  60. }
  61. src_compile() {
  62. emake
  63. if use emacs ; then
  64. pushd lib/tools/emacs &>/dev/null || die
  65. elisp-compile *.el
  66. popd &>/dev/null || die
  67. fi
  68. }
  69. extract_version() {
  70. local path="$1"
  71. local var_name="$2"
  72. sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed"
  73. }
  74. src_install() {
  75. local erl_libdir_rel="$(get_libdir)/erlang"
  76. local erl_libdir="/usr/${erl_libdir_rel}"
  77. local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
  78. local erl_erts_ver="$(extract_version erts VSN)"
  79. local my_manpath="/usr/share/${PN}/man"
  80. [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
  81. [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version"
  82. emake INSTALL_PREFIX="${D}" install
  83. if use doc ; then
  84. # Note: we explicitly install docs into:
  85. # /usr/share/doc/${PF}/{doc,lib,erts-*}
  86. # To maintain that layout we gather everything in 'html-docs'.
  87. # See bug #684376.
  88. mkdir html-docs || die
  89. mv "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* html-docs/ || die
  90. local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" html-docs/. )
  91. docompress -x /usr/share/doc/${PF}
  92. else
  93. local DOCS=("README.md")
  94. fi
  95. einstalldocs
  96. dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
  97. dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
  98. dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
  99. dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
  100. dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
  101. ## Clean up the no longer needed files
  102. rm "${ED}/${erl_libdir}/Install" || die
  103. insinto "${my_manpath}"
  104. doins -r "${WORKDIR}"/man/*
  105. # extend MANPATH, so the normal man command can find it
  106. # see bug 189639
  107. newenvd - "90erlang" <<-_EOF_
  108. MANPATH="${my_manpath}"
  109. _EOF_
  110. if use emacs ; then
  111. elisp-install erlang lib/tools/emacs/*.{el,elc}
  112. sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
  113. "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
  114. elisp-site-file-install "${T}/${SITEFILE}"
  115. fi
  116. newinitd "${FILESDIR}"/epmd.init-r2 epmd
  117. newconfd "${FILESDIR}"/epmd.confd-r2 epmd
  118. use systemd && systemd_newunit "${FILESDIR}"/epmd.service-r1 epmd.service
  119. }
  120. pkg_postinst() {
  121. use emacs && elisp-site-regen
  122. }
  123. pkg_postrm() {
  124. use emacs && elisp-site-regen
  125. }