logo

overlay

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

rebar-3.19.0.ebuild (2542B)


  1. # Copyright 2019-2022 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit bash-completion-r1 rebar3
  5. DESCRIPTION="Erlang build tool that makes it easy to compile and test Erlang applications and releases"
  6. HOMEPAGE="https://www.rebar3.org/"
  7. LICENSE="Apache-2.0"
  8. SRC_URI="
  9. https://github.com/erlang/rebar3/archive/${PV}.tar.gz -> ${P}.tar.gz
  10. https://repo.hex.pm/tarballs/bbmustache-1.12.2.tar
  11. https://repo.hex.pm/tarballs/certifi-2.9.0.tar
  12. https://repo.hex.pm/tarballs/cf-0.3.1.tar
  13. https://repo.hex.pm/tarballs/cth_readable-1.5.1.tar
  14. https://repo.hex.pm/tarballs/erlware_commons-1.5.0.tar
  15. https://repo.hex.pm/tarballs/eunit_formatters-0.5.0.tar
  16. https://repo.hex.pm/tarballs/getopt-1.0.1.tar
  17. https://repo.hex.pm/tarballs/providers-1.9.0.tar
  18. https://repo.hex.pm/tarballs/relx-4.7.0.tar
  19. https://repo.hex.pm/tarballs/ssl_verify_fun-1.1.6.tar
  20. test? ( https://repo.hex.pm/tarballs/meck-0.8.13.tar )
  21. "
  22. S="${WORKDIR}/${PN}3-${PV}"
  23. SLOT="3"
  24. KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
  25. IUSE="test"
  26. RESTRICT="!test? ( test )"
  27. RDEPEND="
  28. dev-lang/erlang[ssl]
  29. !dev-util/rebar-bin
  30. "
  31. RDEPEND="${DEPEND}"
  32. PATCHES=(
  33. # The build directory (where dependencies are usually stored) gets
  34. # cleared before each build. Make the fetch function first look in
  35. # a _checkouts directory before going out over the net.
  36. "${FILESDIR}"/${PN}-3.18.0-bootstrap-vendored.patch
  37. )
  38. src_unpack() {
  39. # Unpack the rebar sources like normal, but extract the hex.pm
  40. # dependencies separately. The outer tarball contains another
  41. # tarball named contents.tar.gz that actually contains the code.
  42. local archive
  43. for archive in ${A}; do
  44. case "${archive}" in
  45. # Assume that the .tar files are our hex.pm dependencies.
  46. *.tar)
  47. local dest="${S}"/_checkouts/"${archive%-*}"
  48. mkdir -p "${dest}" || die
  49. # Extract the inner tarball
  50. tar -O -xf "${DISTDIR}"/"${archive}" contents.tar.gz |
  51. tar -xzf - -C "${dest}"
  52. assert
  53. ;;
  54. *)
  55. unpack "${archive}"
  56. ;;
  57. esac
  58. done
  59. }
  60. src_compile() {
  61. ./bootstrap || die
  62. }
  63. src_test() {
  64. ./rebar3 ct || die
  65. }
  66. src_install() {
  67. rebar3_src_install
  68. dobin rebar3
  69. doman manpages/rebar3.1
  70. dodoc rebar.config.sample
  71. dobashcomp priv/shell-completion/bash/rebar3
  72. newenvd - 98rebar3 <<< 'REBAR3_CMD='${EPREFIX}'/usr/bin/rebar3'
  73. insinto /usr/share/fish/completion
  74. newins priv/shell-completion/fish/rebar3.fish rebar3
  75. insinto /usr/share/zsh/site-functions
  76. doins priv/shell-completion/zsh/_rebar3
  77. }