www-apps/converse-js: Add OMEMO support

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
Alarig Le Lay 2020-04-22 19:48:13 +02:00
parent d534f3d10b
commit 8920ac2d9f
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC
2 changed files with 27 additions and 4 deletions

View file

@ -3,7 +3,7 @@
EAPI=7
inherit webapp
inherit savedconfig webapp
MY_PN="${PN/-/.}"
MY_P="${MY_PN}-${PV}"
@ -14,14 +14,21 @@ SRC_URI="https://github.com/${MY_GITHUB_AUTHOR}/${MY_PN}/releases/download/v${PV
LICENSE="MPL-2.0"
KEYWORDS="~amd64 ~x86"
IUSE=""
IUSE="+omemo"
REQUIRED_USE="omemo? ( savedconfig )"
DEPEND=""
DEPEND="omemo? ( www-apps/libsignal-protocol-javascript )"
RDEPEND="${DEPEND}"
BDEPEND=""
S="${WORKDIR}/package"
src_prepare() {
default
restore_config index.html
}
src_install() {
webapp_src_preinst
@ -30,7 +37,17 @@ src_install() {
insinto "${MY_HTDOCSDIR}/"
doins -r .
doins "${FILESDIR}/index.html"
use savedconfig && save_config index.html || doins "${FILESDIR}/index.html"
webapp_src_install
}
pkg_postinst() {
use omemo &&
einfo "To enable OMEMO encryption, you have to edit index.html to add"
einfo " omemo_default: 'true'"
einfo "in converse.initialize and"
einfo " <script type=\"text/javascript\" src=\"libsignal-protocol-javascript/dist/libsignal-protocol.js\">"
einfo "in <head>."
}

View file

@ -5,4 +5,10 @@
<email>alarig@swordarmor.fr</email>
<name>Alarig Le Lay</name>
</maintainer>
<use>
<flag name="omemo">
Enable OMEMO encryption with
<pkg>www-apps/libsignal-protocol-javascript</pkg>.
</flag>
</use>
</pkgmetadata>