Replace riot

This commit is contained in:
Sergey Morozov
2020-05-30 20:14:51 +03:00
parent b69783cc4c
commit 4eb76f0230
5 changed files with 223 additions and 83 deletions

View File

@@ -0,0 +1,2 @@
DIST riot-desktop-1.6.2.tar.gz 401236 BLAKE2B 0df29f11778d85988b4368de974c2e3ce62b3dfdda4b0c063def27d6bad9ed01814fb85c195aedfc0133b5da34fb49ddb5935fd0ef7149f274f76fcb75056791 SHA512 9709a4704aaef0e670c734c17d2499cd3299cd6cfc3160cda2a9f88954823a47874d619442e25c4f4a35182174db939f95017977af62037471daeae7b61ee666
EBUILD riot-desktop-1.6.2.ebuild 2358 BLAKE2B 0da8789dd31cf5291d190a18e36f1504df0638e3b920c46331d1c0a5d4049c8fec64b8fde857ad1ed30be39600669e41770fe8f7f8ca124bba49c1828ee73d32 SHA512 0496b78fac5ce8d93379617af40aae48d6fe3a9867f9843a2d97f54dfbaf848518716d8de71cb28f2c3e71e7fefb144bcb923957c151dc92066e31a1f4ff245c

View File

@@ -0,0 +1,113 @@
# 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:
# net-im/riot-desktop networkaccess
#
# this avoids disabling `network-sandbox` globally.
EAPI=7
DESCRIPTION="A glossy Matrix collaboration client for desktop"
HOMEPAGE="https://riot.im"
MY_PV="${PV/_rc/-rc.}"
MY_P="$PN-$MY_PV"
S="${WORKDIR}/${MY_P}"
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=""
# get dependencies via readelf -a riot-desktop...
RDEPEND="
x11-libs/cairo
x11-libs/pango
media-libs/fontconfig
=net-im/riot-web-${PV}
"
DEPEND="
${RDEPEND}
sys-apps/yarn
native-extensions? ( dev-db/sqlcipher virtual/rust )
"
src_prepare() {
default
sed -i 's@"https://packages.riot.im/desktop/update/"@null@g' ${S}/riot.im/release/config.json
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}
# `ldd riot-desktop` says only libffmpeg.so is needed
doins libffmpeg.so
doexe ${PN}
popd
# symlink to the actual webapp
dosym ../../../usr/share/webapps/riot-web opt/${PN}/resources/webapp
# config symlink
dosym /etc/${PN}/config.json etc/webapps/riot-web/config.json
insinto etc/${PN}
doins ${S}/riot.im/release/config.json
# symlink to main binary
dosym ../../opt/${PN}/${PN} usr/bin/${PN}
make_desktop_entry /usr/bin/${PN} Riot riot-im.svg
}
pkg_postinst() {
xdg_icon_cache_update
xdg_desktop_database_update
}
pkg_postrm() {
xdg_icon_cache_update
xdg_desktop_database_update
}