# Copyright 2022-2024 Haelwenn (lanodan) Monnier # Distributed under the terms of the GNU General Public License v2 EAPI=7 inherit mix optfeature flag-o-matic DESCRIPTION="ActivityPub social networking software compatible with other Fediverse software" HOMEPAGE="https://pleroma.social/" if [[ "${PV}" == *9999 ]]; then inherit git-r3 EGIT_REPO_URI="https://git.pleroma.social/pleroma/pleroma" else SRC_URI="https://git.pleroma.social/pleroma/pleroma/-/archive/v${PV}/${PN}-v${PV}.tar.gz" S="${WORKDIR}/${PN}-v${PV}" KEYWORDS="~amd64" fi LICENSE="AGPL-3 CC-BY-SA-4.0 CC-BY-4.0" SLOT="otp" IUSE="+system-lexbor" # Requires network access (https) as long as elixir dependencies aren't packaged # said dependencies have their checksum verified via `mix.lock` RESTRICT="network-sandbox" BDEPEND=" =dev-lang/elixir-1.14:= =dev-util/rebar-3.20.0-r1 dev-elixir/hex dev-vcs/git " DEPEND=" dev-libs/glib > config/prod.exs || die echo "import Config" > config/prod.secret.exs || die # Needs -fPIC under glibc for exile library # https://bugs.gentoo.org/937130 append-flags -fPIC } src_compile() { mkdir -p pleroma || die export VIX_COMPILATION_MODE="PLATFORM_PROVIDED_LIBVIPS" use system-lexbor && export WITH_SYSTEM_LEXBOR=1 emix release --overwrite --path pleroma } src_install() { # doins doesn't seems to preserve permissions mkdir -p "${ED}/opt" || die cp -pr ./pleroma "${ED}/opt/pleroma" || die fperms 0750 /opt/pleroma fperms -R g-w,o= /opt/pleroma fowners -R 0:pleroma /opt/pleroma doinitd ./pleroma/installation/init.d/pleroma dosym /opt/pleroma/bin/pleroma /usr/bin/pleroma dosym /opt/pleroma/bin/pleroma_ctl /usr/bin/pleroma_ctl # This file controls console access fperms 0750 /opt/pleroma/releases/COOKIE fowners 0:pleroma /opt/pleroma/releases/COOKIE keepdir /etc/pleroma fperms 0750 /etc/pleroma fowners 0:pleroma /etc/pleroma keepdir /var/lib/pleroma fperms 0750 /var/lib/pleroma fowners pleroma:pleroma /var/lib/pleroma dosym /opt/pleroma-fe/dist /var/lib/pleroma/static/frontends/pleroma-fe/gentoo } pkg_postinst() { optfeature "For Pleroma.Upload.Filters.{Mogrify,Mogrifun} & images in previews" media-gfx/imagemagick optfeature "For video support in Media Preview Proxy" media-video/ffmpeg optfeature "For Pleroma.Upload.Filters.Exiftool.* filters" media-libs/exiftool optfeature "Allows to pick system-managed frontend instead of bundled" www-apps/pleroma-fe }