logo

overlay

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

pleroma-2.5.2.ebuild (3057B)


  1. # Copyright 2022-2023 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit mix optfeature
  5. DESCRIPTION="ActivityPub social networking software compatible with other Fediverse software"
  6. HOMEPAGE="https://pleroma.social/"
  7. if [[ "${PV}" == *9999 ]]; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://git.pleroma.social/pleroma/pleroma"
  10. # git-r3 doesn't allows make.conf override of MIN_CLONE_TYPE, so done here for my self-hosted branch
  11. EGIT_MIN_CLONE_TYPE="single+tags"
  12. else
  13. SRC_URI="https://git.pleroma.social/pleroma/pleroma/-/archive/v${PV}/${PN}-v${PV}.tar.gz"
  14. S="${WORKDIR}/${PN}-v${PV}"
  15. fi
  16. LICENSE="AGPL-3 CC-BY-SA-4.0 CC-BY-4.0"
  17. SLOT="otp"
  18. KEYWORDS="~amd64"
  19. IUSE=""
  20. # Requires network access (https) as long as elixir dependencies aren't packaged
  21. # said dependencies have their checksum verified via `mix.lock`
  22. RESTRICT="network-sandbox"
  23. BDEPEND="
  24. dev-lang/erlang:=
  25. dev-lang/elixir:=
  26. dev-util/cmake
  27. dev-util/rebar
  28. dev-elixir/hex
  29. "
  30. DEPEND="
  31. sys-libs/ncurses:=
  32. sys-apps/file
  33. "
  34. RDEPEND="
  35. ${DEPEND}
  36. acct-user/pleroma
  37. acct-group/pleroma
  38. dev-db/postgresql[uuid]
  39. "
  40. src_unpack() {
  41. default
  42. [[ "${PV}" == *9999 ]] && git-r3_src_unpack
  43. cd "${S}" || die
  44. emix deps.get --only prod
  45. }
  46. src_prepare() {
  47. default
  48. # Point to the correct source repo, needed for AGPL compliance
  49. if [[ "${PV}" == *9999 ]] && [[ -n "${EGIT_OVERRIDE_REPO}" ]]; then
  50. sed -i "s!source_url: .*!source_url: \"${EGIT_OVERRIDE_REPO}\",!" mix.exs || die
  51. fi
  52. sed -i -e '/include_executables_for:/a\ strip_beams: false,\n\ include_erts: false,' mix.exs || die
  53. sed -i \
  54. -e '/update \[OPTIONS\]/,/--tmp-dir/d' \
  55. -e 's;update "$@";echo "Unsupported, check the '"${CATEGORY}/${PN}"' package instead.";' \
  56. rel/files/bin/pleroma_ctl || die
  57. # Default ends up being inside /opt/pleroma which should be kept read-only to pleroma
  58. echo 'config :tzdata, :data_dir, "/var/lib/pleroma/tzdata"' >> config/prod.exs || die
  59. echo "import Config" > config/prod.secret.exs || die
  60. }
  61. src_compile() {
  62. mkdir -p pleroma || die
  63. emix release --overwrite --path pleroma
  64. }
  65. src_install() {
  66. # doins doesn't seems to preserve permissions
  67. mkdir -p "${ED}/opt" || die
  68. cp -pr ./pleroma "${ED}/opt/pleroma" || die
  69. fperms 0750 /opt/pleroma
  70. fowners 0:pleroma /opt/pleroma
  71. dosym /opt/pleroma/bin/pleroma /usr/bin/pleroma
  72. dosym /opt/pleroma/bin/pleroma_ctl /usr/bin/pleroma_ctl
  73. # This file controls console access
  74. fperms 0750 /opt/pleroma/releases/COOKIE
  75. fowners 0:pleroma /opt/pleroma/releases/COOKIE
  76. keepdir /etc/pleroma
  77. fperms 0750 /etc/pleroma
  78. fowners 0:pleroma /etc/pleroma
  79. keepdir /var/lib/pleroma
  80. fperms 0750 /var/lib/pleroma
  81. fowners pleroma:pleroma /var/lib/pleroma
  82. }
  83. pkg_postinst() {
  84. optfeature "For Pleroma.Upload.Filters.{Mogrify,Mogrifun} and still image support in Media Preview Proxy" media-gfx/imagemagick
  85. optfeature "For video support in Media Preview Proxy" media-video/ffmpeg
  86. optfeature "For Pleroma.Upload.Filters.Exiftool.* filters" media-libs/exiftool
  87. }