2020-05-30 20:14:51 +03:00
|
|
|
# Copyright 1999-2020 Gentoo Foundation
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
# NETWORK ACCESS
|
|
|
|
#
|
|
|
|
# this ebuild requires internet access! because javascript packaging.
|
|
|
|
#
|
|
|
|
# to allow network access just for this package:
|
|
|
|
#
|
|
|
|
# * /etc/portage/env/networkaccess:
|
|
|
|
# FEATURES="${FEATURES} -network-sandbox"
|
|
|
|
#
|
|
|
|
# * /etc/portage/package.env/package.env:
|
2020-07-29 02:01:48 +03:00
|
|
|
# net-im/element-desktop networkaccess
|
2020-05-30 20:14:51 +03:00
|
|
|
#
|
|
|
|
# this avoids disabling `network-sandbox` globally.
|
|
|
|
|
|
|
|
|
|
|
|
EAPI=7
|
|
|
|
|
|
|
|
DESCRIPTION="A glossy Matrix collaboration client for desktop"
|
2020-07-29 02:01:48 +03:00
|
|
|
HOMEPAGE="https://element.io"
|
2020-05-30 20:14:51 +03:00
|
|
|
|
|
|
|
MY_PV="${PV/_rc/-rc.}"
|
|
|
|
MY_P="$PN-$MY_PV"
|
2020-07-29 02:01:48 +03:00
|
|
|
TMP_P="riot-desktop-$MY_PV"
|
|
|
|
S="${WORKDIR}/${TMP_P}"
|
2020-05-30 20:14:51 +03:00
|
|
|
|
|
|
|
if [[ ${PV} == "9999" ]]; then
|
|
|
|
SCM="git-r3"
|
|
|
|
|
|
|
|
SRC_URI=""
|
|
|
|
EGIT_REPO_URI="https://github.com/vector-im/riot-desktop.git"
|
|
|
|
EGIT_BRANCH="develop"
|
|
|
|
else
|
|
|
|
SRC_URI="https://github.com/vector-im/riot-desktop/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
|
|
|
fi
|
|
|
|
|
|
|
|
inherit eutils desktop xdg-utils ${SCM}
|
|
|
|
|
|
|
|
LICENSE="Apache-2.0 MIT BSD"
|
|
|
|
SLOT="0"
|
|
|
|
|
|
|
|
IUSE="+native-extensions"
|
|
|
|
REQUIRED_USE=""
|
|
|
|
|
2020-07-29 02:01:48 +03:00
|
|
|
# get dependencies via readelf -a element-desktop...
|
2020-05-30 20:14:51 +03:00
|
|
|
RDEPEND="
|
|
|
|
x11-libs/cairo
|
|
|
|
x11-libs/pango
|
|
|
|
media-libs/fontconfig
|
2020-07-29 02:01:48 +03:00
|
|
|
=net-im/element-web-${PV}
|
2020-05-30 20:14:51 +03:00
|
|
|
"
|
|
|
|
DEPEND="
|
|
|
|
${RDEPEND}
|
|
|
|
sys-apps/yarn
|
|
|
|
native-extensions? ( dev-db/sqlcipher virtual/rust )
|
|
|
|
"
|
|
|
|
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
default
|
|
|
|
|
2020-07-29 02:01:48 +03:00
|
|
|
sed -i 's@"https://packages.riot.im/desktop/update/"@null@g' ${S}/element.io/release/config.json
|
2020-05-30 20:14:51 +03:00
|
|
|
yarn install || die "yarn module installation failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
if use native-extensions; then
|
|
|
|
yarn run build:native || die "native extensions build failed"
|
|
|
|
fi
|
|
|
|
|
|
|
|
yarn run build || die "build failed"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
dodoc LICENSE*
|
|
|
|
insinto opt/${PN}
|
|
|
|
exeinto opt/${PN}
|
|
|
|
|
|
|
|
pushd ${S}/dist/linux-unpacked
|
|
|
|
doins -r locales resources
|
|
|
|
doins *.{pak,bin,dat}
|
2020-07-29 02:01:48 +03:00
|
|
|
# `ldd element-desktop` says only libffmpeg.so is needed
|
2020-05-30 20:14:51 +03:00
|
|
|
doins libffmpeg.so
|
|
|
|
doexe ${PN}
|
|
|
|
popd
|
|
|
|
|
|
|
|
# symlink to the actual webapp
|
2020-07-29 02:01:48 +03:00
|
|
|
dosym ../../../usr/share/webapps/element-web opt/${PN}/resources/webapp
|
2020-05-30 20:14:51 +03:00
|
|
|
|
|
|
|
# config symlink
|
2020-07-29 02:01:48 +03:00
|
|
|
dosym /etc/${PN}/config.json etc/webapps/element-web/config.json
|
2020-05-30 20:14:51 +03:00
|
|
|
insinto etc/${PN}
|
2020-07-29 02:01:48 +03:00
|
|
|
doins ${S}/element.io/release/config.json
|
2020-05-30 20:14:51 +03:00
|
|
|
|
|
|
|
# symlink to main binary
|
|
|
|
dosym ../../opt/${PN}/${PN} usr/bin/${PN}
|
|
|
|
|
2020-07-29 02:01:48 +03:00
|
|
|
make_desktop_entry /usr/bin/${PN} Element element
|
2020-05-30 20:14:51 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
xdg_icon_cache_update
|
|
|
|
xdg_desktop_database_update
|
|
|
|
}
|
|
|
|
|
|
|
|
pkg_postrm() {
|
|
|
|
xdg_icon_cache_update
|
|
|
|
xdg_desktop_database_update
|
|
|
|
}
|