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.6.ebuild (4690B)


  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 toolchain-funcs 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 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. "${FILESDIR}"/${PN}-24.0.2-serial-configure.patch
  41. )
  42. SITEFILE=50"${PN}"-gentoo.el
  43. src_prepare() {
  44. default
  45. tc-export AR CPP CXX LD
  46. # bug #797886: erlang's VM does unsafe casts for ints
  47. # to pointers and back. This breaks on gcc-11 -flto.
  48. append-flags -fno-strict-aliasing
  49. }
  50. src_configure() {
  51. use wxwidgets && setup-wxwidgets
  52. local myconf=(
  53. --disable-builtin-zlib
  54. # don't search for static zlib
  55. --with-ssl-zlib=no
  56. $(use_enable kpoll kernel-poll)
  57. $(use_with java javac)
  58. $(use_enable sctp)
  59. $(use_with ssl ssl)
  60. $(use_enable ssl dynamic-ssl-lib)
  61. $(use_enable systemd)
  62. $(usex wxwidgets "--with-wx-config=${WX_CONFIG}" "--with-wxdir=/dev/null")
  63. )
  64. econf "${myconf[@]}"
  65. }
  66. src_compile() {
  67. emake
  68. if use emacs ; then
  69. pushd lib/tools/emacs &>/dev/null || die
  70. elisp-compile *.el
  71. popd &>/dev/null || die
  72. fi
  73. }
  74. extract_version() {
  75. local path="$1"
  76. local var_name="$2"
  77. sed -n -e "/^${var_name} = \(.*\)$/s::\1:p" "${S}/${path}/vsn.mk" || die "extract_version() failed"
  78. }
  79. src_install() {
  80. local erl_libdir_rel="$(get_libdir)/erlang"
  81. local erl_libdir="/usr/${erl_libdir_rel}"
  82. local erl_interface_ver="$(extract_version lib/erl_interface EI_VSN)"
  83. local erl_erts_ver="$(extract_version erts VSN)"
  84. local my_manpath="/usr/share/${PN}/man"
  85. [[ -z "${erl_erts_ver}" ]] && die "Couldn't determine erts version"
  86. [[ -z "${erl_interface_ver}" ]] && die "Couldn't determine interface version"
  87. emake INSTALL_PREFIX="${D}" install
  88. if use doc ; then
  89. # Note: we explicitly install docs into:
  90. # /usr/share/doc/${PF}/{doc,lib,erts-*}
  91. # To maintain that layout we gather everything in 'html-docs'.
  92. # See bug #684376.
  93. mkdir html-docs || die
  94. mv "${WORKDIR}"/doc "${WORKDIR}"/lib "${WORKDIR}"/erts-* html-docs/ || die
  95. local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" html-docs/. )
  96. docompress -x /usr/share/doc/${PF}
  97. else
  98. local DOCS=("README.md")
  99. fi
  100. einstalldocs
  101. dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
  102. dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
  103. dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
  104. dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
  105. dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
  106. ## Clean up the no longer needed files
  107. rm "${ED}/${erl_libdir}/Install" || die
  108. insinto "${my_manpath}"
  109. doins -r "${WORKDIR}"/man/*
  110. # extend MANPATH, so the normal man command can find it
  111. # see bug 189639
  112. newenvd - "90erlang" <<-_EOF_
  113. MANPATH="${my_manpath}"
  114. _EOF_
  115. if use emacs ; then
  116. elisp-install erlang lib/tools/emacs/*.{el,elc}
  117. sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
  118. "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
  119. elisp-site-file-install "${T}/${SITEFILE}"
  120. fi
  121. newinitd "${FILESDIR}"/epmd.init-r2 epmd
  122. newconfd "${FILESDIR}"/epmd.confd-r2 epmd
  123. use systemd && systemd_newunit "${FILESDIR}"/epmd.service-r1 epmd.service
  124. }
  125. pkg_postinst() {
  126. use emacs && elisp-site-regen
  127. }
  128. pkg_postrm() {
  129. use emacs && elisp-site-regen
  130. }