logo

overlay

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

erlang-22.1.ebuild (4140B)


  1. # Copyright 1999-2019 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. WX_GTK_VER="3.0"
  5. inherit eapi7-ver 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. SLOT="0"
  16. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris"
  17. IUSE="doc emacs +hipe java +kpoll libressl odbc sctp ssl systemd tk wxwidgets"
  18. RDEPEND="
  19. sys-libs/ncurses:0
  20. sys-libs/zlib
  21. emacs? ( virtual/emacs )
  22. java? ( >=virtual/jdk-1.8:* )
  23. odbc? ( dev-db/unixODBC )
  24. sctp? ( net-misc/lksctp-tools )
  25. ssl? (
  26. !libressl? ( >=dev-libs/openssl-0.9.7d:0= )
  27. libressl? ( dev-libs/libressl:0= )
  28. )
  29. systemd? ( sys-apps/systemd )
  30. tk? ( dev-lang/tk:0 )
  31. wxwidgets? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] )
  32. "
  33. DEPEND="${RDEPEND}
  34. dev-lang/perl
  35. "
  36. S="${WORKDIR}/otp-OTP-${PV}"
  37. PATCHES=(
  38. "${FILESDIR}/18.2.1-wx3.0.patch"
  39. "${FILESDIR}/${PN}-22.0-dont-ignore-LDFLAGS.patch"
  40. "${FILESDIR}/${PN}-add-epmd-pid-file-creation-for-openrc.patch"
  41. )
  42. SITEFILE=50"${PN}"-gentoo.el
  43. src_prepare() {
  44. default
  45. ./otp_build autoconf
  46. }
  47. src_configure() {
  48. use wxwidgets && setup-wxwidgets
  49. local myconf=(
  50. --disable-builtin-zlib
  51. $(use_enable hipe)
  52. $(use_enable kpoll kernel-poll)
  53. $(use_with java javac)
  54. $(use_enable sctp)
  55. $(use_with ssl ssl "${EPREFIX}"/usr)
  56. $(use_enable ssl dynamic-ssl-lib)
  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. local DOCS=( "AUTHORS" "HOWTO"/* "README.md" "CONTRIBUTING.md" "${WORKDIR}"/doc/. "${WORKDIR}"/lib/. "${WORKDIR}"/erts-* )
  85. docompress -x /usr/share/doc/${PF}
  86. else
  87. local DOCS=("README.md")
  88. fi
  89. einstalldocs
  90. dosym "../${erl_libdir_rel}/bin/erl" /usr/bin/erl
  91. dosym "../${erl_libdir_rel}/bin/erlc" /usr/bin/erlc
  92. dosym "../${erl_libdir_rel}/bin/escript" /usr/bin/escript
  93. dosym "../${erl_libdir_rel}/lib/erl_interface-${erl_interface_ver}/bin/erl_call" /usr/bin/erl_call
  94. dosym "../${erl_libdir_rel}/erts-${erl_erts_ver}/bin/beam.smp" /usr/bin/beam.smp
  95. ## Clean up the no longer needed files
  96. rm "${ED}/${erl_libdir}/Install" || die
  97. insinto "${my_manpath}"
  98. doins -r "${WORKDIR}"/man/*
  99. # extend MANPATH, so the normal man command can find it
  100. # see bug 189639
  101. newenvd - "90erlang" <<-_EOF_
  102. MANPATH="${my_manpath}"
  103. _EOF_
  104. if use emacs ; then
  105. elisp-install erlang lib/tools/emacs/*.{el,elc}
  106. sed -e "s:/usr/share:${EPREFIX}/usr/share:g" \
  107. "${FILESDIR}/${SITEFILE}" > "${T}/${SITEFILE}" || die
  108. elisp-site-file-install "${T}/${SITEFILE}"
  109. fi
  110. newinitd "${FILESDIR}"/epmd.init-r1 epmd
  111. newconfd "${FILESDIR}"/epmd.confd epmd
  112. use systemd && systemd_dounit "${FILESDIR}"/epmd.service
  113. }
  114. pkg_postinst() {
  115. use emacs && elisp-site-regen
  116. }
  117. pkg_postrm() {
  118. use emacs && elisp-site-regen
  119. }